-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Ubuntu" matches "Ubuntu-ExtraBold" #245
Comments
I think this is expected behavior. "Ubuntu" is the family name and "Ubuntu Extra Bold" is the postscript name of a variant within that family. You will need to look through all the variants to find the one you need. |
I expected |
I had a look into this: First FontConfig does not have the same bug, they just use a different weight scale, normal is "80" there: Second, the issue is that the Ubuntu font uses "named variation instances" to define multiple weights on the same TTF file (not a TTC), the OS/2 table is the same for the entire file, with the same This test code: let family = font_kit::source::SystemSource::new()
.select_family_by_name("Ubuntu")
.unwrap();
for handle in family.fonts() {
let (path, index) = match &handle {
font_kit::handle::Handle::Path { path, font_index } => (path, font_index),
font_kit::handle::Handle::Memory { .. } => unreachable!(),
};
let font = handle.load().unwrap();
println!(
"{}, index={}, {}, {:?}",
path.file_name().unwrap().to_string_lossy(),
index,
font.postscript_name().unwrap(),
font.properties().weight,
);
} Outputs:
Notice the same weight for all "fonts". |
On Ubuntu 24.04, run:
$ cargo run --example match-font -- "Ubuntu"
Output:
Interesting
$ fc-match "Ubuntu :weight=400"
has the same error, but Firefox matches the correct font.The text was updated successfully, but these errors were encountered: