Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- a/ui/gfx/render_text_harfbuzz.cc
- +++ b/ui/gfx/render_text_harfbuzz.cc
- @@ -796,11 +796,33 @@ bool TextRunHarfBuzz::FontParams::SetRenderParamsRematchFont(
- // scenarios, as the fallback font may be of a different weight and style than
- // the run's own, so this can lead to a failure of instantiating the correct
- // fallback font.
- +
- + sk_sp<SkTypeface> before_rematch;
- + PlatformFont* platform_font = new_font.platform_font();
- + if (platform_font) {
- + before_rematch = platform_font->GetNativeSkTypefaceIfAvailable();
- + }
- +
- sk_sp<SkTypeface> new_skia_face(
- internal::CreateSkiaTypeface(new_font, italic, weight));
- if (!new_skia_face)
- return false;
- + if (before_rematch->fontStyle().weight() != new_skia_face->fontStyle().weight() ||
- + before_rematch->fontStyle().slant() != new_skia_face->fontStyle().slant()) {
- + SkString family_before;
- + SkString family_after;
- + before_rematch->getFamilyName(&family_before);
- + new_skia_face->getFamilyName(&family_after);
- + VLOG(4) << "rematching lead to new font style: fam before: "
- + << family_before.c_str()
- + << " fam after: " << family_after.c_str()
- + << " weights: " << before_rematch->fontStyle().weight() << ":"
- + << new_skia_face->fontStyle().weight()
- + << " slants: " << before_rematch->fontStyle().slant() << ":"
- + << new_skia_face->fontStyle().slant();
- + }
- +
- skia_face = new_skia_face;
- font = new_font;
- render_params = new_render_params;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement