diff --git a/uppsrc/Draw/Draw.h b/uppsrc/Draw/Draw.h index 8c2cec45e..80a9a80d6 100644 --- a/uppsrc/Draw/Draw.h +++ b/uppsrc/Draw/Draw.h @@ -68,7 +68,7 @@ public: enum { FIXEDPITCH = 0x0001, SCALEABLE = 0x0002, - LOCAL = 0x0010, + SPECIAL = 0x0010, }; static int GetFaceCount(); @@ -161,6 +161,8 @@ public: int GetRightSpace(int c) const; bool IsFixedPitch() const { return Fi().fixedpitch; } bool IsScaleable() const { return Fi().scaleable; } + bool IsSpecial() const { return !(GetFaceInfo() & SPECIAL); } + #ifdef PLATFORM_POSIX String GetPath() const { return Fi().path; } #endif diff --git a/uppsrc/Draw/FontWin32.cpp b/uppsrc/Draw/FontWin32.cpp index d14cecf19..0b356ddea 100644 --- a/uppsrc/Draw/FontWin32.cpp +++ b/uppsrc/Draw/FontWin32.cpp @@ -148,7 +148,7 @@ CommonFontInfo GetFontInfoSys(Font font) return fi; } -static Vector *sList; +static VectorMap *sList; static int CALLBACK Win32_AddFace(const LOGFONT *logfont, const TEXTMETRIC *, dword type, LPARAM param) { @@ -161,22 +161,34 @@ static int CALLBACK Win32_AddFace(const LOGFONT *logfont, const TEXTMETRIC *, dw if(facename && stricmp(logfont->lfFaceName, facename)) return 1; #endif - - dword typ = 0; - if((logfont->lfPitchAndFamily & 3) == FIXED_PITCH) - typ |= Font::FIXEDPITCH; - if(type & TRUETYPE_FONTTYPE) - typ |= Font::SCALEABLE; - if(!(logfont->lfCharSet == SYMBOL_CHARSET) && logfont->lfCharSet != 0) - typ |= Font::LOCAL; + if(logfont->lfFaceName[0] == '@') + return 0; + #ifdef PLATFORM_WINCE - FontFaceInfo& f = sFontFace().Add(WString(logfont->lfFaceName).ToString()); + FontFaceInfo& f = sFontFace().GetAdd(WString(logfont->lfFaceName).ToString()); f.name = FromSystemCharset(logfont->lfFaceName); #else - FaceInfo& f = sList->Add(); + String name = FromSystemCharset(logfont->lfFaceName); + + if(FindIndex(Split("Courier New CE;Courier New CYR;Courier New Greek;" + "Courier New TUR;Courier New Baltic;Arial CE;Arial CYR;" + "Arial Greek;Arial TUR;Arial Baltic;Arial CE;Times New Roman CE;" + "Times New Roman CYR;Times New Roman Greek;Times New Roman TUR;" + "Times New Roman Baltic;Times New Roman CE", ';'), name) >= 0) + return 1; + + int q = sList->Find(name); + FaceInfo& f = q < 0 ? sList->Add(logfont->lfFaceName) : (*sList)[q]; f.name = FromSystemCharset(logfont->lfFaceName); - f.info = typ; #endif + if(q < 0) + f.info = Font::SCALEABLE; + if((logfont->lfPitchAndFamily & 3) == FIXED_PITCH) + f.info |= Font::FIXEDPITCH; + if(!(type & TRUETYPE_FONTTYPE)) + f.info &= ~Font::SCALEABLE; + if(logfont->lfCharSet == SYMBOL_CHARSET || logfont->lfCharSet == OEM_CHARSET) + f.info |= Font::SPECIAL; return facename ? 0 : 1; } @@ -199,9 +211,9 @@ static void Win32_ForceFace(HDC hdc, const char *face, const char *aface) Vector GetAllFacesSys() { - Vector list; + VectorMap list; sList = &list; - list.Add().name = "STDFONT"; + list.Add("STDFONT").name = "STDFONT"; list.Top().info = 0; #ifdef PLATFORM_WINCE HDC hdc = CreateDC(NULL, NULL, NULL, NULL); @@ -222,7 +234,7 @@ Vector GetAllFacesSys() #endif Win32_EnumFace(hdc, NULL); DeleteDC(hdc); - return list; + return list.PickValues(); } #define GLYPHINFOCACHE 31 diff --git a/uppsrc/ide/app.tpp/all.i b/uppsrc/ide/app.tpp/all.i index e63417618..f71c78cce 100644 --- a/uppsrc/ide/app.tpp/all.i +++ b/uppsrc/ide/app.tpp/all.i @@ -14,6 +14,10 @@ TOPIC("PackageTemplates$en-us") #include "PackageTemplates$en-us.tppi" END_TOPIC +TOPIC("About$en-us") +#include "About$en-us.tppi" +END_TOPIC + TOPIC("esc$en-us") #include "esc$en-us.tppi" END_TOPIC @@ -58,6 +62,10 @@ TOPIC("Sponsor$en-us") #include "Sponsor$en-us.tppi" END_TOPIC +TOPIC("install$en-us") +#include "install$en-us.tppi" +END_TOPIC + TOPIC("BSD$en-us") #include "BSD$en-us.tppi" END_TOPIC @@ -86,11 +94,3 @@ TOPIC("Blitz$en-us") #include "Blitz$en-us.tppi" END_TOPIC -TOPIC("install$en-us") -#include "install$en-us.tppi" -END_TOPIC - -TOPIC("About$en-us") -#include "About$en-us.tppi" -END_TOPIC -