Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImprove quality of font rendering on Linux (and Android). #3256
Conversation
hoppipolla-critic-bot
commented
Sep 9, 2014
|
Critic review: https://critic.hoppipolla.co.uk/r/2538 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
highfive
commented
Sep 9, 2014
| let family_match = FcFontMatch(ptr::mut_null(), pattern, &mut result); | ||
|
|
||
| let family_name = if result == FcResultMatch { | ||
| let mut FC_FAMILY_C = "family".to_c_str(); |
This comment has been minimized.
This comment has been minimized.
pcwalton
Sep 9, 2014
Contributor
(Aside note: Is there no way to declare this as a real Rust constant? How does the JS engine do it?)
This comment has been minimized.
This comment has been minimized.
metajack
Sep 9, 2014
Contributor
Note that we have these everywhere in the current code. Perhaps a E-Easy followup bug to fix all of them if a solution is available?
This comment has been minimized.
This comment has been minimized.
jdm
Sep 9, 2014
Member
static FC_FAMILY: [u8, ..7] = ['f' as u8, 'a' as u8, 'm' as u8, 'i' as u8, 'l' as u8, 'y' as u8, 0 as u8];
some_fn_taking_char_ptr(&FC_FAMILY as *const u8 as *const libc::c_char);
This comment has been minimized.
This comment has been minimized.
huonw
Sep 9, 2014
Contributor
static FC_FAMILY: &'static [u8] = b"family\0";
FC_FAMILY.as_ptr() as *const libc::c_char
This comment has been minimized.
This comment has been minimized.
glennw
Sep 9, 2014
Author
Member
Added a new commit with that syntax + fixed other occurrences in that file.
|
r=me with that nit addressed if there's a better way to do it. |
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.
Improve quality of font rendering on Linux (and Android).
glennw commentedSep 9, 2014
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, related to metabug #2554.