Project: skia Issues People Development process History Sign in
New issue
Advanced search Search tips
Issue 135 Improved Skia + FreeType support on Windows
Starred by 13 users Reported by jozef.pr...@mothiva.com, Jan 31 2011 Back to list
Status: Accepted
Owner: ----
Cc:
Area: Font
Priority: Icebox
Type: Feature



Sign in to add a comment
Cannot compile Skia with FreeType. SkFontHost members not defined (ValidFontId, OpenStream, CreateTypeface...)


 
Error	12	error LNK2019: unresolved external symbol "public: static bool __cdecl SkFontHost::ValidFontID(unsigned int)" (?ValidFontID@SkFontHost@@SA_NI@Z) referenced in function "private: int __thiscall SkScalerContext_FreeType::setupSize(void)" (?setupSize@SkScalerContext_FreeType@@AAEHXZ)	SkFontHost_FreeType.obj

Error	11	error LNK2019: unresolved external symbol "public: static class SkStream * __cdecl SkFontHost::OpenStream(unsigned int)" (?OpenStream@SkFontHost@@SAPAVSkStream@@I@Z) referenced in function "struct SkFaceRec * __cdecl ref_ft_face(unsigned int)" (?ref_ft_face@@YAPAUSkFaceRec@@I@Z)	SkFontHost_FreeType.obj

Error	5	error LNK2019: unresolved external symbol "public: static class SkTypeface * __cdecl SkFontHost::CreateTypeface(class SkTypeface const *,char const * const,void const *,unsigned int,enum SkTypeface::Style)" (?CreateTypeface@SkFontHost@@SAPAVSkTypeface@@PBV2@QBDPBXIW4Style@2@@Z) referenced in function "public: static unsigned int __cdecl SkTypeface::UniqueID(class SkTypeface const *)" (?UniqueID@SkTypeface@@SAIPBV1@@Z)	SkTypeface.obj

Error	7	error LNK2019: unresolved external symbol "public: static class SkTypeface * __cdecl SkFontHost::CreateTypefaceFromFile(char const * const)" (?CreateTypefaceFromFile@SkFontHost@@SAPAVSkTypeface@@QBD@Z) referenced in function "public: static class SkTypeface * __cdecl SkTypeface::CreateFromFile(char const * const)" (?CreateFromFile@SkTypeface@@SAPAV1@QBD@Z)	SkTypeface.obj

Error	6	error LNK2019: unresolved external symbol "public: static class SkTypeface * __cdecl SkFontHost::CreateTypefaceFromStream(class SkStream *)" (?CreateTypefaceFromStream@SkFontHost@@SAPAVSkTypeface@@PAVSkStream@@@Z) referenced in function "public: static class SkTypeface * __cdecl SkTypeface::CreateFromStream(class SkStream *)" (?CreateFromStream@SkTypeface@@SAPAV1@PAVSkStream@@@Z)	SkTypeface.obj

Error	9	error LNK2019: unresolved external symbol "public: static class SkTypeface * __cdecl SkFontHost::Deserialize(class SkStream *)" (?Deserialize@SkFontHost@@SAPAVSkTypeface@@PAVSkStream@@@Z) referenced in function "public: static class SkTypeface * __cdecl SkTypeface::Deserialize(class SkStream *)" (?Deserialize@SkTypeface@@SAPAV1@PAVSkStream@@@Z)	SkTypeface.obj

Error	2	error LNK2019: unresolved external symbol "public: static int __cdecl SkFontHost::ComputeGammaFlag(class SkPaint const &)" (?ComputeGammaFlag@SkFontHost@@SAHABVSkPaint@@@Z) referenced in function "public: static void __cdecl SkScalerContext::MakeRec(class SkPaint const &,class SkMatrix const *,struct SkScalerContext::Rec *)" (?MakeRec@SkScalerContext@@SAXABVSkPaint@@PBVSkMatrix@@PAURec@1@@Z)	SkPaint.obj

Error	10	error LNK2019: unresolved external symbol "public: static unsigned int __cdecl SkFontHost::GetFileName(unsigned int,char * const,unsigned int,int *)" (?GetFileName@SkFontHost@@SAIIQADIPAH@Z) referenced in function "struct SkFaceRec * __cdecl ref_ft_face(unsigned int)" (?ref_ft_face@@YAPAUSkFaceRec@@I@Z)	SkFontHost_FreeType.obj

Error	4	error LNK2019: unresolved external symbol "public: static unsigned int __cdecl SkFontHost::NextLogicalFont(unsigned int)" (?NextLogicalFont@SkFontHost@@SAII@Z) referenced in function "class SkScalerContext * __cdecl allocNextContext(struct SkScalerContext::Rec const &)" (?allocNextContext@@YAPAVSkScalerContext@@ABURec@1@@Z)	SkScalerContext.obj

Error	1	error LNK2019: unresolved external symbol "public: static unsigned int __cdecl SkFontHost::ShouldPurgeFontCache(unsigned int)" (?ShouldPurgeFontCache@SkFontHost@@SAII@Z) referenced in function "public: static void __cdecl SkGlyphCache::AttachCache(class SkGlyphCache *)" (?AttachCache@SkGlyphCache@@SAXPAV1@@Z)	SkGlyphCache.obj

Error	3	error LNK2019: unresolved external symbol "public: static void __cdecl SkFontHost::GetGammaTables(unsigned char const * * const)" (?GetGammaTables@SkFontHost@@SAXQAPBE@Z) referenced in function "public: __thiscall SkScalerContext::SkScalerContext(class SkDescriptor const *)" (??0SkScalerContext@@QAE@PBVSkDescriptor@@@Z)	SkScalerContext.obj

Error	8	error LNK2019: unresolved external symbol "public: static void __cdecl SkFontHost::Serialize(class SkTypeface const *,class SkWStream *)" (?Serialize@SkFontHost@@SAXPBVSkTypeface@@PAVSkWStream@@@Z) referenced in function "public: void __thiscall SkTypeface::serialize(class SkWStream *)const " (?serialize@SkTypeface@@QBEXPAVSkWStream@@@Z)	SkTypeface.obj

Project Member Comment 2 by reed@google.com, Feb 1 2011
1. what platform are you building for?
2. are you compiling a matching SkFontHost_[mac,win,linux,fontconfig].cpp file?
I am building for Windows. I used SkFontHost_win.cpp. It seems that this file is not complete (missing some class members, as described above), or i have to include another file containing these missed members... But i cannot suitable file...
any ideas? should i provide more info?
Project Member Comment 5 by reed@google.com, Feb 3 2011
brian, can you check what fonthost files you link against in VS?
Project Member Comment 6 by bsalo...@google.com, Feb 3 2011
As far as I can tell I have "SkFontHost.cpp" and "SkFontHost_win.cpp." Maybe your missing the latter?
If I have SkFontHost.cpp and SkFontHost_win.cpp, compilation and linking is ok. But this is case of Win GDI font backend. I need FreeType (on Windows). So i exclude SkFontHost_win.cpp and include SkFontHost_FreeType.cpp - the linking ends with errors (see above). In this case there are some members of SkFontHost class missing, for FreeType there is no ValidFontID (called from SkScalerContext_FreeType::setupSize, file SkFontHost_FreeType.cpp line no. 799), OpenStream, CreateTypeface etc (see above) implementation. The SkFontHost_FreeType.cpp does not contains this members, and i am not able to found their implementation elsewhere. Maybe I have to include some other file but i did not find it in Skia.
I'm interested to know if you solved this problem?

I too would like to get chrome building and working with FreeType under Windows.

I've been messing about with gdipp and managed to more or less replicate the settings that produce OS X-style font rendering, but it'd be good to be able to achieve this in a more streamlined fashion.
Project Member Comment 9 by bsalo...@google.com, Feb 8 2011
Project Member Comment 10 by reed@google.com, Feb 8 2011
Complete support for fonts is chopped into several files for freetype, with SkFontHost_FreeType.cpp just holding the part that is freetype-specific. There also needs to be implementations of SkFontHost functions that deal with finding the font files, etc., and that is platform specific, and not freetype specific.

On linux, which uses freetype, we also link against SkFontHost_linux.cpp, SkFontHost_gamma_none.cpp. You will need equivalents of these for windows (you'll have to write these yourself, as we have nothing like them checked in)
Not good news :-(. Never mind, i am going to study linux impl, hope it will help me to complete missing members for FreeType on Windows...
@ oliver.c... i used code from linux port (SkFontHost_linux.cpp) with few modifications and it works!
SkFontHost_FreeType_win.cpp
16.8 KB View Download
Project Member Comment 13 by bungeman@google.com, Oct 3 2012
Cc: bungeman@google.com
Owner: bungeman@google.com
Status: Accepted
We should probably make the distinction between finding/creating typefaces and using typefaces a little more obvious in SkFontHost implementations since they can be split like this. Also, SkFontHost_linux.cpp should be renamed to something like SkFontHost_dir.cpp (since there is nothing Linux specific about it), and eventually we should get a SkFontHost_fontconfig.cpp.
Project Member Comment 14 by hcm@google.com, Aug 20 2014
Labels: Area-Font
Project Member Comment 15 by hcm@google.com, Jun 2 2015
Labels: -Priority-Medium Priority-Icebox
Keep around in case someday we are able to pick it back up- not a priority at this time.
client_id.json
316 bytes View Download
Comment 17 by yincr...@gmail.com, Jul 13 2016
It would be interesting to support FreeType in Skia for Windows to support all the different color font standards in Chrome (and other Skia apps) instead of just the COLR/CPAL standard which only works in Win8.1+. It would also increase broader support for CBDT/CBLC fonts on the web.
Project Member Comment 18 by hcm@google.com, Jun 29
Labels: -Type-Defect Type-Feature
Owner: ----
Summary: Improved Skia + FreeType support on Windows (was: Skia and FreeType)
Still not finding time to make this a priority but leaving open/available if someone wants to work on it..update description.
Sign in to add a comment