diff --git a/src/dlangui/graphics/ftfonts.d b/src/dlangui/graphics/ftfonts.d index 25a34242..e1aa4d33 100644 --- a/src/dlangui/graphics/ftfonts.d +++ b/src/dlangui/graphics/ftfonts.d @@ -222,7 +222,7 @@ private class FreeTypeFontFile { } /// retrieve glyph information, filling glyph struct; returns false if glyph not found - bool getGlyphInfo(dchar code, Glyph glyph, dchar def_char, bool withImage = true) + bool getGlyphInfo(dchar code, ref Glyph glyph, dchar def_char, bool withImage = true) { //FONT_GUARD int glyph_index = getCharIndex(code, def_char); diff --git a/src/dlangui/platforms/windows/winapp.d b/src/dlangui/platforms/windows/winapp.d index 49fe5d00..adb3b270 100644 --- a/src/dlangui/platforms/windows/winapp.d +++ b/src/dlangui/platforms/windows/winapp.d @@ -414,10 +414,8 @@ int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int } Platform.setInstance(platform); - Win32FontManager fontMan = new Win32FontManager(); - FontManager.instance = fontMan; - { + if (true) { /// testing freetype font manager import dlangui.graphics.ftfonts; import win32.shlobj; @@ -448,6 +446,13 @@ int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int ftfontMan.registerFont(fontsPath ~ "timesbd.ttf", FontFamily.Serif, "Times New Roman", false, FontWeight.Bold); ftfontMan.registerFont(fontsPath ~ "timesbi.ttf", FontFamily.Serif, "Times New Roman", true, FontWeight.Bold); ftfontMan.registerFont(fontsPath ~ "timesi.ttf", FontFamily.Serif, "Times New Roman", true, FontWeight.Normal); + FontManager.instance = ftfontMan; + } + + // use Win32 font manager + if (FontManager.instance is null) { + Win32FontManager fontMan = new Win32FontManager(); + FontManager.instance = fontMan; } version (USE_OPENGL) {