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

hb-ft does not correctly scale bitmap-only fonts #489

Closed
behdad opened this issue May 22, 2017 · 8 comments
Closed

hb-ft does not correctly scale bitmap-only fonts #489

behdad opened this issue May 22, 2017 · 8 comments
Assignees
Labels

Comments

@behdad
Copy link
Member

behdad commented May 22, 2017

Like NotoColorEmoji for example.

@behdad behdad self-assigned this May 22, 2017
@behdad behdad added the bug label May 22, 2017
@behdad
Copy link
Member Author

behdad commented May 22, 2017

In the meantime, using hb-ot font funcs works. Eg. --font-funcs=ot

@behdad behdad changed the title hb-font does not correctly scale bitmap-only fonts hb-ft does not correctly scale bitmap-only fonts Nov 14, 2017
@behdad
Copy link
Member Author

behdad commented Dec 19, 2019

If anyone wants to attach this, here's the logic in cairo that picks up the best strike and uses that size to call FreeType, and scaling results:

https://github.com/behdad/cairo/blob/color-emoji/src/cairo-ft-font.c#L726

It's quite doable. Just a bit of head-scratching to figure out where to do it to minimize changes.

@khaledhosny
Copy link
Collaborator

Now that FreeType has FT_Get_Transform() (#2428), what do we need to do here?

@khaledhosny
Copy link
Collaborator

It seems to have gotten worse:

$ hb-view NotoColorEmoji.ttf  123 --font-funcs=ft
hb-view: Failed: invalid matrix (not invertible)

@behdad
Copy link
Member Author

behdad commented Jul 15, 2022

It seems to have gotten worse:

$ hb-view NotoColorEmoji.ttf  123 --font-funcs=ft
hb-view: Failed: invalid matrix (not invertible)

Weird. I don't remember any changes that would trigger that.

Let me try to tackle this.

@behdad
Copy link
Member Author

behdad commented Jul 15, 2022

This is very peculiar. My system hb-view doesn't have the change of behavior whereas if I compile the same version (4.0.0) I get the invalid matrix error. With same system freetype and cairo.

@behdad
Copy link
Member Author

behdad commented Jul 15, 2022

The error message is from cairo FWIW.

behdad added a commit that referenced this issue Jul 15, 2022
Fixes #489

Something about the vertical metrics is still off, not matching
hb-ot.  I cannot figure out what.
behdad added a commit that referenced this issue Jul 15, 2022
Fixes #489

Something about the vertical metrics is still off, not matching
hb-ot.  I cannot figure out what.
@behdad
Copy link
Member Author

behdad commented Jul 15, 2022

I almost have a fix here: #3726

@behdad behdad closed this as completed in 901236f Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants