Draw: InvalidateFontList

git-svn-id: svn://ultimatepp.org/upp/trunk@6271 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-08-25 17:03:57 +00:00
parent c64d144719
commit dec1c3cebd
2 changed files with 14 additions and 6 deletions

View file

@ -18,15 +18,21 @@ INITBLOCK {
Value::Register<Font>("Font");
}
static bool sListValid;
void InvalidateFontList()
{
sListValid = false;
}
const Vector<FaceInfo>& Font::List()
{
static Vector<FaceInfo> *q;
ONCELOCK {
static Vector<FaceInfo> x;
x = GetAllFacesSys();
q = &x;
static Vector<FaceInfo> list;
if(!sListValid) {
Set__(sListValid);
list = GetAllFacesSys();
}
return *q;
return list;
}
void sInitFonts()

View file

@ -51,6 +51,8 @@ const CommonFontInfo& GetFontInfo(Font font);
bool IsNormal(Font font, int chr);
void GlyphMetrics(GlyphInfo& f, Font font, int chr);
void InvalidateFontList();
// Platform specific font interface
CommonFontInfo GetFontInfoSys(Font font);