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

[draw] hb_font_get_glyph_shape() always uses the slant of the parent #3890

Closed
khaledhosny opened this issue Nov 23, 2022 · 13 comments
Closed
Labels

Comments

@khaledhosny
Copy link
Collaborator

I’m trying to use hb_font_get_glyph_shape() on a font that has synthetic slant set on it, but I don’t want to apply the slant, so I created a sub font and set the slant on it to zero, but I’m still getting slanted outlines. Is this expected?

@behdad
Copy link
Member

behdad commented Nov 23, 2022

Definitely not expected. I think I know why it's happening though.

@behdad
Copy link
Member

behdad commented Nov 23, 2022

The parent font already returns shapes slanted. The subfont's slant, if anything, would be added to the parent font. Does that happen? I don't think it does. Anyway, I think that would be the expected behavior, not what you expect.

@behdad
Copy link
Member

behdad commented Nov 23, 2022

Does that happen?

I don't think it does, but should be possible to fix.

@behdad
Copy link
Member

behdad commented Nov 23, 2022

I don't think it does, but should be possible to fix.

Humm. Seems to work. I'm not sure why.

@behdad
Copy link
Member

behdad commented Nov 23, 2022

Oh, because I set the slant on the parent font, nevermind.

@behdad
Copy link
Member

behdad commented Nov 23, 2022

Oh, because I set the slant on the parent font, nevermind.

I tested setting slant on the child font only, still seems to work.

@behdad
Copy link
Member

behdad commented Nov 23, 2022

Adding the slants don't make sense though. Creating a new sub_font would double-slant. Scratch that. Let me think more.

@behdad
Copy link
Member

behdad commented Nov 23, 2022

Oh. It looks like we are double-slanting currently.

@behdad
Copy link
Member

behdad commented Nov 23, 2022

Oh. It looks like we are double-slanting currently.

Or maybe not, but something very weird currently going on.

@behdad
Copy link
Member

behdad commented Nov 23, 2022

I agree with your initial expectation now. We just have to adjust the outlines for the difference in the slant in the hb_font_get_glyph_shape_default_adaptor_t.

For now, I'm seeing some weird behavior that I'm debugging.

@behdad
Copy link
Member

behdad commented Nov 23, 2022

For now, I'm seeing some weird behavior that I'm debugging.

2e9b270

@behdad behdad closed this as completed in 060ecac Nov 23, 2022
@behdad
Copy link
Member

behdad commented Nov 23, 2022

Fixed. Please test.

@khaledhosny
Copy link
Collaborator Author

Verified, thanks!

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