OLD | NEW |
---|---|
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 Loading... | |
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 // Do not try to scale embedded bitmaps; only scale bitmaps in bitmap only f onts. |
1305 if (fFace->glyph->format == FT_GLYPH_FORMAT_BITMAP && !FT_IS_SCALABLE(fFace) && | |
1306 fScaleY && fFace->size->metrics.y_ppem) | |
mtklein
2014/09/22 18:50:42
First check is now obsolete?
bungeman-skia
2014/09/22 19:02:52
Indeed it is. It makes more sense to say !FT_IS_SC
| |
1307 { | |
1305 // NOTE: both dimensions are scaled by y_ppem. this is WAI. | 1308 // NOTE: both dimensions are scaled by y_ppem. this is WAI. |
1306 scaleGlyphMetrics(*glyph, SkScalarDiv(SkFixedToScalar(fScaleY), | 1309 scaleGlyphMetrics(*glyph, SkScalarDiv(SkFixedToScalar(fScaleY), |
1307 SkIntToScalar(fFace->size->metrics .y_ppem))); | 1310 SkIntToScalar(fFace->size->metrics .y_ppem))); |
1308 } | 1311 } |
1309 | 1312 |
1310 #ifdef ENABLE_GLYPH_SPEW | 1313 #ifdef ENABLE_GLYPH_SPEW |
1311 SkDEBUGF(("FT_Set_Char_Size(this:%p sx:%x sy:%x ", this, fScaleX, fScaleY)); | 1314 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)); | 1315 SkDEBUGF(("Metrics(glyph:%d flags:0x%x) w:%d\n", glyph->getGlyphID(), fLoadG lyphFlags, glyph->fWidth)); |
1313 #endif | 1316 #endif |
1314 } | 1317 } |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1717 *style = (SkTypeface::Style) tempStyle; | 1720 *style = (SkTypeface::Style) tempStyle; |
1718 } | 1721 } |
1719 if (isFixedPitch) { | 1722 if (isFixedPitch) { |
1720 *isFixedPitch = FT_IS_FIXED_WIDTH(face); | 1723 *isFixedPitch = FT_IS_FIXED_WIDTH(face); |
1721 } | 1724 } |
1722 | 1725 |
1723 FT_Done_Face(face); | 1726 FT_Done_Face(face); |
1724 FT_Done_FreeType(library); | 1727 FT_Done_FreeType(library); |
1725 return true; | 1728 return true; |
1726 } | 1729 } |
OLD | NEW |