diff --git a/uppsrc/Draw/Draw.h b/uppsrc/Draw/Draw.h index 4c8f0542b..c624cb72d 100644 --- a/uppsrc/Draw/Draw.h +++ b/uppsrc/Draw/Draw.h @@ -80,6 +80,7 @@ public: static int FindFaceNameIndex(const String& name); static dword GetFaceInfo(int index); static void SetFace(int index, const String& name, dword info); + static void SetFace(int index, const String& name); static void SetDefaultFont(Font font); static void SetStdFont(Font font); diff --git a/uppsrc/Draw/Font.cpp b/uppsrc/Draw/Font.cpp index 22675dfa9..d6308360b 100644 --- a/uppsrc/Draw/Font.cpp +++ b/uppsrc/Draw/Font.cpp @@ -81,6 +81,13 @@ void Font::SetFace(int index, const String& name, dword info) f.info = info; } +void Font::SetFace(int index, const String& name) +{ + int q = FindFaceNameIndex(name); + q = q >= 0 ? GetFaceInfo(q) : 0; + SetFace(index, name, q); +} + int FontFilter(int c) { return c >= 'a' && c <= 'z' || c >= '0' && c <= '9' ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0;