const Font *MacFontRun::getFont() { if (font) return font; MacFont macFont = MacFont(fontId, fontSize, textSlant); font = wm->_fontMan->getFont(macFont); return font; }
const Font *MacFontManager::getFont(MacFont macFont) { const Font *font = 0; if (!_builtInFonts) { if (macFont.getName().empty()) macFont.setName(getFontName(macFont.getId(), macFont.getSize(), macFont.getSlant())); if (!_fontRegistry.contains(macFont.getName())) generateFontSubstitute(macFont); font = FontMan.getFontByName(macFont.getName()); if (!font) { warning("Cannot load font '%s'", macFont.getName().c_str()); font = FontMan.getFontByName(MacFont(kMacFontChicago, 12).getName()); } } if (_builtInFonts || !font) font = FontMan.getFontByUsage(macFont.getFallback()); return font; }