本文整理汇总了C++中FontDescription::effectiveFontSize方法的典型用法代码示例。如果您正苦于以下问题:C++ FontDescription::effectiveFontSize方法的具体用法?C++ FontDescription::effectiveFontSize怎么用?C++ FontDescription::effectiveFontSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FontDescription
的用法示例。
在下文中一共展示了FontDescription::effectiveFontSize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
PassRefPtr<SimpleFontData> BinaryDataFontFaceSource::createFontData(const FontDescription& fontDescription)
{
return SimpleFontData::create(
m_customPlatformData->fontPlatformData(fontDescription.effectiveFontSize(),
fontDescription.isSyntheticBold(), fontDescription.isSyntheticItalic(),
fontDescription.orientation()), CustomFontData::create());
}
示例2: createLoadingFallbackFontData
PassRefPtr<SimpleFontData> SVGRemoteFontFaceSource::createFontData(const FontDescription& fontDescription)
{
if (!isLoaded())
return createLoadingFallbackFontData(fontDescription);
// Parse the external SVG document, and extract the <font> element.
if (!resource()->ensureSVGFontData())
return nullptr;
if (!m_externalSVGFontElement) {
String fragmentIdentifier;
size_t start = m_uri.find('#');
if (start != kNotFound)
fragmentIdentifier = m_uri.substring(start + 1);
m_externalSVGFontElement = resource()->getSVGFontById(fragmentIdentifier);
}
if (!m_externalSVGFontElement)
return nullptr;
// Select first <font-face> child
if (SVGFontFaceElement* fontFaceElement = Traversal<SVGFontFaceElement>::firstChild(*m_externalSVGFontElement)) {
return SimpleFontData::create(
SVGFontData::create(fontFaceElement),
fontDescription.effectiveFontSize(),
fontDescription.isSyntheticBold(),
fontDescription.isSyntheticItalic());
}
return nullptr;
}
示例3: createLoadingFallbackFontData
PassRefPtr<SimpleFontData> RemoteFontFaceSource::createFontData(const FontDescription& fontDescription)
{
if (!isLoaded())
return createLoadingFallbackFontData(fontDescription);
if (!m_font->ensureCustomFontData() || m_period == FailurePeriod)
return nullptr;
m_histograms.recordFallbackTime(m_font.get());
return SimpleFontData::create(
m_font->platformDataFromCustomData(fontDescription.effectiveFontSize(),
fontDescription.isSyntheticBold(), fontDescription.isSyntheticItalic(),
fontDescription.orientation()), CustomFontData::create());
}
示例4: createLoadingFallbackFontData
PassRefPtr<SimpleFontData> RemoteFontFaceSource::createFontData(const FontDescription& fontDescription)
{
if (!isLoaded())
return createLoadingFallbackFontData(fontDescription);
// Create new FontPlatformData from our CGFontRef, point size and ATSFontRef.
if (!m_font->ensureCustomFontData())
return nullptr;
m_histograms.recordFallbackTime(m_font.get());
return SimpleFontData::create(
m_font->platformDataFromCustomData(fontDescription.effectiveFontSize(),
fontDescription.isSyntheticBold(), fontDescription.isSyntheticItalic(),
fontDescription.orientation(), fontDescription.widthVariant()), CustomFontData::create());
}
示例5: ENABLE
PassRefPtr<SimpleFontData> CSSFontFaceSource::getFontData(const FontDescription& fontDescription)
{
// If the font hasn't loaded or an error occurred, then we've got nothing.
if (!isValid())
return 0;
if (isLocal()) {
// We're local. Just return a SimpleFontData from the normal cache.
// We don't want to check alternate font family names here, so pass true as the checkingAlternateName parameter.
RefPtr<SimpleFontData> fontData = FontCache::fontCache()->getFontData(fontDescription, m_string, true);
m_histograms.recordLocalFont(fontData);
return fontData;
}
// See if we have a mapping in our FontData cache.
AtomicString emptyFontFamily = "";
FontCacheKey key = fontDescription.cacheKey(emptyFontFamily);
RefPtr<SimpleFontData>& fontData = m_fontDataTable.add(key.hash(), 0).iterator->value;
if (fontData)
return fontData; // No release, because fontData is a reference to a RefPtr that is held in the m_fontDataTable.
// If we are still loading, then we let the system pick a font.
if (isLoaded()) {
if (m_font) {
#if ENABLE(SVG_FONTS)
if (m_hasExternalSVGFont) {
// For SVG fonts parse the external SVG document, and extract the <font> element.
if (!m_font->ensureSVGFontData())
return 0;
if (!m_externalSVGFontElement) {
String fragmentIdentifier;
size_t start = m_string.find('#');
if (start != kNotFound)
fragmentIdentifier = m_string.string().substring(start + 1);
m_externalSVGFontElement = m_font->getSVGFontById(fragmentIdentifier);
}
if (!m_externalSVGFontElement)
return 0;
SVGFontFaceElement* fontFaceElement = 0;
// Select first <font-face> child
for (Node* fontChild = m_externalSVGFontElement->firstChild(); fontChild; fontChild = fontChild->nextSibling()) {
if (fontChild->hasTagName(SVGNames::font_faceTag)) {
fontFaceElement = toSVGFontFaceElement(fontChild);
break;
}
}
if (fontFaceElement) {
if (!m_svgFontFaceElement) {
// We're created using a CSS @font-face rule, that means we're not associated with a SVGFontFaceElement.
// Use the imported <font-face> tag as referencing font-face element for these cases.
m_svgFontFaceElement = fontFaceElement;
}
fontData = SimpleFontData::create(
SVGFontData::create(fontFaceElement),
fontDescription.effectiveFontSize(),
fontDescription.isSyntheticBold(),
fontDescription.isSyntheticItalic());
}
} else
#endif
{
// Create new FontPlatformData from our CGFontRef, point size and ATSFontRef.
if (!m_font->ensureCustomFontData())
return 0;
fontData = SimpleFontData::create(
m_font->platformDataFromCustomData(fontDescription.effectiveFontSize(),
fontDescription.isSyntheticBold(), fontDescription.isSyntheticItalic(),
fontDescription.orientation(), fontDescription.widthVariant()), CustomFontData::create(false));
}
} else {
#if ENABLE(SVG_FONTS)
// In-Document SVG Fonts
if (m_svgFontFaceElement) {
fontData = SimpleFontData::create(
SVGFontData::create(m_svgFontFaceElement.get()),
fontDescription.effectiveFontSize(),
fontDescription.isSyntheticBold(),
fontDescription.isSyntheticItalic());
}
#endif
}
} else {
// This temporary font is not retained and should not be returned.
FontCachePurgePreventer fontCachePurgePreventer;
SimpleFontData* temporaryFont = FontCache::fontCache()->getNonRetainedLastResortFallbackFont(fontDescription);
if (!temporaryFont) {
ASSERT_NOT_REACHED();
return 0;
}
RefPtr<CSSCustomFontData> cssFontData = CSSCustomFontData::create(true);
cssFontData->setCSSFontFaceSource(this);
fontData = SimpleFontData::create(temporaryFont->platformData(), cssFontData);
//.........这里部分代码省略.........