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

SSA/ASS embedded fonts don’t work unless ass_set_fonts is called after they’re parsed #266

Open
astiob opened this issue Feb 14, 2017 · 2 comments
Labels

Comments

@astiob
Copy link
Member

@astiob astiob commented Feb 14, 2017

Embedded fonts are set aside during parsing and imported into fontselect later in process_fontdata, called only from ass_embedded_fonts_add_provider, called only from ass_fontselect_init, called only from ass_set_fonts. So embedded fonts are unavailable until ass_set_fonts is called. But it’s usually called before embedded fonts are parsed, so embedded fonts don’t work!

This breaks embedded fonts in external subtitle files in VLC and FFmpeg’s vf_subtitles (which use ass_process_codec_private to parse the whole file except Dialogue lines: VLC, FFmpeg), Kodi, MPlayer, mplayer2 (which use ass_read_memory to read the whole file), FFmpeg’s vf_ass and our test utility (which use ass_read_file to read the whole file). (Note: MPlayer’s internal copy of libass, which is used if a system libass is not found or is too old, is a copy from 2013. I don’t know how it behaves.)

Embedded fonts work in mpv, because it calls ass_set_fonts after calling ass_process_codec_private to parse the whole file except Dialogue lines (as parsed by FFmpeg).

@rcombs
Copy link
Member

@rcombs rcombs commented Feb 14, 2017

TBH I didn't realize embedded fonts were actually a thing anyone used. But this seems like it should be easy enough to fix, so w/e.

@tcyrus
Copy link

@tcyrus tcyrus commented Jul 20, 2020

Wanted to check the status on this since there hasn't been any updates posted in a while

TheOneric added a commit to TheOneric/libass-regression-tests-tmp that referenced this issue Oct 27, 2020
As compare can't yet deal with embedded font, this test is currently
disabled. See: libass/libass#266
The sample image was produced with mpv and some image editing.
TheOneric added a commit to TheOneric/libass-regression-tests-tmp that referenced this issue Oct 27, 2020
As compare can't yet deal with embedded font, this test is currently
disabled. See: libass/libass#266
The sample image was produced with mpv and some image editing.
TheOneric added a commit to TheOneric/libass-regression-tests-tmp that referenced this issue Mar 5, 2021
to transition to git-lfs and get rid of old binaries in git history.
Images and fonts are now sotred in LFS.
Previous master history is retained in new branch 'oldmaster'.

Regression Tests:
 - Karaoke tests for libass/#216 and libass/#357
 - Image draw regression test
 - Test for regression reported at mpv/#7712
 - Implicit positioning tests
 - SBAS default test
 - Zero Area Events
 - Embedded font test (disabled,
     due to libass/libass#266 )

Crash tests:
 - Aegisub's format test
 - Some thrown-toegether file which tires to cover many codepaths
TheOneric added a commit to TheOneric/libass that referenced this issue Mar 26, 2021
Previously only both only worked when ass_set_fonts was called after all
embedded and memory fonts were already added. Especially for embedded
fonts this meant it won't work for most users, including our own
utilities, even if extract_fonts was set, except for mpv who happened to
have the "right" callorder.

Now that it works, enable extract_fonts in our utilities.

GitHub: fixes libass#266, fixes libass#98
TheOneric added a commit to TheOneric/libass that referenced this issue Mar 26, 2021
Previously only both only worked when ass_set_fonts was called after all
embedded and memory fonts were already added. Especially for embedded
fonts this meant it won't work for most users, including our own
utilities, even if extract_fonts was set, except for mpv who happened to
have the "right" callorder.

Now that it works, enable extract_fonts in our utilities.

GitHub: fixes libass#266, fixes libass#98
TheOneric added a commit to TheOneric/libass that referenced this issue Mar 26, 2021
Previously only both only worked when ass_set_fonts was called after all
embedded and memory fonts were already added. Especially for embedded
fonts this meant it won't work for most users, including our own
utilities, even if extract_fonts was set, except for mpv who happened to
have the "right" callorder.

Now that it works, enable extract_fonts in our utilities.

GitHub: fixes libass#266, fixes libass#98
TheOneric added a commit to TheOneric/libass that referenced this issue Mar 27, 2021
Previously only both only worked when ass_set_fonts was called after all
embedded and memory fonts were already added. Especially for embedded
fonts this meant it won't work for most users, including our own
utilities, even if extract_fonts was set, except for mpv who happened to
have the "right" callorder.

Now that it works, enable extract_fonts in our utilities.

GitHub: fixes libass#266, fixes libass#98
TheOneric added a commit to TheOneric/libass that referenced this issue Mar 27, 2021
Previously only both only worked when ass_set_fonts was called after all
embedded and memory fonts were already added. Especially for embedded
fonts this meant it won't work for most users, including our own
utilities, even if extract_fonts was set, except for mpv who happened to
have the "right" callorder.

Now that it works, enable extract_fonts in our utilities.

GitHub: fixes libass#266, fixes libass#98
TheOneric added a commit to TheOneric/libass that referenced this issue Mar 27, 2021
Previously only both only worked when ass_set_fonts was called after all
embedded and memory fonts were already added. Especially for embedded
fonts this meant it won't work for most users, including our own
utilities, even if extract_fonts was set, except for mpv who happened to
have the "right" callorder.

Now that it works, enable extract_fonts in our utilities.

GitHub: fixes libass#266, fixes libass#98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants