-
Notifications
You must be signed in to change notification settings - Fork 77
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
Subtitle font_filename with already installed fonts #377
Comments
Is the .ttf file you're trying to load in the same directory as the script? font_filename is for non-installed fonts, i.e. you're going to give it an absolute or relative path to an actual .ttf file. If the fonts are already installed, you need to use font with the reported name of the font, not the filename. |
i tried both absolute and relative paths. the problem is that the "Font Name" is occupied, because the font is already installed, but it is installed as a group of files which have the same "Font Name" name. so i when i put the correct path, it uses the regular font from that group. |
font takes modifiers just fine.
|
oke, "modifiers" (arent in manual) might workaround a name based collision |
I mean, I call them 'modifiers' but they are part of the reported name of the font in the Windows Font Manager if you look at the title bar. It can be trickier if you're viewing them in some other font application, though - on Ubuntu Budgie, the font viewer doesn't show that the name for Thin Italic is 'ThinIta' (it just lists 'Thin Italic' a couple of times as the Style name and in smaller text underneath the family name in the title bar), and it very well might be that fontconfig treats naming conventions differently than the Windows system fonts do, or the macOS one does (if it doesn't also just use fontconfig), which could potentially change the behavior if different OSes handle font names in different ways. Not that any of those asides matter in this issue, since font styling in AviSynth+'s internal Subtitle/MessageClip-based functions is only available on Windows at the moment. |
i dont understand why a name conflict should appear in the case of explicit file parameter. the name, as i understand it, is only a hint for some resource api fetcher. yes, those names appear in the font manager's titlebar as you say. |
For additional fonts the
|
for example, could be:
|
A single font file can contain multiple fonts, with different family names. Otherwise, yes, good idea, but the imaginary LoadFont may not be appropriate if the font file would contain multiple names. But I admit that for most TTF font files this may work. This is a powershell script for listing the family names for a variable font file.
result is:
|
oke, i see, there are no arrays in avisynth.. so thats problematic. by reusing some extension system of, for example, PHP or Python, a kind of cross-platform solution could have existed: $fonts = AviSynth\LoadFont("DancingScript-Regular.ttf");
var_dump($fonts);
$clip = AviSynth\Subtitle($clip, "Roboto Test", x: -1, y: 50, font_width: 0, font: $fonts[0]);
$clip = AviSynth\Subtitle($clip, "Roboto Test", x: -1, y: 75, font_width: 0, font: $fonts[0]); but those are way more imaginary than |
Actually we have arrays in Avisynth+
My problem that this is supposed to work in "Text" for fixed bdf fonts as well, and the resourses must be free'd up when script environment is closing (I'm already thinking about the actual windows-linux-SubTitle-Text implementation, which would not be easy) |
when there is installed "Input Mono" fontset, the
Subtitle("test", font_filename="InputMono-Italic.ttf")
does not output with italic version of "Input Mono", but instead it uses system installed default regular font.
The text was updated successfully, but these errors were encountered: