mirror of https://github.com/buggins/dlangui.git
FreeType font manager is working
This commit is contained in:
parent
aab292ecad
commit
d6d36a21a1
|
@ -222,7 +222,7 @@ private class FreeTypeFontFile {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// retrieve glyph information, filling glyph struct; returns false if glyph not found
|
/// 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
|
//FONT_GUARD
|
||||||
int glyph_index = getCharIndex(code, def_char);
|
int glyph_index = getCharIndex(code, def_char);
|
||||||
|
|
|
@ -414,10 +414,8 @@ int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int
|
||||||
}
|
}
|
||||||
Platform.setInstance(platform);
|
Platform.setInstance(platform);
|
||||||
|
|
||||||
Win32FontManager fontMan = new Win32FontManager();
|
|
||||||
FontManager.instance = fontMan;
|
|
||||||
|
|
||||||
{
|
if (true) {
|
||||||
/// testing freetype font manager
|
/// testing freetype font manager
|
||||||
import dlangui.graphics.ftfonts;
|
import dlangui.graphics.ftfonts;
|
||||||
import win32.shlobj;
|
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 ~ "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 ~ "timesbi.ttf", FontFamily.Serif, "Times New Roman", true, FontWeight.Bold);
|
||||||
ftfontMan.registerFont(fontsPath ~ "timesi.ttf", FontFamily.Serif, "Times New Roman", true, FontWeight.Normal);
|
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) {
|
version (USE_OPENGL) {
|
||||||
|
|
Loading…
Reference in New Issue