diff --git a/engine/src/flutter/include/minikin/MinikinFont.h b/engine/src/flutter/include/minikin/MinikinFont.h index 7f65cd7b0a..2ad2151a31 100644 --- a/engine/src/flutter/include/minikin/MinikinFont.h +++ b/engine/src/flutter/include/minikin/MinikinFont.h @@ -96,8 +96,6 @@ class MinikinFontFreeType; class MinikinFont : public MinikinRefCounted { public: - virtual bool GetGlyph(uint32_t codepoint, uint32_t *glyph) const = 0; - virtual float GetHorizontalAdvance(uint32_t glyph_id, const MinikinPaint &paint) const = 0; diff --git a/engine/src/flutter/include/minikin/MinikinFontFreeType.h b/engine/src/flutter/include/minikin/MinikinFontFreeType.h index 13a513982b..a957d124c7 100644 --- a/engine/src/flutter/include/minikin/MinikinFontFreeType.h +++ b/engine/src/flutter/include/minikin/MinikinFontFreeType.h @@ -42,8 +42,6 @@ public: ~MinikinFontFreeType(); - bool GetGlyph(uint32_t codepoint, uint32_t *glyph) const; - float GetHorizontalAdvance(uint32_t glyph_id, const MinikinPaint &paint) const; diff --git a/engine/src/flutter/libs/minikin/MinikinFontFreeType.cpp b/engine/src/flutter/libs/minikin/MinikinFontFreeType.cpp index 972f3f1d14..cbeed61593 100644 --- a/engine/src/flutter/libs/minikin/MinikinFontFreeType.cpp +++ b/engine/src/flutter/libs/minikin/MinikinFontFreeType.cpp @@ -38,12 +38,6 @@ MinikinFontFreeType::~MinikinFontFreeType() { FT_Done_Face(mTypeface); } -bool MinikinFontFreeType::GetGlyph(uint32_t codepoint, uint32_t *glyph) const { - FT_UInt glyph_index = FT_Get_Char_Index(mTypeface, codepoint); - *glyph = glyph_index; - return !!glyph_index; -} - float MinikinFontFreeType::GetHorizontalAdvance(uint32_t glyph_id, const MinikinPaint &paint) const { FT_Set_Pixel_Sizes(mTypeface, 0, paint.size); diff --git a/engine/src/flutter/sample/MinikinSkia.cpp b/engine/src/flutter/sample/MinikinSkia.cpp index 8b499d8131..feda8adff1 100644 --- a/engine/src/flutter/sample/MinikinSkia.cpp +++ b/engine/src/flutter/sample/MinikinSkia.cpp @@ -14,17 +14,6 @@ MinikinFontSkia::~MinikinFontSkia() { SkSafeUnref(mTypeface); } -bool MinikinFontSkia::GetGlyph(uint32_t codepoint, uint32_t *glyph) const { - SkPaint paint; - paint.setTypeface(mTypeface); - paint.setTextEncoding(SkPaint::kUTF32_TextEncoding); - uint16_t glyph16; - paint.textToGlyphs(&codepoint, sizeof(codepoint), &glyph16); - *glyph = glyph16; - //printf("glyph for U+%04x = %d\n", codepoint, glyph16); - return !!glyph; -} - static void MinikinFontSkia_SetSkiaPaint(SkTypeface* typeface, SkPaint* skPaint, const MinikinPaint& paint) { skPaint->setTypeface(typeface); skPaint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); diff --git a/engine/src/flutter/sample/MinikinSkia.h b/engine/src/flutter/sample/MinikinSkia.h index fca6ca2322..25ac1b0c08 100644 --- a/engine/src/flutter/sample/MinikinSkia.h +++ b/engine/src/flutter/sample/MinikinSkia.h @@ -6,8 +6,6 @@ public: ~MinikinFontSkia(); - bool GetGlyph(uint32_t codepoint, uint32_t *glyph) const; - float GetHorizontalAdvance(uint32_t glyph_id, const MinikinPaint &paint) const; @@ -26,4 +24,4 @@ private: }; -} // namespace android \ No newline at end of file +} // namespace android diff --git a/engine/src/flutter/tests/HbFaceCacheTest.cpp b/engine/src/flutter/tests/HbFaceCacheTest.cpp index 1b63073851..fbaf0eab15 100644 --- a/engine/src/flutter/tests/HbFaceCacheTest.cpp +++ b/engine/src/flutter/tests/HbFaceCacheTest.cpp @@ -35,11 +35,6 @@ public: MockMinikinFont(int32_t id) : mId(id) { } - virtual bool GetGlyph(uint32_t codepoint, uint32_t *glyph) const { - LOG_ALWAYS_FATAL("MockMinikinFont::GetGlyph is not implemented."); - return false; - } - virtual float GetHorizontalAdvance( uint32_t glyph_id, const MinikinPaint &paint) const { LOG_ALWAYS_FATAL("MockMinikinFont::GetHorizontalAdvance is not implemented."); diff --git a/engine/src/flutter/tests/MinikinFontForTest.cpp b/engine/src/flutter/tests/MinikinFontForTest.cpp index 2d29e805aa..033241e26d 100644 --- a/engine/src/flutter/tests/MinikinFontForTest.cpp +++ b/engine/src/flutter/tests/MinikinFontForTest.cpp @@ -29,11 +29,6 @@ MinikinFontForTest::MinikinFontForTest(const std::string& font_path) : mFontPath MinikinFontForTest::~MinikinFontForTest() { } -bool MinikinFontForTest::GetGlyph(uint32_t codepoint, uint32_t *glyph) const { - LOG_ALWAYS_FATAL("MinikinFontForTest::GetGlyph is not yet implemented"); - return false; -} - float MinikinFontForTest::GetHorizontalAdvance( uint32_t glyph_id, const android::MinikinPaint &paint) const { LOG_ALWAYS_FATAL("MinikinFontForTest::GetHorizontalAdvance is not yet implemented"); diff --git a/engine/src/flutter/tests/MinikinFontForTest.h b/engine/src/flutter/tests/MinikinFontForTest.h index ecebb7e2b8..5738666f77 100644 --- a/engine/src/flutter/tests/MinikinFontForTest.h +++ b/engine/src/flutter/tests/MinikinFontForTest.h @@ -24,7 +24,6 @@ public: ~MinikinFontForTest(); // MinikinFont overrides. - bool GetGlyph(uint32_t codepoint, uint32_t *glyph) const; float GetHorizontalAdvance(uint32_t glyph_id, const android::MinikinPaint &paint) const; void GetBounds(android::MinikinRect* bounds, uint32_t glyph_id, const android::MinikinPaint& paint) const;