Skip to content
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

Fix the query logic for italic, oblique, bold, and monospace. #10

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

zedseven
Copy link
Contributor

I noticed that the query logic seemed to be broken for italic, oblique, bold, and monospace.

The below code yielded no results, even though I could see a matching font in the list:

cache.query(&FcPattern {
    family: Some(String::from("Dank Mono")),
    bold: PatternMatch::False,
    italic: PatternMatch::False,
    ..Default::default()
})

The font in the list that it should match:

FcPattern {
    name: Some(
        "Dank Mono Regular",
    ),
    family: Some(
        "Dank Mono",
    ),
    italic: False,
    oblique: DontCare,
    bold: False,
    monospace: DontCare,
    condensed: DontCare,
    weight: 0,
    unicode_range: [
        0,
        0,
    ],
}

If I've missed something that the old logic was supposed to cover, please let me know.

@fschutt fschutt merged commit 12a1ca8 into fschutt:master Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants