Index: src/ports/SkTypeface_win_dw.cpp |
diff --git a/src/ports/SkTypeface_win_dw.cpp b/src/ports/SkTypeface_win_dw.cpp |
index de599d67e5dc7cab83c56305a30b430550854ae5..87fbcd2f6cfc70b00190951837f5892afa1d492f 100644 |
--- a/src/ports/SkTypeface_win_dw.cpp |
+++ b/src/ports/SkTypeface_win_dw.cpp |
@@ -450,8 +450,13 @@ SkAdvancedTypefaceMetrics* DWriteFontTypeface::onGetAdvancedTypefaceMetrics( |
&range, 0, SkAdvancedTypefaceMetrics::WidthRange::kDefault); |
info->fGlyphWidths.emplace_back(std::move(range)); |
} else { |
- info->setGlyphWidths(fDWriteFontFace.get(), glyphCount, glyphIDs, |
- glyphIDsCount, getWidthAdvance); |
+ IDWriteFontFace* borrowedFontFace = fDWriteFontFace.get(); |
+ info->setGlyphWidths( |
+ glyphCount, glyphIDs, glyphIDsCount, |
+ SkAdvancedTypefaceMetrics::GetAdvance( |
+ [borrowedFontFace](int gId, int16_t* data) { |
+ return getWidthAdvance(borrowedFontFace, gId, data); |
+ })); |
} |
} |