| Index: trunk/src/core/SkTypeface.cpp
|
| ===================================================================
|
| --- trunk/src/core/SkTypeface.cpp (revision 8293)
|
| +++ trunk/src/core/SkTypeface.cpp (working copy)
|
| @@ -132,32 +132,33 @@
|
| }
|
|
|
| int SkTypeface::getUnitsPerEm() const {
|
| + // should we try to cache this in the base-class?
|
| + return this->onGetUPEM();
|
| +}
|
| +
|
| +///////////////////////////////////////////////////////////////////////////////
|
| +///////////////////////////////////////////////////////////////////////////////
|
| +
|
| +#include "SkFontDescriptor.h"
|
| +
|
| +int SkTypeface::onGetUPEM() const {
|
| int upem = 0;
|
|
|
| -#ifdef SK_BUILD_FOR_ANDROID
|
| - upem = SkFontHost::GetUnitsPerEm(fUniqueID);
|
| -#else
|
| SkAdvancedTypefaceMetrics* metrics;
|
| metrics = this->getAdvancedTypefaceMetrics(
|
| - SkAdvancedTypefaceMetrics::kNo_PerGlyphInfo,
|
| - NULL, 0);
|
| + SkAdvancedTypefaceMetrics::kNo_PerGlyphInfo,
|
| + NULL, 0);
|
| if (metrics) {
|
| upem = metrics->fEmSize;
|
| metrics->unref();
|
| }
|
| -#endif
|
| return upem;
|
| }
|
|
|
| -///////////////////////////////////////////////////////////////////////////////
|
| -///////////////////////////////////////////////////////////////////////////////
|
| -
|
| -#include "SkFontDescriptor.h"
|
| -
|
| -int SkTypeface::onGetUPEM() const { return 0; }
|
| int SkTypeface::onGetTableTags(SkFontTableTag tags[]) const { return 0; }
|
| size_t SkTypeface::onGetTableData(SkFontTableTag, size_t offset,
|
| size_t length, void* data) const { return 0; }
|
| void SkTypeface::onGetFontDescriptor(SkFontDescriptor* desc) const {
|
| desc->setStyle(this->style());
|
| }
|
| +
|
|
|