OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
9 #undef GetGlyphIndices | 9 #undef GetGlyphIndices |
10 | 10 |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 metrics->fAscent = -fTextSizeRender * SkIntToScalar(dwfm.ascent) / upem; | 517 metrics->fAscent = -fTextSizeRender * SkIntToScalar(dwfm.ascent) / upem; |
518 metrics->fDescent = fTextSizeRender * SkIntToScalar(dwfm.descent) / upem; | 518 metrics->fDescent = fTextSizeRender * SkIntToScalar(dwfm.descent) / upem; |
519 metrics->fLeading = fTextSizeRender * SkIntToScalar(dwfm.lineGap) / upem; | 519 metrics->fLeading = fTextSizeRender * SkIntToScalar(dwfm.lineGap) / upem; |
520 metrics->fXHeight = fTextSizeRender * SkIntToScalar(dwfm.xHeight) / upem; | 520 metrics->fXHeight = fTextSizeRender * SkIntToScalar(dwfm.xHeight) / upem; |
521 metrics->fUnderlineThickness = fTextSizeRender * SkIntToScalar(dwfm.underlin
eThickness) / upem; | 521 metrics->fUnderlineThickness = fTextSizeRender * SkIntToScalar(dwfm.underlin
eThickness) / upem; |
522 metrics->fUnderlinePosition = -(fTextSizeRender * SkIntToScalar(dwfm.underli
nePosition) / upem); | 522 metrics->fUnderlinePosition = -(fTextSizeRender * SkIntToScalar(dwfm.underli
nePosition) / upem); |
523 | 523 |
524 metrics->fFlags |= SkPaint::FontMetrics::kUnderlineThinknessIsValid_Flag; | 524 metrics->fFlags |= SkPaint::FontMetrics::kUnderlineThinknessIsValid_Flag; |
525 metrics->fFlags |= SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag; | 525 metrics->fFlags |= SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag; |
526 | 526 |
527 if (NULL != fTypeface->fDWriteFontFace1.get()) { | 527 if (fTypeface->fDWriteFontFace1.get()) { |
528 DWRITE_FONT_METRICS1 dwfm1; | 528 DWRITE_FONT_METRICS1 dwfm1; |
529 fTypeface->fDWriteFontFace1->GetMetrics(&dwfm1); | 529 fTypeface->fDWriteFontFace1->GetMetrics(&dwfm1); |
530 metrics->fTop = -fTextSizeRender * SkIntToScalar(dwfm1.glyphBoxTop) / up
em; | 530 metrics->fTop = -fTextSizeRender * SkIntToScalar(dwfm1.glyphBoxTop) / up
em; |
531 metrics->fBottom = -fTextSizeRender * SkIntToScalar(dwfm1.glyphBoxBottom
) / upem; | 531 metrics->fBottom = -fTextSizeRender * SkIntToScalar(dwfm1.glyphBoxBottom
) / upem; |
532 metrics->fXMin = fTextSizeRender * SkIntToScalar(dwfm1.glyphBoxLeft) / u
pem; | 532 metrics->fXMin = fTextSizeRender * SkIntToScalar(dwfm1.glyphBoxLeft) / u
pem; |
533 metrics->fXMax = fTextSizeRender * SkIntToScalar(dwfm1.glyphBoxRight) /
upem; | 533 metrics->fXMax = fTextSizeRender * SkIntToScalar(dwfm1.glyphBoxRight) /
upem; |
534 | 534 |
535 metrics->fMaxCharWidth = metrics->fXMax - metrics->fXMin; | 535 metrics->fMaxCharWidth = metrics->fXMax - metrics->fXMin; |
536 } else { | 536 } else { |
537 AutoTDWriteTable<SkOTTableHead> head(fTypeface->fDWriteFontFace.get()); | 537 AutoTDWriteTable<SkOTTableHead> head(fTypeface->fDWriteFontFace.get()); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 NULL, //advances | 766 NULL, //advances |
767 NULL, //offsets | 767 NULL, //offsets |
768 1, //num glyphs | 768 1, //num glyphs |
769 FALSE, //sideways | 769 FALSE, //sideways |
770 FALSE, //rtl | 770 FALSE, //rtl |
771 geometryToPath.get()), | 771 geometryToPath.get()), |
772 "Could not create glyph outline."); | 772 "Could not create glyph outline."); |
773 | 773 |
774 path->transform(fSkXform); | 774 path->transform(fSkXform); |
775 } | 775 } |
OLD | NEW |