diff --git a/include/Mw/StringDefs.h b/include/Mw/StringDefs.h
index 0711373..deac295 100644
--- a/include/Mw/StringDefs.h
+++ b/include/Mw/StringDefs.h
@@ -35,6 +35,7 @@
#define MwNratio "Iratio"
#define MwNfixedSize "IfixedSize"
#define MwNmargin "Imargin"
+#define MwNbitmapFont "IbitmapFont"
#define MwNtitle "Stitle"
#define MwNtext "Stext"
diff --git a/milsko.xml b/milsko.xml
index 758eb1f..d46e0d3 100644
--- a/milsko.xml
+++ b/milsko.xml
@@ -51,6 +51,7 @@
- MwNbackgroundPixmap
- MwNratio
- MwNfixedSize
+ - MwNbitmapFont
Integer properties must be prefixed with I.
String properties must be prefixed with S.
@@ -87,6 +88,7 @@
+
diff --git a/src/core.c b/src/core.c
index 0ae8d4a..c68e39a 100644
--- a/src/core.c
+++ b/src/core.c
@@ -593,8 +593,12 @@ void MwSetDefault(MwWidget handle) {
inherit_integer(handle, MwNmodernLook, 1);
#endif
#if defined(USE_STB_TRUETYPE) || defined(USE_FREETYPE2)
+ inherit_integer(handle, MwNbitmapFont, 0);
+
set_font(handle);
set_boldfont(handle);
+#else
+ inherit_integer(handle, MwNbitmapFont, 1);
#endif
}
diff --git a/src/text.c b/src/text.c
index 7d94e5c..a9ff6a0 100644
--- a/src/text.c
+++ b/src/text.c
@@ -294,7 +294,7 @@ static int ttf_MwTextHeight(MwWidget handle, int count) {
void MwDrawText(MwWidget handle, MwPoint* point, const char* text, int bold, int align, MwLLColor color) {
if(strlen(text) == 0) return;
#ifdef TTF
- if(ttf_MwDrawText(handle, point, text, bold, align, color))
+ if(!MwGetInteger(handle, MwNbitmapFont) && ttf_MwDrawText(handle, point, text, bold, align, color))
#endif
bitmap_MwDrawText(handle, point, text, bold, align, color);
}
@@ -304,7 +304,7 @@ int MwTextWidth(MwWidget handle, const char* text) {
#ifdef TTF
int st;
- if((st = ttf_MwTextWidth(handle, text)) != -1) return st;
+ if(!MwGetInteger(handle, MwNbitmapFont) && (st = ttf_MwTextWidth(handle, text)) != -1) return st;
#else
(void)handle;
@@ -331,7 +331,7 @@ int MwTextHeight(MwWidget handle, const char* text) {
if(out == '\n') c++;
}
#ifdef TTF
- if((st = ttf_MwTextHeight(handle, c)) != -1) return st;
+ if(!MwGetInteger(handle, MwNbitmapFont) && (st = ttf_MwTextHeight(handle, c)) != -1) return st;
#endif
return FontHeight * c;
}