diff --git a/engine/src/flutter/src/font_collection.cc b/engine/src/flutter/src/font_collection.cc index ca8132e7c62..cf9bdb92816 100644 --- a/engine/src/flutter/src/font_collection.cc +++ b/engine/src/flutter/src/font_collection.cc @@ -169,7 +169,7 @@ FontCollection::GetMinikinFontCollectionForFamily(const std::string& family) { // Create the minikin font from the skia typeface. minikin::Font minikin_font( std::make_shared(skia_typeface), - minikin::FontStyle{skia_typeface->fontStyle().weight(), + minikin::FontStyle{skia_typeface->fontStyle().weight() / 100, skia_typeface->isItalic()}); minikin_fonts.emplace_back(std::move(minikin_font)); diff --git a/engine/src/flutter/src/paragraph.cc b/engine/src/flutter/src/paragraph.cc index e1c599df2fe..dce596447cf 100644 --- a/engine/src/flutter/src/paragraph.cc +++ b/engine/src/flutter/src/paragraph.cc @@ -104,7 +104,6 @@ void GetFontAndMinikinPaint(const TextStyle& style, void GetPaint(const TextStyle& style, SkPaint* paint) { paint->setTextSize(style.font_size); - paint->setFakeBoldText(style.fake_bold); } } // namespace diff --git a/engine/src/flutter/src/text_style.cc b/engine/src/flutter/src/text_style.cc index 7965318cd6f..fa9e510cff3 100644 --- a/engine/src/flutter/src/text_style.cc +++ b/engine/src/flutter/src/text_style.cc @@ -36,8 +36,6 @@ bool TextStyle::equals(const TextStyle& other) const { return false; if (font_style != other.font_style) return false; - if (fake_bold != other.fake_bold) - return false; if (font_family != other.font_family) return false; if (letter_spacing != other.letter_spacing) diff --git a/engine/src/flutter/src/text_style.h b/engine/src/flutter/src/text_style.h index 8ed552dd803..249b0f46990 100644 --- a/engine/src/flutter/src/text_style.h +++ b/engine/src/flutter/src/text_style.h @@ -36,7 +36,6 @@ class TextStyle { double decoration_thickness = 1.0; FontWeight font_weight = FontWeight::w400; FontStyle font_style = FontStyle::normal; - bool fake_bold = false; TextBaseline text_baseline = TextBaseline::kAlphabetic; std::string font_family = ""; double font_size = 14.0; diff --git a/engine/src/flutter/tests/txt/paragraph_unittests.cc b/engine/src/flutter/tests/txt/paragraph_unittests.cc index 2bbde911923..54f64c58ca4 100644 --- a/engine/src/flutter/tests/txt/paragraph_unittests.cc +++ b/engine/src/flutter/tests/txt/paragraph_unittests.cc @@ -136,7 +136,6 @@ TEST_F(RenderTest, RainbowParagraph) { text_style2.letter_spacing = 10; text_style2.word_spacing = 30; text_style2.font_weight = txt::FontWeight::w600; - text_style2.fake_bold = true; text_style2.color = SK_ColorGREEN; text_style2.decoration = txt::TextDecoration(0x1 | 0x2 | 0x4); text_style2.decoration_color = SK_ColorBLACK; @@ -229,10 +228,10 @@ TEST_F(RenderTest, BoldParagraph) { txt::ParagraphBuilder builder(paragraph_style, &font_collection); txt::TextStyle text_style; + text_style.font_family = "Roboto"; text_style.font_size = 60; - text_style.letter_spacing = 10; - text_style.font_weight = txt::FontWeight::w700; - text_style.fake_bold = true; + text_style.letter_spacing = 0; + text_style.font_weight = txt::FontWeight::w900; text_style.color = SK_ColorRED; builder.PushStyle(text_style); @@ -927,6 +926,7 @@ TEST_F(RenderTest, GetRectsForRangeParagraph) { txt::TextStyle text_style; text_style.font_size = 50; text_style.letter_spacing = 0; + text_style.font_weight = FontWeight::w500; text_style.word_spacing = 0; text_style.color = SK_ColorBLACK; text_style.height = 1;