diff options
author | Glenn Watson <gw@intuitionlibrary.com> | 2014-09-09 12:56:25 +1000 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2014-09-10 07:29:40 +1000 |
commit | cc24e681868609e4ba9f23f1e0c86ef7af581cce (patch) | |
tree | 6355595015324f8ef113c999e8be059b082440e5 /components/gfx/platform/macos | |
parent | 05f2d0ca8313721074f76928fb7f87134139fc47 (diff) | |
download | servo-cc24e681868609e4ba9f23f1e0c86ef7af581cce.tar.gz servo-cc24e681868609e4ba9f23f1e0c86ef7af581cce.zip |
Improve quality of font rendering on Linux (and Android).
The freetype hinting only works on integer pixel sizes. For this
reason, the advance width metrics for a font of size 12.99 are
the same as the advance metrics for a font of size 12.0. This
results in small fonts appearing to overlap slightly, which is
particularly noticeable on parts of Wikipedia. Round the font
size up to a pixel boundary inside the freetype system.
Also fetch the system default fonts for the generic font families
rather than hard coding them.
These two changes make the font rendering on Linux very close
to the Firefox font rendering on Wikipedia.
Diffstat (limited to 'components/gfx/platform/macos')
-rw-r--r-- | components/gfx/platform/macos/font_list.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/gfx/platform/macos/font_list.rs b/components/gfx/platform/macos/font_list.rs index 4ec319ec6b2..74e22d0feb9 100644 --- a/components/gfx/platform/macos/font_list.rs +++ b/components/gfx/platform/macos/font_list.rs @@ -32,6 +32,10 @@ pub fn get_variations_for_family(family_name: &str, callback: |String|) { } } +pub fn get_system_default_family(_generic_name: &str) -> Option<String> { + None +} + pub fn get_last_resort_font_families() -> Vec<String> { vec!("Arial Unicode MS".to_string(), "Arial".to_string()) } |