0

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.

dead programmer
  • 4,223
  • 9
  • 46
  • 77

1 Answers1

1

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