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 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1488 SkScalar scale = myy; | 1488 SkScalar scale = myy; |
1489 if (this->isVertical()) { | 1489 if (this->isVertical()) { |
1490 scale = mxy; | 1490 scale = mxy; |
1491 } | 1491 } |
1492 metrics->fTop = ymax * scale; | 1492 metrics->fTop = ymax * scale; |
1493 metrics->fAscent = ascent * scale; | 1493 metrics->fAscent = ascent * scale; |
1494 metrics->fDescent = descent * scale; | 1494 metrics->fDescent = descent * scale; |
1495 metrics->fBottom = ymin * scale; | 1495 metrics->fBottom = ymin * scale; |
1496 metrics->fLeading = leading * scale; | 1496 metrics->fLeading = leading * scale; |
1497 metrics->fAvgCharWidth = avgCharWidth * scale; | 1497 metrics->fAvgCharWidth = avgCharWidth * scale; |
| 1498 #ifdef SK_USE_SCALED_FONTMETRICS |
| 1499 // new correct behavior. need chrome to define this, and then we can remove
the else code |
| 1500 metrics->fXMin = xmin * scale; |
| 1501 metrics->fXMax = xmax * scale; |
| 1502 #else |
1498 metrics->fXMin = xmin; | 1503 metrics->fXMin = xmin; |
1499 metrics->fXMax = xmax; | 1504 metrics->fXMax = xmax; |
| 1505 #endif |
1500 metrics->fXHeight = x_height; | 1506 metrics->fXHeight = x_height; |
1501 metrics->fCapHeight = cap_height; | 1507 metrics->fCapHeight = cap_height; |
1502 metrics->fUnderlineThickness = underlineThickness * scale; | 1508 metrics->fUnderlineThickness = underlineThickness * scale; |
1503 metrics->fUnderlinePosition = underlinePosition * scale; | 1509 metrics->fUnderlinePosition = underlinePosition * scale; |
1504 } | 1510 } |
1505 | 1511 |
1506 void SkScalerContext_FreeType::emboldenIfNeeded(FT_Face face, FT_GlyphSlot glyph
) | 1512 void SkScalerContext_FreeType::emboldenIfNeeded(FT_Face face, FT_GlyphSlot glyph
) |
1507 { | 1513 { |
1508 // check to see if the embolden bit is set | 1514 // check to see if the embolden bit is set |
1509 if (0 == (fRec.fFlags & SkScalerContext::kEmbolden_Flag)) { | 1515 if (0 == (fRec.fFlags & SkScalerContext::kEmbolden_Flag)) { |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1801 if (style) { | 1807 if (style) { |
1802 *style = SkFontStyle(weight, width, slant); | 1808 *style = SkFontStyle(weight, width, slant); |
1803 } | 1809 } |
1804 if (isFixedPitch) { | 1810 if (isFixedPitch) { |
1805 *isFixedPitch = FT_IS_FIXED_WIDTH(face); | 1811 *isFixedPitch = FT_IS_FIXED_WIDTH(face); |
1806 } | 1812 } |
1807 | 1813 |
1808 FT_Done_Face(face); | 1814 FT_Done_Face(face); |
1809 return true; | 1815 return true; |
1810 } | 1816 } |
OLD | NEW |