Skip to content

Commit 9a8bbb1

Browse files
committed
use pango_cairo_font_map_set_default(NULL) after registering font, so that available fonts are rescanned. Windows needs to be tested.
git-svn-id: https://svn.code.sf.net/p/vice-emu/code/trunk@45857 379a1393-f5fb-40a0-bcee-ef074d9b53f7
1 parent 408817b commit 9a8bbb1

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

vice/src/arch/shared/archdep_cbmfont.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ int archdep_register_cbmfont(void)
118118
# ifdef HAVE_FONTCONFIG
119119

120120
# include <fontconfig/fontconfig.h>
121+
# include <pango/pangocairo.h>
121122

122123
int archdep_register_cbmfont(void)
123124
{
@@ -151,6 +152,9 @@ int archdep_register_cbmfont(void)
151152
}
152153
}
153154

155+
/* Force Pango to reinitialize so that the available fonts are rescanned */
156+
pango_cairo_font_map_set_default(NULL);
157+
154158
return 1;
155159
}
156160

@@ -190,6 +194,7 @@ static bool font_registered = false;
190194

191195
# include <windows.h>
192196
# include <pango/pango.h>
197+
# include <pango/pangocairo.h>
193198

194199
int archdep_register_cbmfont(void)
195200
{
@@ -253,12 +258,16 @@ int archdep_register_cbmfont(void)
253258
"%s(): According to Windows, the CBM font was succesfully"
254259
" registered.",
255260
__func__);
256-
return 1;
261+
} else {
262+
log_warning(archdep_font_log,
263+
"%s(): According to Windows, registering the font failed",
264+
__func__);
265+
return 0;
257266
}
258-
log_warning(archdep_font_log,
259-
"%s(): According to Windows, registering the font failed",
260-
__func__);
261267
#endif
268+
/* Force Pango to reinitialize so that the available fonts are rescanned */
269+
pango_cairo_font_map_set_default(NULL);
270+
262271
return 1;
263272
}
264273

0 commit comments

Comments
 (0)