From f7b7a96961038d6083dba3dfab0bd0caddbdfede Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Wed, 24 Sep 2014 06:00:46 +1000 Subject: [PATCH] Add fixme comment for future work, make scale factor a constant. --- components/gfx/font_context.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs index f00a903ffce..42a67cf0151 100644 --- a/components/gfx/font_context.rs +++ b/components/gfx/font_context.rs @@ -38,6 +38,8 @@ fn create_scaled_font(backend: BackendType, template: &Arc, pt ScaledFont::new(backend, &cgfont, pt_size as AzFloat) } +static SMALL_CAPS_SCALE_FACTOR: f64 = 0.8; // Matches FireFox (see gfxFont.h) + struct LayoutFontCacheEntry { family: String, font: Rc>, @@ -82,8 +84,11 @@ impl FontContext { fn create_layout_font(&self, template: Arc, descriptor: FontTemplateDescriptor, pt_size: f64, variant: font_variant::T) -> Font { + // TODO: (Bug #3463): Currently we only support fake small-caps + // rendering. We should also support true small-caps (where the + // font supports it) in the future. let actual_pt_size = match variant { - font_variant::small_caps => pt_size * 0.7, + font_variant::small_caps => pt_size * SMALL_CAPS_SCALE_FACTOR, font_variant::normal => pt_size, };