mirror of https://github.com/buggins/dlangui.git
warn and fail if no freetype fonts found
This commit is contained in:
parent
4459efb406
commit
016a958a17
|
@ -564,6 +564,11 @@ class FreeTypeFontManager : FontManager {
|
|||
return true;
|
||||
}
|
||||
|
||||
/// returns number of registered fonts
|
||||
@property int registeredFontCount() {
|
||||
return cast(int)_fontFiles.length;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private int myabs(int n) { return n >= 0 ? n : -n; }
|
||||
|
|
|
@ -1133,6 +1133,17 @@ version (Windows) {
|
|||
ft.registerFont("/Library/Fonts/Georgia Italic.ttf", FontFamily.SansSerif, "Georgia", true, FontWeight.Normal);
|
||||
ft.registerFont("/Library/Fonts/Georgia Bold Italic.ttf", FontFamily.SansSerif, "Georgia", true, FontWeight.Bold);
|
||||
}
|
||||
|
||||
if (!ft.registeredFontCount) {
|
||||
Log.e("******************************************************************");
|
||||
Log.e("No font files found!!!");
|
||||
Log.e("Currently, only hardcoded font paths implemented.");
|
||||
Log.e("Probably you can modify sdlapp.d to add some fonts for your system.");
|
||||
Log.e("TODO: use fontconfig");
|
||||
Log.e("******************************************************************");
|
||||
assert(false);
|
||||
}
|
||||
|
||||
FontManager.instance = ft;
|
||||
|
||||
return sdlmain(args);
|
||||
|
|
Loading…
Reference in New Issue