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

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

Issue 685153004: scale xmin and xmax for FontMetrics (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 metrics->fXMin = xmin; 1498 metrics->fXMin = xmin * scale;
1499 metrics->fXMax = xmax; 1499 metrics->fXMax = xmax * scale;
1500 metrics->fXHeight = x_height; 1500 metrics->fXHeight = x_height;
1501 metrics->fCapHeight = cap_height; 1501 metrics->fCapHeight = cap_height;
1502 metrics->fUnderlineThickness = underlineThickness * scale; 1502 metrics->fUnderlineThickness = underlineThickness * scale;
1503 metrics->fUnderlinePosition = underlinePosition * scale; 1503 metrics->fUnderlinePosition = underlinePosition * scale;
1504 } 1504 }
1505 1505
1506 void SkScalerContext_FreeType::emboldenIfNeeded(FT_Face face, FT_GlyphSlot glyph ) 1506 void SkScalerContext_FreeType::emboldenIfNeeded(FT_Face face, FT_GlyphSlot glyph )
1507 { 1507 {
1508 // check to see if the embolden bit is set 1508 // check to see if the embolden bit is set
1509 if (0 == (fRec.fFlags & SkScalerContext::kEmbolden_Flag)) { 1509 if (0 == (fRec.fFlags & SkScalerContext::kEmbolden_Flag)) {
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1801 if (style) { 1801 if (style) {
1802 *style = SkFontStyle(weight, width, slant); 1802 *style = SkFontStyle(weight, width, slant);
1803 } 1803 }
1804 if (isFixedPitch) { 1804 if (isFixedPitch) {
1805 *isFixedPitch = FT_IS_FIXED_WIDTH(face); 1805 *isFixedPitch = FT_IS_FIXED_WIDTH(face);
1806 } 1806 }
1807 1807
1808 FT_Done_Face(face); 1808 FT_Done_Face(face);
1809 return true; 1809 return true;
1810 } 1810 }
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