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

all_fonts throws too much information away #178

Open
CryZe opened this issue Jan 4, 2021 · 0 comments
Open

all_fonts throws too much information away #178

CryZe opened this issue Jan 4, 2021 · 0 comments

Comments

@CryZe
Copy link
Contributor

CryZe commented Jan 4, 2021

DirectWrite, Chrome and many other applications consider variable font instances to be different font faces. However the all_fonts iterator gets completely confused by this.

When it accesses the font count here, this is includes the font instances:

for font_index in 0..dwrite_family.get_font_count() {

The dwrite_font then still understands that we are talking about the specific font instance index, not a font face index:

let dwrite_font = dwrite_family.get_font(font_index);

However when it gets turned into the font handle:

handles.push(self.create_handle_from_dwrite_font(dwrite_font))

It turns the whole thing into a path + font face index pair, which completely throws away all the font instance information, meaning that for certain fonts, the iterator contains the same handle many times.

I'd say the iterator should either iterate over pairs of the handle and the font instance name or index, or that information should be part of the handle.

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

No branches or pull requests

1 participant