aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkTypeface_win_dw.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2016-08-08 09:09:59 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-08 09:09:59 -0700
commit8b1d32c8d017c84828ed65af38cd1f1e7075ce08 (patch)
tree782bf807efb6198f98931b119e6431fd82f24a9d /src/ports/SkTypeface_win_dw.cpp
parent4e97607d9a1cef66fac16f347c5ca813ec4f9515 (diff)
SkPDF/SkAdvancedTypefaceMetrics: simplify ATM, PDF takes over
No public API changes. TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2222523003 Review-Url: https://codereview.chromium.org/2222523003
Diffstat (limited to 'src/ports/SkTypeface_win_dw.cpp')
-rw-r--r--src/ports/SkTypeface_win_dw.cpp44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/ports/SkTypeface_win_dw.cpp b/src/ports/SkTypeface_win_dw.cpp
index 11e5727e38..7e5c409df1 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)