| 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 <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 Loading... |
| 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(fCT
Font)); |
| 1383 theMetrics.fUnderlinePosition = -CGToScalar( CTFontGetUnderlinePosition(fCTF
ont)); |
| 1384 |
| 1385 theMetrics.fFlags |= SkPaint::FontMetrics::kUnderlineThinknessIsValid_Flag; |
| 1386 theMetrics.fFlags |= SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag; |
| 1382 | 1387 |
| 1383 if (mx != NULL) { | 1388 if (mx != NULL) { |
| 1384 *mx = theMetrics; | 1389 *mx = theMetrics; |
| 1385 } | 1390 } |
| 1386 if (my != NULL) { | 1391 if (my != NULL) { |
| 1387 *my = theMetrics; | 1392 *my = theMetrics; |
| 1388 } | 1393 } |
| 1389 } | 1394 } |
| 1390 | 1395 |
| 1391 void SkScalerContext_Mac::CTPathElement(void *info, const CGPathElement *element
) { | 1396 void SkScalerContext_Mac::CTPathElement(void *info, const CGPathElement *element
) { |
| (...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2305 return create_typeface(NULL, familyName, (SkTypeface::Style)styleBits); | 2310 return create_typeface(NULL, familyName, (SkTypeface::Style)styleBits); |
| 2306 } | 2311 } |
| 2307 }; | 2312 }; |
| 2308 | 2313 |
| 2309 /////////////////////////////////////////////////////////////////////////////// | 2314 /////////////////////////////////////////////////////////////////////////////// |
| 2310 | 2315 |
| 2311 SkFontMgr* SkFontMgr::Factory() { | 2316 SkFontMgr* SkFontMgr::Factory() { |
| 2312 return SkNEW(SkFontMgr_Mac); | 2317 return SkNEW(SkFontMgr_Mac); |
| 2313 } | 2318 } |
| 2314 #endif | 2319 #endif |
| OLD | NEW |