当前位置: 首页>>代码示例>>C++>>正文


C++ StyleResolver::fontSelector方法代码示例

本文整理汇总了C++中StyleResolver::fontSelector方法的典型用法代码示例。如果您正苦于以下问题:C++ StyleResolver::fontSelector方法的具体用法?C++ StyleResolver::fontSelector怎么用?C++ StyleResolver::fontSelector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StyleResolver的用法示例。


在下文中一共展示了StyleResolver::fontSelector方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: computeNewScaledFontForStyle

void RenderSVGInlineText::computeNewScaledFontForStyle(RenderObject* renderer, const RenderStyle* style, float& scalingFactor, Font& scaledFont)
{
    ASSERT(style);
    ASSERT(renderer);

    Document* document = renderer->document();
    ASSERT(document);
    
    StyleResolver* styleResolver = document->styleResolver();
    ASSERT(styleResolver);

    // Alter font-size to the right on-screen value to avoid scaling the glyphs themselves, except when GeometricPrecision is specified
    scalingFactor = SVGRenderingContext::calculateScreenFontSizeScalingFactor(renderer);
    if (scalingFactor == 1 || !scalingFactor || style->fontDescription().textRenderingMode() == GeometricPrecision) {
        scalingFactor = 1;
        scaledFont = style->font();
        return;
    }

    FontDescription fontDescription(style->fontDescription());

    // FIXME: We need to better handle the case when we compute very small fonts below (below 1pt).
    fontDescription.setComputedSize(StyleResolver::getComputedSizeFromSpecifiedSize(document, scalingFactor, fontDescription.isAbsoluteSize(), fontDescription.computedSize(), DoNotUseSmartMinimumForFontSize));

    scaledFont = Font(fontDescription, 0, 0);
    scaledFont.update(styleResolver->fontSelector());
}
开发者ID:dog-god,项目名称:iptv,代码行数:27,代码来源:RenderSVGInlineText.cpp

示例2: resolveTree

void resolveTree(Document& document, Change change)
{
    bool resolveRootStyle = change == Force || (document.shouldDisplaySeamlesslyWithParent() && change >= Inherit);
    if (resolveRootStyle) {
        RefPtr<RenderStyle> documentStyle = resolveForDocument(document);

#if PLATFORM(IOS)
        // Inserting the pictograph font at the end of the font fallback list is done by the
        // font selector, so set a font selector if needed.
        if (Settings* settings = document.settings()) {
            StyleResolver* styleResolver = document.styleResolverIfExists();
            if (settings->fontFallbackPrefersPictographs() && styleResolver)
                documentStyle->font().update(styleResolver->fontSelector());
        }
#endif

        Style::Change documentChange = determineChange(documentStyle.get(), document.renderer()->style(), document.settings());
        if (documentChange != NoChange)
            document.renderer()->setStyle(documentStyle.release());
    }

    Element* documentElement = document.documentElement();
    if (!documentElement)
        return;
    if (change < Inherit && !documentElement->childNeedsStyleRecalc() && !documentElement->needsStyleRecalc())
        return;
    resolveTree(*documentElement, change);
}
开发者ID:,项目名称:,代码行数:28,代码来源:

示例3: setFontFromControlSize

void RenderThemeSafari::setFontFromControlSize(StyleResolver& styleResolver, RenderStyle& style, NSControlSize controlSize) const
{
    FontDescription fontDescription;
    fontDescription.setIsAbsoluteSize(true);
    fontDescription.setGenericFamily(FontDescription::SerifFamily);

    float fontSize = systemFontSizeForControlSize(controlSize);
    fontDescription.setOneFamily("Lucida Grande");
    fontDescription.setComputedSize(fontSize);
    fontDescription.setSpecifiedSize(fontSize);

    // Reset line height
    style.setLineHeight(RenderStyle::initialLineHeight());

    if (style.setFontDescription(fontDescription))
        style.font().update(styleResolver.fontSelector());
}
开发者ID:ddxxyy,项目名称:webkit,代码行数:17,代码来源:RenderThemeSafari.cpp


注:本文中的StyleResolver::fontSelector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。