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

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

Issue 1164423006: Fill capHeight and maxCharWidth on Mac. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Also maxCharWidth. Created 5 years, 6 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 "SkTypes.h" // Keep this before any #ifdef ... 9 #include "SkTypes.h" // Keep this before any #ifdef ...
10 10
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 CGRect theBounds = CTFontGetBoundingBox(fCTFont); 1386 CGRect theBounds = CTFontGetBoundingBox(fCTFont);
1387 1387
1388 metrics->fTop = CGToScalar(-CGRectGetMaxY_inline(theBounds)); 1388 metrics->fTop = CGToScalar(-CGRectGetMaxY_inline(theBounds));
1389 metrics->fAscent = CGToScalar(-CTFontGetAscent(fCTFont)); 1389 metrics->fAscent = CGToScalar(-CTFontGetAscent(fCTFont));
1390 metrics->fDescent = CGToScalar( CTFontGetDescent(fCTFont)); 1390 metrics->fDescent = CGToScalar( CTFontGetDescent(fCTFont));
1391 metrics->fBottom = CGToScalar(-CGRectGetMinY_inline(theBounds)); 1391 metrics->fBottom = CGToScalar(-CGRectGetMinY_inline(theBounds));
1392 metrics->fLeading = CGToScalar( CTFontGetLeading(fCTFont)); 1392 metrics->fLeading = CGToScalar( CTFontGetLeading(fCTFont));
1393 metrics->fAvgCharWidth = CGToScalar( CGRectGetWidth_inline(theBounds)); 1393 metrics->fAvgCharWidth = CGToScalar( CGRectGetWidth_inline(theBounds));
1394 metrics->fXMin = CGToScalar( CGRectGetMinX_inline(theBounds)); 1394 metrics->fXMin = CGToScalar( CGRectGetMinX_inline(theBounds));
1395 metrics->fXMax = CGToScalar( CGRectGetMaxX_inline(theBounds)); 1395 metrics->fXMax = CGToScalar( CGRectGetMaxX_inline(theBounds));
1396 metrics->fMaxCharWidth = metrics->fXMax - metrics->fXMin;
1396 metrics->fXHeight = CGToScalar( CTFontGetXHeight(fCTFont)); 1397 metrics->fXHeight = CGToScalar( CTFontGetXHeight(fCTFont));
1398 metrics->fCapHeight = CGToScalar( CTFontGetCapHeight(fCTFont));
1397 metrics->fUnderlineThickness = CGToScalar( CTFontGetUnderlineThickness(fCTFo nt)); 1399 metrics->fUnderlineThickness = CGToScalar( CTFontGetUnderlineThickness(fCTFo nt));
1398 metrics->fUnderlinePosition = -CGToScalar( CTFontGetUnderlinePosition(fCTFon t)); 1400 metrics->fUnderlinePosition = -CGToScalar( CTFontGetUnderlinePosition(fCTFon t));
1399 1401
1400 metrics->fFlags |= SkPaint::FontMetrics::kUnderlineThinknessIsValid_Flag; 1402 metrics->fFlags |= SkPaint::FontMetrics::kUnderlineThinknessIsValid_Flag;
1401 metrics->fFlags |= SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag; 1403 metrics->fFlags |= SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag;
1402 } 1404 }
1403 1405
1404 void SkScalerContext_Mac::CTPathElement(void *info, const CGPathElement *element ) { 1406 void SkScalerContext_Mac::CTPathElement(void *info, const CGPathElement *element ) {
1405 SkPath* skPath = (SkPath*)info; 1407 SkPath* skPath = (SkPath*)info;
1406 1408
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
2468 } 2470 }
2469 return face; 2471 return face;
2470 } 2472 }
2471 }; 2473 };
2472 2474
2473 /////////////////////////////////////////////////////////////////////////////// 2475 ///////////////////////////////////////////////////////////////////////////////
2474 2476
2475 SkFontMgr* SkFontMgr::Factory() { 2477 SkFontMgr* SkFontMgr::Factory() {
2476 return SkNEW(SkFontMgr_Mac); 2478 return SkNEW(SkFontMgr_Mac);
2477 } 2479 }
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