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

fontselect: overhaul font scoring and faux-ing #678

Merged
merged 2 commits into from
May 13, 2024

Conversation

rcombs
Copy link
Member

@rcombs rcombs commented Jan 23, 2023

Fixes #437.

This emulates GDI's behavior, both around scoring and faux decisions.

The fontconfig provider doesn't provide the full information we'd need to handle this 100% accurately, so it's best-guessed.

This branch is on top of #676, basically just to avoid rebase issues.

@TheOneric
Copy link
Member

Does this help with #305?

@rcombs
Copy link
Member Author

rcombs commented Jan 23, 2023

No; I haven't yet determined why GDI sometimes fails to faux-bold when it nominally should (or does something weird with metrics instead, as seen in Bona Nova in #437).

@astiob
Copy link
Member

astiob commented Feb 8, 2023

It feels a bit weird to convert fsSelection to a custom bitmask in fontselect but use it raw in ass_font_get_glyph. Maybe ass_face_get_fsSelection should just be ass_face_get_style_flags returning the custom bitmask instead?

@rcombs
Copy link
Member Author

rcombs commented Feb 18, 2023

Rebased with ass_face_get_style_flags returning the freetype mask constants. Might want to wait for #683?

@rcombs rcombs force-pushed the font-score branch 3 times, most recently from 2747843 to 7ee3608 Compare February 18, 2023 21:02
@astiob
Copy link
Member

astiob commented Feb 21, 2023

Nice, thanks!

Might want to wait for #683?

I was thinking of merging this first, because (IINM) #683 makes all of this PR’s DirectWrite changes redundant—but you’ve put in some good effort into them and we might find it useful to have them in Git history later.

@moi15moi
Copy link
Contributor

moi15moi commented Apr 8, 2023

This should also close #613

As far as I can tell, this is completely unused in VSFilter.
Copy link
Member

@TheOneric TheOneric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just two small nits

libass/ass_fontselect.c Outdated Show resolved Hide resolved
libass/ass_fontselect.c Outdated Show resolved Hide resolved
This emulates GDI's behavior, both around scoring and faux decisions.

The fontconfig provider doesn't provide the full information we'd need to handle this 100% accurately, so it's best-guessed.
@astiob astiob linked an issue May 13, 2024 that may be closed by this pull request
@rcombs rcombs merged commit cd223f9 into libass:master May 13, 2024
15 checks passed
@astiob astiob added this to the 0.17.2 milestone May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants