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

Side by Side Diff: ports/SkFontHost_mac.cpp

Issue 148453005: Calculate Underline thickness for Skia from Font metrics (Closed) Base URL: https://chromium.googlesource.com/external/skia/src.git@master
Patch Set: Created 6 years, 10 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 | « ports/SkFontHost_FreeType.cpp ('k') | 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 <vector> 9 #include <vector>
10 #ifdef SK_BUILD_FOR_MAC 10 #ifdef SK_BUILD_FOR_MAC
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1372 SkPaint::FontMetrics theMetrics; 1372 SkPaint::FontMetrics theMetrics;
1373 theMetrics.fTop = CGToScalar(-CGRectGetMaxY_inline(theBounds)); 1373 theMetrics.fTop = CGToScalar(-CGRectGetMaxY_inline(theBounds));
1374 theMetrics.fAscent = CGToScalar(-CTFontGetAscent(fCTFont)); 1374 theMetrics.fAscent = CGToScalar(-CTFontGetAscent(fCTFont));
1375 theMetrics.fDescent = CGToScalar( CTFontGetDescent(fCTFont)); 1375 theMetrics.fDescent = CGToScalar( CTFontGetDescent(fCTFont));
1376 theMetrics.fBottom = CGToScalar(-CGRectGetMinY_inline(theBounds)); 1376 theMetrics.fBottom = CGToScalar(-CGRectGetMinY_inline(theBounds));
1377 theMetrics.fLeading = CGToScalar( CTFontGetLeading(fCTFont)); 1377 theMetrics.fLeading = CGToScalar( CTFontGetLeading(fCTFont));
1378 theMetrics.fAvgCharWidth = CGToScalar( CGRectGetWidth_inline(theBounds)); 1378 theMetrics.fAvgCharWidth = CGToScalar( CGRectGetWidth_inline(theBounds));
1379 theMetrics.fXMin = CGToScalar( CGRectGetMinX_inline(theBounds)); 1379 theMetrics.fXMin = CGToScalar( CGRectGetMinX_inline(theBounds));
1380 theMetrics.fXMax = CGToScalar( CGRectGetMaxX_inline(theBounds)); 1380 theMetrics.fXMax = CGToScalar( CGRectGetMaxX_inline(theBounds));
1381 theMetrics.fXHeight = CGToScalar( CTFontGetXHeight(fCTFont)); 1381 theMetrics.fXHeight = CGToScalar( CTFontGetXHeight(fCTFont));
1382 theMetrics.fUnderlineThickness = CGToScalar(CTFontGetUnderlineThickness(fCTF ont));
1382 1383
1383 if (mx != NULL) { 1384 if (mx != NULL) {
1384 *mx = theMetrics; 1385 *mx = theMetrics;
1385 } 1386 }
1386 if (my != NULL) { 1387 if (my != NULL) {
1387 *my = theMetrics; 1388 *my = theMetrics;
1388 } 1389 }
1389 } 1390 }
1390 1391
1391 void SkScalerContext_Mac::CTPathElement(void *info, const CGPathElement *element ) { 1392 void SkScalerContext_Mac::CTPathElement(void *info, const CGPathElement *element ) {
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
2313 return create_typeface(NULL, familyName, (SkTypeface::Style)styleBits); 2314 return create_typeface(NULL, familyName, (SkTypeface::Style)styleBits);
2314 } 2315 }
2315 }; 2316 };
2316 2317
2317 /////////////////////////////////////////////////////////////////////////////// 2318 ///////////////////////////////////////////////////////////////////////////////
2318 2319
2319 SkFontMgr* SkFontMgr::Factory() { 2320 SkFontMgr* SkFontMgr::Factory() {
2320 return SkNEW(SkFontMgr_Mac); 2321 return SkNEW(SkFontMgr_Mac);
2321 } 2322 }
2322 #endif 2323 #endif
OLDNEW
« no previous file with comments | « ports/SkFontHost_FreeType.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698