mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add fixme comment for future work, make scale factor a constant.
This commit is contained in:
parent
0dd1b85739
commit
f7b7a96961
1 changed files with 6 additions and 1 deletions
|
@ -38,6 +38,8 @@ fn create_scaled_font(backend: BackendType, template: &Arc<FontTemplateData>, pt
|
||||||
ScaledFont::new(backend, &cgfont, pt_size as AzFloat)
|
ScaledFont::new(backend, &cgfont, pt_size as AzFloat)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static SMALL_CAPS_SCALE_FACTOR: f64 = 0.8; // Matches FireFox (see gfxFont.h)
|
||||||
|
|
||||||
struct LayoutFontCacheEntry {
|
struct LayoutFontCacheEntry {
|
||||||
family: String,
|
family: String,
|
||||||
font: Rc<RefCell<Font>>,
|
font: Rc<RefCell<Font>>,
|
||||||
|
@ -82,8 +84,11 @@ impl FontContext {
|
||||||
fn create_layout_font(&self, template: Arc<FontTemplateData>,
|
fn create_layout_font(&self, template: Arc<FontTemplateData>,
|
||||||
descriptor: FontTemplateDescriptor, pt_size: f64,
|
descriptor: FontTemplateDescriptor, pt_size: f64,
|
||||||
variant: font_variant::T) -> Font {
|
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 {
|
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,
|
font_variant::normal => pt_size,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue