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

Side by Side Diff: src/ports/SkFontHost_FreeType.cpp

Issue 596513002: Don't try to scale embedded bitmaps. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments. Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkAdvancedTypefaceMetrics.h" 9 #include "SkAdvancedTypefaceMetrics.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 glyph->fAdvanceX = SkFDot6ToFixed(fFace->glyph->advance.x); 1294 glyph->fAdvanceX = SkFDot6ToFixed(fFace->glyph->advance.x);
1295 glyph->fAdvanceY = -SkFDot6ToFixed(fFace->glyph->advance.y); 1295 glyph->fAdvanceY = -SkFDot6ToFixed(fFace->glyph->advance.y);
1296 1296
1297 if (fRec.fFlags & kDevKernText_Flag) { 1297 if (fRec.fFlags & kDevKernText_Flag) {
1298 glyph->fRsbDelta = SkToS8(fFace->glyph->rsb_delta); 1298 glyph->fRsbDelta = SkToS8(fFace->glyph->rsb_delta);
1299 glyph->fLsbDelta = SkToS8(fFace->glyph->lsb_delta); 1299 glyph->fLsbDelta = SkToS8(fFace->glyph->lsb_delta);
1300 } 1300 }
1301 } 1301 }
1302 } 1302 }
1303 1303
1304 if (fFace->glyph->format == FT_GLYPH_FORMAT_BITMAP && fScaleY && fFace->size ->metrics.y_ppem) { 1304 // If the font isn't scalable, scale the metrics from the non-scalable strik e.
1305 // This means do not try to scale embedded bitmaps; only scale bitmaps in bi tmap only fonts.
1306 if (!FT_IS_SCALABLE(fFace) && fScaleY && fFace->size->metrics.y_ppem) {
1305 // NOTE: both dimensions are scaled by y_ppem. this is WAI. 1307 // NOTE: both dimensions are scaled by y_ppem. this is WAI.
1306 scaleGlyphMetrics(*glyph, SkScalarDiv(SkFixedToScalar(fScaleY), 1308 scaleGlyphMetrics(*glyph, SkScalarDiv(SkFixedToScalar(fScaleY),
1307 SkIntToScalar(fFace->size->metrics .y_ppem))); 1309 SkIntToScalar(fFace->size->metrics .y_ppem)));
1308 } 1310 }
1309 1311
1310 #ifdef ENABLE_GLYPH_SPEW 1312 #ifdef ENABLE_GLYPH_SPEW
1311 SkDEBUGF(("FT_Set_Char_Size(this:%p sx:%x sy:%x ", this, fScaleX, fScaleY)); 1313 SkDEBUGF(("FT_Set_Char_Size(this:%p sx:%x sy:%x ", this, fScaleX, fScaleY));
1312 SkDEBUGF(("Metrics(glyph:%d flags:0x%x) w:%d\n", glyph->getGlyphID(), fLoadG lyphFlags, glyph->fWidth)); 1314 SkDEBUGF(("Metrics(glyph:%d flags:0x%x) w:%d\n", glyph->getGlyphID(), fLoadG lyphFlags, glyph->fWidth));
1313 #endif 1315 #endif
1314 } 1316 }
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 *style = (SkTypeface::Style) tempStyle; 1719 *style = (SkTypeface::Style) tempStyle;
1718 } 1720 }
1719 if (isFixedPitch) { 1721 if (isFixedPitch) {
1720 *isFixedPitch = FT_IS_FIXED_WIDTH(face); 1722 *isFixedPitch = FT_IS_FIXED_WIDTH(face);
1721 } 1723 }
1722 1724
1723 FT_Done_Face(face); 1725 FT_Done_Face(face);
1724 FT_Done_FreeType(library); 1726 FT_Done_FreeType(library);
1725 return true; 1727 return true;
1726 } 1728 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698