void FontBuilder::createFontForDocument(PassRefPtr<FontSelector> fontSelector, RenderStyle* documentStyle) { FontDescription fontDescription = FontDescription(); fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle->locale())); if (Settings* settings = m_document->settings()) { fontDescription.setUsePrinterFont(m_document->printing()); const AtomicString& standardFont = settings->standardFontFamily(fontDescription.script()); if (!standardFont.isEmpty()) { fontDescription.setGenericFamily(FontDescription::StandardFamily); fontDescription.firstFamily().setFamily(standardFont); fontDescription.firstFamily().appendFamily(0); } fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1); int size = FontSize::fontSizeForKeyword(m_document, CSSValueMedium, false); fontDescription.setSpecifiedSize(size); fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(fontDescription, documentStyle->effectiveZoom(), size)); } else { fontDescription.setUsePrinterFont(m_document->printing()); } FontOrientation fontOrientation; NonCJKGlyphOrientation glyphOrientation; getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation); fontDescription.setOrientation(fontOrientation); fontDescription.setNonCJKGlyphOrientation(glyphOrientation); documentStyle->setFontDescription(fontDescription); documentStyle->font().update(fontSelector); }
void FontBuilder::checkForOrientationChange(RenderStyle* style) { FontOrientation fontOrientation; NonCJKGlyphOrientation glyphOrientation; getFontAndGlyphOrientation(style, fontOrientation, glyphOrientation); FontDescriptionChangeScope scope(this); if (scope.fontDescription().orientation() == fontOrientation && scope.fontDescription().nonCJKGlyphOrientation() == glyphOrientation) return; scope.fontDescription().setNonCJKGlyphOrientation(glyphOrientation); scope.fontDescription().setOrientation(fontOrientation); }
void FontBuilder::createFontForDocument(PassRefPtrWillBeRawPtr<FontSelector> fontSelector, RenderStyle* documentStyle) { FontDescription fontDescription = FontDescription(); fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle->locale())); setFontFamilyToStandard(fontDescription, m_document); fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1); int size = FontSize::fontSizeForKeyword(m_document, CSSValueMedium, false); fontDescription.setSpecifiedSize(size); fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(fontDescription, documentStyle->effectiveZoom(), size)); FontOrientation fontOrientation; NonCJKGlyphOrientation glyphOrientation; getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation); fontDescription.setOrientation(fontOrientation); fontDescription.setNonCJKGlyphOrientation(glyphOrientation); documentStyle->setFontDescription(fontDescription); documentStyle->font().update(fontSelector); }