mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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.
This commit is contained in:
parent
05f2d0ca83
commit
cc24e68186
4 changed files with 57 additions and 11 deletions
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue