本文整理汇总了C++中SkTypeface::countGlyphs方法的典型用法代码示例。如果您正苦于以下问题:C++ SkTypeface::countGlyphs方法的具体用法?C++ SkTypeface::countGlyphs怎么用?C++ SkTypeface::countGlyphs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkTypeface
的用法示例。
在下文中一共展示了SkTypeface::countGlyphs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: platformGlyphInit
void SimpleFontData::platformGlyphInit() {
SkTypeface* typeface = platformData().typeface();
if (!typeface->countGlyphs()) {
m_spaceGlyph = 0;
m_spaceWidth = 0;
m_zeroGlyph = 0;
m_missingGlyphData.fontData = this;
m_missingGlyphData.glyph = 0;
return;
}
// Nasty hack to determine if we should round or ceil space widths.
// If the font is monospace or fake monospace we ceil to ensure that
// every character and the space are the same width. Otherwise we round.
m_spaceGlyph = glyphForCharacter(' ');
float width = widthForGlyph(m_spaceGlyph);
m_spaceWidth = width;
m_zeroGlyph = glyphForCharacter('0');
m_fontMetrics.setZeroWidth(widthForGlyph(m_zeroGlyph));
m_missingGlyphData.fontData = this;
m_missingGlyphData.glyph = 0;
}