OLD | NEW |
1 /* libs/graphics/ports/SkFontHost_FreeType.cpp | 1 /* libs/graphics/ports/SkFontHost_FreeType.cpp |
2 ** | 2 ** |
3 ** Copyright 2006, Google Inc. | 3 ** Copyright 2006, Google Inc. |
4 ** | 4 ** |
5 ** Licensed under the Apache License, Version 2.0 (the "License"); | 5 ** Licensed under the Apache License, Version 2.0 (the "License"); |
6 ** you may not use this file except in compliance with the License. | 6 ** you may not use this file except in compliance with the License. |
7 ** You may obtain a copy of the License at | 7 ** You may obtain a copy of the License at |
8 ** | 8 ** |
9 ** http://www.apache.org/licenses/LICENSE-2.0 | 9 ** http://www.apache.org/licenses/LICENSE-2.0 |
10 ** | 10 ** |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 if (err != 0) { | 710 if (err != 0) { |
711 SkDEBUGF(("SkScalerContext_FreeType::generatePath: FT_Load_Glyph(glyph:%
d flags:%d) returned 0x%x\n", | 711 SkDEBUGF(("SkScalerContext_FreeType::generatePath: FT_Load_Glyph(glyph:%
d flags:%d) returned 0x%x\n", |
712 glyph.getGlyphID(fBaseGlyphCount), flags, err)); | 712 glyph.getGlyphID(fBaseGlyphCount), flags, err)); |
713 path->reset(); | 713 path->reset(); |
714 return; | 714 return; |
715 } | 715 } |
716 | 716 |
717 path->close(); | 717 path->close(); |
718 } | 718 } |
719 | 719 |
720 static void map_y_to_pt(const FT_Matrix& mat, SkFixed y, SkPoint* pt) | |
721 { | |
722 SkFixed x = SkFixedMul(mat.xy, y); | |
723 y = SkFixedMul(mat.yy, y); | |
724 | |
725 pt->set(SkFixedToScalar(x), SkFixedToScalar(y)); | |
726 } | |
727 | |
728 void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* mx, SkP
aint::FontMetrics* my) | 720 void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* mx, SkP
aint::FontMetrics* my) |
729 { | 721 { |
730 if (NULL == mx && NULL == my) | 722 if (NULL == mx && NULL == my) |
731 return; | 723 return; |
732 | 724 |
733 SkAutoMutexAcquire ac(gFTMutex); | 725 SkAutoMutexAcquire ac(gFTMutex); |
734 | 726 |
735 if (this->setupSize()) | 727 if (this->setupSize()) |
736 { | 728 { |
737 if (mx) | 729 if (mx) |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 } | 835 } |
844 if (face->style_flags & FT_STYLE_FLAG_ITALIC) { | 836 if (face->style_flags & FT_STYLE_FLAG_ITALIC) { |
845 style |= SkTypeface::kItalic; | 837 style |= SkTypeface::kItalic; |
846 } | 838 } |
847 | 839 |
848 FT_Done_Face(face); | 840 FT_Done_Face(face); |
849 FT_Done_FreeType(library); | 841 FT_Done_FreeType(library); |
850 return (SkTypeface::Style)style; | 842 return (SkTypeface::Style)style; |
851 } | 843 } |
852 | 844 |
OLD | NEW |