OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 "SkAdvancedTypefaceMetrics.h" | 8 #include "SkAdvancedTypefaceMetrics.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
607 } | 607 } |
608 FT_Get_Advances(face, gID, advanceCount, FT_LOAD_NO_SCALE, advan ces); | 608 FT_Get_Advances(face, gID, advanceCount, FT_LOAD_NO_SCALE, advan ces); |
609 for (int i = 0; i < advanceCount; i++) { | 609 for (int i = 0; i < advanceCount; i++) { |
610 int16_t advance = advances[i]; | 610 int16_t advance = advances[i]; |
611 info->fGlyphWidths->fAdvance.append(1, &advance); | 611 info->fGlyphWidths->fAdvance.append(1, &advance); |
612 } | 612 } |
613 } | 613 } |
614 finishRange(info->fGlyphWidths.get(), face->num_glyphs - 1, | 614 finishRange(info->fGlyphWidths.get(), face->num_glyphs - 1, |
615 SkAdvancedTypefaceMetrics::WidthRange::kRange); | 615 SkAdvancedTypefaceMetrics::WidthRange::kRange); |
616 } else { | 616 } else { |
617 std::function<bool(int gId, int16_t* data)> getWidthAdvanceFn = | |
herb_g
2016/05/06 15:54:16
Use auto instead of std::function...
Here and othe
tomhudson
2016/05/06 15:58:02
Nit: with auto, the return value is totally implic
hal.canary
2016/05/06 16:00:56
Done.
| |
618 [face](int gId, int16_t* data) { | |
619 return getWidthAdvance(face, gId, data); | |
620 }; | |
617 info->fGlyphWidths.reset( | 621 info->fGlyphWidths.reset( |
618 getAdvanceData(face, | 622 getAdvanceData(face->num_glyphs, |
619 face->num_glyphs, | |
620 glyphIDs, | 623 glyphIDs, |
621 glyphIDsCount, | 624 glyphIDsCount, |
622 &getWidthAdvance)); | 625 getWidthAdvanceFn)); |
623 } | 626 } |
624 } | 627 } |
625 | 628 |
626 if (perGlyphInfo & kVAdvance_PerGlyphInfo && | 629 if (perGlyphInfo & kVAdvance_PerGlyphInfo && |
627 FT_HAS_VERTICAL(face)) { | 630 FT_HAS_VERTICAL(face)) { |
628 SkASSERT(false); // Not implemented yet. | 631 SkASSERT(false); // Not implemented yet. |
629 } | 632 } |
630 | 633 |
631 if (perGlyphInfo & kGlyphNames_PerGlyphInfo && | 634 if (perGlyphInfo & kGlyphNames_PerGlyphInfo && |
632 info->fType == SkAdvancedTypefaceMetrics::kType1_Font) { | 635 info->fType == SkAdvancedTypefaceMetrics::kType1_Font) { |
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1819 SkDEBUGF(("Requested font axis not found: %s '%c%c%c%c'\n", | 1822 SkDEBUGF(("Requested font axis not found: %s '%c%c%c%c'\n", |
1820 name.c_str(), | 1823 name.c_str(), |
1821 (skTag >> 24) & 0xFF, | 1824 (skTag >> 24) & 0xFF, |
1822 (skTag >> 16) & 0xFF, | 1825 (skTag >> 16) & 0xFF, |
1823 (skTag >> 8) & 0xFF, | 1826 (skTag >> 8) & 0xFF, |
1824 (skTag) & 0xFF)); | 1827 (skTag) & 0xFF)); |
1825 } | 1828 } |
1826 } | 1829 } |
1827 ) | 1830 ) |
1828 } | 1831 } |
OLD | NEW |