DirectWrite support (#28)
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
Reviewed-on: #28
This commit is contained in:
parent
610c63228e
commit
575b8eaee1
17 changed files with 24715 additions and 54 deletions
15
src/core.c
15
src/core.c
|
|
@ -310,12 +310,19 @@ static MwWidget MwCreateWidget_Internal(MwClass widget_class, const char* name,
|
|||
MwAddTickList(h);
|
||||
}
|
||||
|
||||
#if defined(USE_STB_TRUETYPE) || defined(USE_FREETYPE2)
|
||||
#if defined(USE_STB_TRUETYPE) || defined(USE_FREETYPE2) || defined(USE_DIRECTWRITE)
|
||||
if(IsFirstVisible(h)) {
|
||||
font_setup:
|
||||
h->root_font = MwFontLoad(MwTTFData, MwTTFDataSize);
|
||||
h->root_boldfont = MwFontLoad(MwBoldTTFData, MwBoldTTFDataSize);
|
||||
h->root_monofont = MwFontLoad(MwMonospaceTTFData, MwMonospaceTTFDataSize);
|
||||
h->root_boldmonofont = MwFontLoad(MwBoldMonospaceTTFData, MwBoldMonospaceTTFDataSize);
|
||||
if(!h->root_font) {
|
||||
#ifdef USE_STB_TRUETYPE
|
||||
MwFL_STBTTSetup();
|
||||
goto font_setup;
|
||||
#endif
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
|
@ -732,7 +739,7 @@ int MwGetInteger(MwWidget handle, const char* key) {
|
|||
return MwDEFAULT;
|
||||
} else {
|
||||
if(shgeti(handle->integer, key) == -1) {
|
||||
#if defined(USE_STB_TRUETYPE) || defined(USE_FREETYPE2)
|
||||
#if defined(USE_STB_TRUETYPE) || defined(USE_FREETYPE2) || defined(USE_DIRECTWRITE)
|
||||
if(strcmp(key, MwNbitmapFont) == 0) return inherit_integer(handle, key, 0);
|
||||
#else
|
||||
if(strcmp(key, MwNbitmapFont) == 0) return inherit_integer(handle, key, 1);
|
||||
|
|
@ -783,7 +790,7 @@ const char* MwGetText(MwWidget handle, const char* key) {
|
|||
return shget(handle->text, key);
|
||||
}
|
||||
|
||||
#if defined(USE_STB_TRUETYPE) || defined(USE_FREETYPE2)
|
||||
#if defined(USE_STB_TRUETYPE) || defined(USE_FREETYPE2) || defined(USE_DIRECTWRITE)
|
||||
static void* inherit_void(MwWidget handle, const char* key) {
|
||||
void* v;
|
||||
|
||||
|
|
@ -799,7 +806,7 @@ void* MwGetVoid(MwWidget handle, const char* key) {
|
|||
|
||||
if(v != NULL) return v;
|
||||
|
||||
#if defined(USE_STB_TRUETYPE) || defined(USE_FREETYPE2)
|
||||
#if defined(USE_STB_TRUETYPE) || defined(USE_FREETYPE2) || defined(USE_DIRECTWRITE)
|
||||
if(strcmp(key, MwNfont) == 0 || strcmp(key, MwNboldFont) == 0 || strcmp(key, MwNmonospaceFont) == 0 || strcmp(key, MwNboldMonospaceFont) == 0) {
|
||||
v = inherit_void(handle, key);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue