diff --git a/docs/SkPaint_Reference.bmh b/docs/SkPaint_Reference.bmh index d25958298b..96b263ba67 100644 --- a/docs/SkPaint_Reference.bmh +++ b/docs/SkPaint_Reference.bmh @@ -726,23 +726,23 @@ If Font_Linear is clear, it is the same as setting Hinting to SkFontHinting::kNo #Example #Height 128 void draw(SkCanvas* canvas) { - SkPaint paint; - paint.setAntiAlias(true); - const char testStr[] = "abcd efgh"; - size_t count = 9; - for (int textSize : { 12, 24 } ) { - SkFont font(nullptr, textSize); - for (auto linearMetrics : { false, true } ) { - font.setLinearMetrics(linearMetrics); - SkString width; - width.appendScalar(font.measureText(testStr, count, SkTextEncoding::kUTF8)); - canvas->translate(0, textSize + 4); - canvas->drawSimpleText(testStr, count, SkTextEncoding::kUTF8, - 10, 0, font, paint); - canvas->drawSimpleText(width.c_str(), width.size(), SkTextEncoding::kUTF8, - 128, 0, font, paint); - } - } + SkPaint paint; + paint.setAntiAlias(true); + const char testStr[] = "abcd efgh"; + size_t count = 9; + for (int textSize : { 12, 24 } ) { + SkFont font(nullptr, textSize); + for (auto linearMetrics : { false, true } ) { + font.setLinearMetrics(linearMetrics); + SkString width; + width.appendScalar(font.measureText(testStr, count, SkTextEncoding::kUTF8)); + canvas->translate(0, textSize + 4); + canvas->drawSimpleText(testStr, count, SkTextEncoding::kUTF8, + 10, 0, font, paint); + canvas->drawSimpleText(width.c_str(), width.size(), SkTextEncoding::kUTF8, + 128, 0, font, paint); + } + } } ## @@ -3061,38 +3061,6 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ -#Method void glyphsToUnichars(const SkGlyphID glyphs[], - int count, SkUnichar text[]) const -#In Utility -#Line # converts Glyphs into text ## -#Populate - -# crashes fiddle, draws missing characters locally ## -#Bug 8608 -#NoExample - #Height 64 - #Description - Convert UTF-8 text to glyphs; then convert glyphs to Unichar code points. - ## - void draw(SkCanvas* canvas) { - SkPaint paint; - const char hello[] = "Hello!"; - const int count = sizeof(hello) - 1; - SkGlyphID glyphs[count]; - if (count != paint.textToGlyphs(hello, count, glyphs)) { - return; - } - SkUnichar unichars[count]; - paint.glyphsToUnichars(glyphs, count, unichars); - paint.setTextEncoding(kUTF32_SkTextEncoding); - canvas->drawText(unichars, sizeof(unichars), 10, 30, paint); - } - ## - -## - -# ------------------------------------------------------------------------------ - #Method bool nothingToDraw() const #In Utility #Line # returns true if Paint prevents all drawing ## diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index 550845f06a..2c965038fc 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -921,21 +921,6 @@ public: bool containsText(const void* text, size_t byteLength) const; #endif -#ifdef SK_SUPPORT_LEGACY_PAINT_FONT_FIELDS - /** Converts glyphs into text if possible. - Glyph values without direct Unicode equivalents are mapped to zero. - Uses the SkTypeface, but is unaffected - by SkTextEncoding; the text values returned are equivalent to kUTF32_SkTextEncoding. - - Only supported on platforms that use FreeType as the font engine. - - @param glyphs array of indices into font - @param count length of glyph array - @param text storage for character codes, one per glyph - */ - void glyphsToUnichars(const SkGlyphID glyphs[], int count, SkUnichar text[]) const; -#endif - #ifdef SK_SUPPORT_LEGACY_PAINT_TEXTMEASURE /** Deprecated; use SkFont::countText instead */ diff --git a/src/core/SkPaint_text.cpp b/src/core/SkPaint_text.cpp index b5c4eb37a6..a7ee2941b5 100644 --- a/src/core/SkPaint_text.cpp +++ b/src/core/SkPaint_text.cpp @@ -78,12 +78,6 @@ bool SkPaint::containsText(const void* text, size_t length) const { } #endif -#ifdef SK_SUPPORT_LEGACY_PAINT_FONT_FIELDS -void SkPaint::glyphsToUnichars(const uint16_t glyphs[], int count, SkUnichar textData[]) const { - SkFont::LEGACY_ExtractFromPaint(*this).glyphsToUnichars(glyphs, count, textData); -} -#endif - /////////////////////////////////////////////////////////////////////////////// static const SkGlyph& sk_getMetrics_utf8_next(SkGlyphCache* cache,