alternative to get getAdvancedTypefaceMetrics

76 views Asked by At

As getAdvancedTypefaceMetrics of SkTypefce is now private, In my old code it is using in below format.

int FontPlatformData::emSizeInFontUnits() const
 {
     if (m_emSizeInFontUnits)
         return m_emSizeInFontUnits;
     SkAdvancedTypefaceMetrics* metrics = 0;
     if (m_typeface)
             metrics = m_typeface->getAdvancedTypefaceMetrics(SkAdvancedTypefaceMetrics::kNo_PerGlyphInfo);
     if (metrics) {
        m_emSizeInFontUnits = metrics->fEmSize;
         metrics->unref();
     } else
         m_emSizeInFontUnits = 1000;  // default value copied from Skia.
     return m_emSizeInFontUnits;
 }

is there any alternative provided for this API in SKia.

1

There are 1 answers

0
user4303342 On BEST ANSWER

SkTypeFace.h has "getUnitsPerEm()" method, that should help.