Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: src/ports/SkTypeface_win_dw.cpp

Issue 2222523003: SkPDF/SkAdvancedTypefaceMetrics: simplify ATM, PDF takes over (Closed) Base URL: https://skia.googlesource.com/skia.git@SkPDF_no_kHAdvance
Patch Set: rebase and nit Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | tests/WArrayTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkTypeface_win_dw.cpp
diff --git a/src/ports/SkTypeface_win_dw.cpp b/src/ports/SkTypeface_win_dw.cpp
index 11e5727e389cb8247b5991fd530227dd78393e60..7e5c409df1395939c002152495de201f8afe8958 100644
--- a/src/ports/SkTypeface_win_dw.cpp
+++ b/src/ports/SkTypeface_win_dw.cpp
@@ -419,50 +419,6 @@ SkAdvancedTypefaceMetrics* DWriteFontTypeface::onGetAdvancedTypefaceMetrics(
(int32_t)SkEndian_SwapBE16((uint16_t)headTable->yMax),
(int32_t)SkEndian_SwapBE16((uint16_t)headTable->xMax),
(int32_t)SkEndian_SwapBE16((uint16_t)headTable->yMin));
-
- //TODO: is this even desired? It seems PDF only wants this value for Type1
- //fonts, and we only get here for TrueType fonts.
- info->fStemV = 0;
- /*
- // Figure out a good guess for StemV - Min width of i, I, !, 1.
- // This probably isn't very good with an italic font.
- int16_t min_width = SHRT_MAX;
- info->fStemV = 0;
- char stem_chars[] = {'i', 'I', '!', '1'};
- for (size_t i = 0; i < SK_ARRAY_COUNT(stem_chars); i++) {
- ABC abcWidths;
- if (GetCharABCWidths(hdc, stem_chars[i], stem_chars[i], &abcWidths)) {
- int16_t width = abcWidths.abcB;
- if (width > 0 && width < min_width) {
- min_width = width;
- info->fStemV = min_width;
- }
- }
- }
- */
-
- if (perGlyphInfo & kHAdvance_PerGlyphInfo) {
- if (fixedWidth) {
- SkAdvancedTypefaceMetrics::WidthRange range(0);
- int16_t advance;
- getWidthAdvance(fDWriteFontFace.get(), 1, &advance);
- range.fAdvance.append(1, &advance);
- SkAdvancedTypefaceMetrics::FinishRange(
- &range, 0, SkAdvancedTypefaceMetrics::WidthRange::kDefault);
- info->fGlyphWidths.emplace_back(std::move(range));
- } else {
- IDWriteFontFace* borrowedFontFace = fDWriteFontFace.get();
- info->setGlyphWidths(
- glyphCount,
- glyphIDs,
- glyphIDsCount,
- SkAdvancedTypefaceMetrics::GetAdvance([borrowedFontFace](int gId, int16_t* data) {
- return getWidthAdvance(borrowedFontFace, gId, data);
- })
- );
- }
- }
-
return info;
}
#endif//defined(SK_BUILD_FOR_WIN32)
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | tests/WArrayTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698