Commit 651f5a29 authored by Juan Antonio Navarro Pérez's avatar Juan Antonio Navarro Pérez Committed by Commit Bot

Revert "Fix default font used in VR text element"

This reverts commit b5385fa9.

Reason for revert: Appears to have broken VR render tests https://crbug.com/1013009

Original change's description:
> Fix default font used in VR text element
> 
> The VR code is using the default font "sans-serif".
> The Font (and FontList) on that platform is the PlatformFontSkia
> When creating the font with the literal "sans-serif", there is
> not matched typeface.
> 
> The function creating the typeface has a fallback path that try
> "sans" which is the resulting typeface used.
> 
> see: https://cs.chromium.org/chromium/src/ui/gfx/platform_font_skia.cc?l=53
> 
> This CL avoid to use that fallback logic. Instead, we rely on
> the FontList behavior to use the default system font with the default
> constructor.
> 
> 
> R=​alcooper@chromium.org
> 
> Change-Id: I612502f32d77787b8f0346c0fc23cd65b68e3013
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1847902
> Reviewed-by: Klaus Weidner <klausw@chromium.org>
> Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#704279}

TBR=klausw@chromium.org,etienneb@chromium.org,alcooper@chromium.org

Change-Id: I7a54e9bf314a67661e625cbb4d838eea73560b75
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1852424Reviewed-by: default avatarJuan Antonio Navarro Pérez <perezju@chromium.org>
Commit-Queue: Juan Antonio Navarro Pérez <perezju@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704530}
parent 4ba69d77
......@@ -24,6 +24,7 @@ namespace {
constexpr float kCursorWidthRatio = 0.07f;
constexpr int kTextPixelPerDmm = 1100;
constexpr float kTextShadowScaleFactor = 1000.0f;
constexpr char kDefaultFontFamily[] = "sans-serif";
int DmmToPixel(float dmm) {
return static_cast<int>(dmm * kTextPixelPerDmm);
......@@ -388,9 +389,8 @@ gfx::Size TextTexture::LayOutText() {
text_bounds.set_width(DmmToPixel(text_width_));
}
gfx::FontList fonts;
if (fonts.GetFontSize() != pixel_font_height)
fonts = fonts.DeriveWithSizeDelta(pixel_font_height - fonts.GetFontSize());
gfx::FontList fonts =
gfx::FontList(gfx::Font(kDefaultFontFamily, pixel_font_height));
TextRenderParameters parameters;
parameters.color = color_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment