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
[Subtitles][ASS] Support both user defined fonts and extracted fonts #19535
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enen92
added
Type: Fix
non-breaking change which fixes an issue
Type: Improvement
non-breaking change which improves existing functionality
v19 Matrix
Component: Subtitles
labels
Apr 8, 2021
Jenkins build this please |
jenkins build this please |
phunkyfish
requested changes
Apr 8, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minors.
phunkyfish
approved these changes
Apr 8, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Jenkins build and merge |
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Backport: Done
Component: Subtitles
Type: Fix
non-breaking change which fixes an issue
Type: Improvement
non-breaking change which improves existing functionality
v20 Nexus
Wiki: Done
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR improves font handling for ASS subtitles. In kodi we allow users to add new fonts for subtitles (see 5.1 in https://kodi.wiki/view/Subtitles) by placing them into .kodi/media/Fonts. When using external subtitles that require the use of external fonts, the user should be able to place the fonts there for kodi/libass to find and use.
The main issue here is that libass only supports a single folder for storing additional fonts (see
ass_set_fonts_dir
) and we currently use the temp folder (.kodi/temp/Fonts) - the demuxer is configured to extract fonts to this directory (for muxed subs).Due to the limitation, this PR changes the implementation and makes the demuxer extract subtitles to the user font directory by appending a known prefix to the files "tmp.font.*. This prefix is later used to cleanup temporary files, just like today (
ClearTempFonts
). This way we can support external fonts for subtitles and muxed fonts with libass.Motivation and Context
Improve font handling for ASS subtitles. Feature pairity between ASS and other subtitle formats (so that we can work towards a future conversion).
Fixes #16209
How Has This Been Tested?
This was runtime tested on Linux, Android (TV), Windows and OSX with the samples available on the team ftp server. Furthermore, external subtitles (with missing fonts) were tested using the sample provided in https://forum.kodi.tv/showthread.php?tid=361545&pid=3024983#pid3024983
Screenshots (if appropriate):
Before (segoeprb.ttf in media/Fonts):
After (segoeprb.ttf in media/Fonts)
Types of change
Checklist: