@@ -657,17 +657,19 @@ bool OneLineShaper::shape() {
657657 font.setHinting (block.fStyle .getFontHinting ());
658658 font.setSubpixel (block.fStyle .getSubpixel ());
659659
660- // Apply fake bold and/or italic settings to the font if the
661- // typeface's attributes do not match the intended font style.
662- int wantedWeight = block.fStyle .getFontStyle ().weight ();
663- bool fakeBold =
664- wantedWeight >= SkFontStyle::kSemiBold_Weight &&
665- wantedWeight - font.getTypeface ()->fontStyle ().weight () >= 200 ;
666- bool fakeItalic =
667- block.fStyle .getFontStyle ().slant () == SkFontStyle::kItalic_Slant &&
668- font.getTypeface ()->fontStyle ().slant () != SkFontStyle::kItalic_Slant ;
669- font.setEmbolden (fakeBold);
670- font.setSkewX (fakeItalic ? -SK_Scalar1 / 4 : 0 );
660+ if (fParagraph ->paragraphStyle ().fakeMissingFontStyles ()) {
661+ // Apply fake bold and/or italic settings to the font if the
662+ // typeface's attributes do not match the intended font style.
663+ int wantedWeight = block.fStyle .getFontStyle ().weight ();
664+ bool fakeBold =
665+ wantedWeight >= SkFontStyle::kSemiBold_Weight &&
666+ wantedWeight - font.getTypeface ()->fontStyle ().weight () >= 200 ;
667+ bool fakeItalic =
668+ block.fStyle .getFontStyle ().slant () == SkFontStyle::kItalic_Slant &&
669+ font.getTypeface ()->fontStyle ().slant () != SkFontStyle::kItalic_Slant ;
670+ font.setEmbolden (fakeBold);
671+ font.setSkewX (fakeItalic ? -SK_Scalar1 / 4 : 0 );
672+ }
671673
672674 // Walk through all the currently unresolved blocks
673675 // (ignoring those that appear later)
0 commit comments