Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Issue 399113005: Use fallback font in PlatformFontPango::DeriveFont(). (Closed)

Created:
6 years, 5 months ago by Daniel Erat
Modified:
6 years, 5 months ago
Reviewers:
msw, ckocagil
CC:
chromium-reviews
Project:
chromium
Visibility:
Public.

Description

Use fallback font in PlatformFontPango::DeriveFont(). Make DeriveFont() fall back to "sans" if it doesn't find an SkTypeface matching the requested family, as InitFromDetails() already did. Also make InitFromDetails() pass through the requested style. BUG=394860 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=284125

Patch Set 1 #

Total comments: 9

Patch Set 2 : apply review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -28 lines) Patch
M ui/gfx/platform_font_pango.cc View 1 3 chunks +34 lines, -28 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Daniel Erat
https://codereview.chromium.org/399113005/diff/1/ui/gfx/platform_font_pango.cc File ui/gfx/platform_font_pango.cc (right): https://codereview.chromium.org/399113005/diff/1/ui/gfx/platform_font_pango.cc#newcode47 ui/gfx/platform_font_pango.cc:47: family->c_str(), static_cast<SkTypeface::Style>(skia_style))); note that InitFromDetails() used to always pass ...
6 years, 5 months ago (2014-07-18 01:16:20 UTC) #1
msw
lgtm https://codereview.chromium.org/399113005/diff/1/ui/gfx/platform_font_pango.cc File ui/gfx/platform_font_pango.cc (right): https://codereview.chromium.org/399113005/diff/1/ui/gfx/platform_font_pango.cc#newcode47 ui/gfx/platform_font_pango.cc:47: family->c_str(), static_cast<SkTypeface::Style>(skia_style))); On 2014/07/18 01:16:19, Daniel Erat wrote: ...
6 years, 5 months ago (2014-07-18 03:58:27 UTC) #2
Daniel Erat
https://codereview.chromium.org/399113005/diff/1/ui/gfx/platform_font_pango.cc File ui/gfx/platform_font_pango.cc (right): https://codereview.chromium.org/399113005/diff/1/ui/gfx/platform_font_pango.cc#newcode52 ui/gfx/platform_font_pango.cc:52: kFallbackFontFamilyName, static_cast<SkTypeface::Style>(skia_style))); On 2014/07/18 03:58:27, msw wrote: > On ...
6 years, 5 months ago (2014-07-18 04:49:59 UTC) #3
Daniel Erat
https://codereview.chromium.org/399113005/diff/1/ui/gfx/platform_font_pango.cc File ui/gfx/platform_font_pango.cc (right): https://codereview.chromium.org/399113005/diff/1/ui/gfx/platform_font_pango.cc#newcode52 ui/gfx/platform_font_pango.cc:52: kFallbackFontFamilyName, static_cast<SkTypeface::Style>(skia_style))); On 2014/07/18 04:49:59, Daniel Erat wrote: > ...
6 years, 5 months ago (2014-07-18 14:53:46 UTC) #4
Daniel Erat
The CQ bit was checked by derat@chromium.org
6 years, 5 months ago (2014-07-18 14:54:05 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/derat@chromium.org/399113005/20001
6 years, 5 months ago (2014-07-18 14:54:41 UTC) #6
commit-bot: I haz the power
Change committed as 284125
6 years, 5 months ago (2014-07-18 16:53:48 UTC) #7
msw
6 years, 5 months ago (2014-07-18 17:32:26 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/399113005/diff/1/ui/gfx/platform_font_pango.cc
File ui/gfx/platform_font_pango.cc (right):

https://codereview.chromium.org/399113005/diff/1/ui/gfx/platform_font_pango.c...
ui/gfx/platform_font_pango.cc:52: kFallbackFontFamilyName,
static_cast<SkTypeface::Style>(skia_style)));
On 2014/07/18 14:53:45, Daniel Erat wrote:
> On 2014/07/18 04:49:59, Daniel Erat wrote:
> > On 2014/07/18 03:58:27, msw wrote:
> > > On 2014/07/18 01:16:19, Daniel Erat wrote:
> > > > i'm less sure about this one. should i unconditionally use
> > SkTypeface::kNormal
> > > > here to increase the chances of a match?
> > > 
> > > I suppose you could add another if (!typeface) block, or watch for
crashes.
> > 
> > i think i'll just watch for crashes, since i don't want to write code based
on
> > superstition and am not sure how to trigger this case to see if it's an
actual
> > problem.
> 
> just to follow up on this: skia looks like it's doing a straightforward
> fontconfig query in SkFontConfigInterfaceDirect::matchFamilyName() in
> src/ports/SkFontConfigInterface_direct.cpp. i've verified that when i query
> fontconfig for a bold/italic version of a font that only provides a regular
> style, it returns the regular font, so i think that this will fall back
> automatically.

Nice! Good call testing that behavior!

Powered by Google App Engine
This is Rietveld 408576698