Browse Source

clean up register_font to have clearer flow

master
Caleb Hearon 9 years ago
parent
commit
1a8c00c64c
  1. 6
      src/register_font.cc

6
src/register_font.cc

@ -24,11 +24,13 @@ register_font(unsigned char *filepath) {
success = FcConfigAppFontAddFile(FcConfigGetCurrent(), (FcChar8 *)(filepath)); success = FcConfigAppFontAddFile(FcConfigGetCurrent(), (FcChar8 *)(filepath));
#endif #endif
if (!success) return false;
// Tell Pango to throw away the current FontMap and create a new one. This // Tell Pango to throw away the current FontMap and create a new one. This
// has the effect of registering the new font in Pango by re-looking up all // has the effect of registering the new font in Pango by re-looking up all
// font families. // font families.
if (success) pango_cairo_font_map_set_default(NULL); pango_cairo_font_map_set_default(NULL);
return success; return true;
} }

Loading…
Cancel
Save