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

sub: add --sub-fonts-dir and --osd-fonts-dir options #9856

Merged
merged 1 commit into from
Mar 1, 2023

Conversation

fbriere
Copy link
Contributor

@fbriere fbriere commented Feb 11, 2022

These options make it possible to specify the directory that will be
passed to ass_set_fonts_dir(), akin to VLC's --ssa-fontsdir and
FFmpeg's fontsdir.

Fixes #8338

@fbriere
Copy link
Contributor Author

fbriere commented Feb 11, 2022

A few additional comments:

  • Since opts is not available in mp_ass_init(), I had to move the ass_set_fonts_dir() call to mp_ass_configure_fonts(), thus pushing it later in time. From what I could tell after browsing the libass code, everything should be okay as long as it is called before ass_set_fonts().
  • I could not find any (public) way of obtaining the .library member of a ASS_Renderer, hence the additional parameter to mp_ass_configure_fonts().
  • Is it okay to specify ~~/fonts as a literal default value, relying on it being expanded later? I could not find any other instance similar to this, so I just wanted to make sure.

@dyphire
Copy link
Contributor

dyphire commented Feb 11, 2022

Can path be used such as the sub-file-paths option? Realize this function: sub-fonts-dir=<path1:path2:...>
This can work on different paths and sub paths.

@fbriere
Copy link
Contributor Author

fbriere commented Feb 11, 2022

Can path be used such as the sub-file-paths option?

As I explained in #8338, libass only supports using a single directory. If there's a way around that, I'd be glad to hear it.

@dyphire
Copy link
Contributor

dyphire commented Feb 12, 2022

As I explained in #8338, libass only supports using a single directory. If there's a way around that, I'd be glad to hear it.

I see. This pr is still a good change.

dyphire added a commit to dyphire/mpv-config that referenced this pull request Mar 1, 2022
在播放目录下自动指定`sub-fonts-dir`要使用的字体目录fonts以实现加载特定字体目录。**注意**:mpv必于以包含pr mpv-player/mpv#9856 的版本编译方可使用此脚本
dyphire added a commit to dyphire/mpv-config that referenced this pull request Mar 1, 2022
在播放目录下自动指定`sub-fonts-dir`要使用的字体目录fonts以实现加载特定字体目录。**注意**:mpv必于以包含pr mpv-player/mpv#9856 的版本编译方可使用此脚本
dyphire added a commit to dyphire/mpv-config that referenced this pull request Mar 1, 2022
在播放目录下自动指定`sub-fonts-dir`要使用的字体目录fonts以实现加载特定字体目录。**注意**:mpv必须以包含pr mpv-player/mpv#9856 的版本编译方可使用此脚本
Copy link
Member

@Dudemanguy Dudemanguy left a comment

Choose a reason for hiding this comment

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

Sorry for the delays.

sub/ass_mp.c Outdated Show resolved Hide resolved
sub/osd.c Outdated Show resolved Hide resolved
sub/osd.c Outdated Show resolved Hide resolved
sub/ass_mp.c Outdated Show resolved Hide resolved
DOCS/man/options.rst Outdated Show resolved Hide resolved
These options make it possible to specify the directory that will be
passed to ass_set_fonts_dir(), akin to VLC's `--ssa-fontsdir` and
FFmpeg's `fontsdir`.

Fixes mpv-player#8338
Copy link
Member

@Dudemanguy Dudemanguy left a comment

Choose a reason for hiding this comment

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

Code LGTM. I'll try to find some time to actually test this soon.

@Dudemanguy
Copy link
Member

Works as advertised.

@Dudemanguy Dudemanguy merged commit 779d4f9 into mpv-player:master Mar 1, 2023
@fbriere fbriere deleted the feature/fonts-dir branch March 1, 2023 03:09
dyphire added a commit to dyphire/mpv-config that referenced this pull request Apr 24, 2023
在播放目录下自动指定`sub-fonts-dir`要使用的字体目录fonts以实现加载特定字体目录。**注意**:mpv必须以包含pr mpv-player/mpv#9856 的版本编译方可使用此脚本


Former-commit-id: ba437d2
dyphire added a commit to dyphire/mpv-config that referenced this pull request Apr 24, 2023
在播放目录下自动指定`sub-fonts-dir`要使用的字体目录fonts以实现加载特定字体目录。**注意**:mpv必须以包含pr mpv-player/mpv#9856 的版本编译方可使用此脚本


Former-commit-id: ba437d2
Former-commit-id: 5ea8754
dyphire added a commit to dyphire/mpv-config that referenced this pull request Apr 24, 2023
在播放目录下自动指定`sub-fonts-dir`要使用的字体目录fonts以实现加载特定字体目录。**注意**:mpv必须以包含pr mpv-player/mpv#9856 的版本编译方可使用此脚本


Former-commit-id: 91f390a [formerly ba437d2]
Former-commit-id: 5ea8754
Former-commit-id: 00d7e94
dyphire added a commit to dyphire/mpv-config that referenced this pull request Apr 24, 2023
在播放目录下自动指定`sub-fonts-dir`要使用的字体目录fonts以实现加载特定字体目录。**注意**:mpv必于以包含pr mpv-player/mpv#9856 的版本编译方可使用此脚本


Former-commit-id: 70211cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Load fonts from external folder
3 participants