-
Notifications
You must be signed in to change notification settings - Fork 485
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
Attached font not used by internal VSFilter #2312
Comments
I added the mimetypes on the 31st. efb35d8 |
That was for libass, and this MIME type was already on the list. |
As a matter of fact, switching the internal renderer to libass (in the published 2.1.0 release) also displays the fonts correctly. Only the VSFilter path is wrong. |
Oops, you are right. |
Good thing we have that option. :) |
Problem is in I am not sure if this fallback code is correct and why it was originally added. |
So I added this during this commit: 2a9e1da I remember vaguely that sometimes that font would choose the "closest matching" font and this was better. But clearly the code has issues, maybe with UTF-8 fontnames... |
It doesn't work when a font is referenced to by its family name (of group of similar fonts) instead of its exact facename. |
It probably selects Arial 9 times out of 10 when it fails. Perhaps if we said "it doesn't match, and it's Arial"? |
What's happened is the actual filename is Unfortunately we cannot see the filename of the font that is selected into memory... |
The filename doesn’t (shouldn’t) matter at all. What I think clsid2 is referring to is family name vs full name of the individual font. And for PostScript-outline fonts, it’s family name vs PostScript name instead. But actually this probably isn’t relevant here, because this font’s full and family names are the same. |
I cannot see that name anywhere in the font, but it is the filename. But perhaps that's the asian facename, and I just can't see it because of my locale. |
Yes, the font in this issue has two sets of names: one in English and one in Chinese. You can see them e. g. with fontTools (below), FontForge, or Fontconfig’s <name>
<namerecord nameID="0" platformID="1" platEncID="0" langID="0x0" unicode="True">
Copyright(c) Founder Corporation.1999
</namerecord>
<namerecord nameID="1" platformID="1" platEncID="0" langID="0x0" unicode="True">
FZXiaoBiaoSong-B05
</namerecord>
<namerecord nameID="2" platformID="1" platEncID="0" langID="0x0" unicode="True">
Regular
</namerecord>
<namerecord nameID="3" platformID="1" platEncID="0" langID="0x0" unicode="True">
Founder:FZXiaoBiaoSong-B05 Regular
</namerecord>
<namerecord nameID="4" platformID="1" platEncID="0" langID="0x0" unicode="True">
FZXiaoBiaoSong-B05
</namerecord>
<namerecord nameID="5" platformID="1" platEncID="0" langID="0x0" unicode="True">
1.10
</namerecord>
<namerecord nameID="6" platformID="1" platEncID="0" langID="0x0" unicode="True">
FZXBSK--GBK1-0
</namerecord>
<namerecord nameID="7" platformID="1" platEncID="0" langID="0x0" unicode="True">
By Founder Corporation. ±±¥Û∑Ω’˝
</namerecord>
<namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
Copyright(c) Founder Corporation.1999
</namerecord>
<namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
FZXiaoBiaoSong-B05
</namerecord>
<namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
Regular
</namerecord>
<namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
Founder:FZXiaoBiaoSong-B05 Regular
</namerecord>
<namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
FZXiaoBiaoSong-B05
</namerecord>
<namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
1.10
</namerecord>
<namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
FZXBSK--GBK1-0
</namerecord>
<namerecord nameID="7" platformID="3" platEncID="1" langID="0x409">
By Founder Corporation. 北大方正
</namerecord>
<namerecord nameID="0" platformID="3" platEncID="1" langID="0x804">
Copyright(c) Founder Corporation.1999
</namerecord>
<namerecord nameID="1" platformID="3" platEncID="1" langID="0x804">
方正小标宋_GBK
</namerecord>
<namerecord nameID="2" platformID="3" platEncID="1" langID="0x804">
Regular
</namerecord>
<namerecord nameID="3" platformID="3" platEncID="1" langID="0x804">
Founder:方正小标宋_GBK Regular
</namerecord>
<namerecord nameID="4" platformID="3" platEncID="1" langID="0x804">
方正小标宋_GBK
</namerecord>
<namerecord nameID="5" platformID="3" platEncID="1" langID="0x804">
1.10
</namerecord>
<namerecord nameID="6" platformID="3" platEncID="1" langID="0x804">
FZXBSK--GBK1-0
</namerecord>
<namerecord nameID="7" platformID="3" platEncID="1" langID="0x804">
By Founder Corporation. 北大方正
</namerecord>
</name> |
Thanks, I can see it now.
|
When exactly two family names are present, GDI finds the font by either of them, but its API only allows it to report back one name, the choice of which indeed depends on the locale. (See this wiki for more painful details.) |
I should also mention that the whole idea of replacing the fallback by Calibri is prone to breaking subtitles by itself:
GDI does indeed select Arial for Latin so predictably that English fansubs have historically relied on exactly this happening: e. g. see libass/libass#42 (with an even better picture in the last comment). GDI’s choice does seem to depend on the combination of |
Then we will just take whatever GDI gives us. Arial used to be default font in old VSFilter anyways. |
File (originally uploaded to libass/libass#713):
https://github.com/libass/libass/files/13279922/test-00.00.00.000-00.00.00.637.7z.zip
XySubFilter (and mpv):
![A screenshot shows that the correct font is used.](https://private-user-images.githubusercontent.com/515193/281119570-3c12174d-5e90-4796-b484-fcd318e449cf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3MjM5NzMsIm5iZiI6MTcyMTcyMzY3MywicGF0aCI6Ii81MTUxOTMvMjgxMTE5NTcwLTNjMTIxNzRkLTVlOTAtNDc5Ni1iNDg0LWZjZDMxOGU0NDljZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzIzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyM1QwODM0MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04ZDNlYjc2Y2I1YWM2MjZiYTA4YzAyMmE2ZmZjMTNiYjY0ZjI5NGM0ZWU3Zjk4NmUyZjZlNjhkMDQ2OGE1M2IyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Prk-1hLl5bDmzWvGwEvGmhbznOUdWgWYOci-qsHmEMg)
MPC-HC 2.1.0 with libass disabled:
![A screenshot shows that a mix of two wrong fonts is used.](https://private-user-images.githubusercontent.com/515193/281119596-3efe7bc9-f45c-4d32-8ed3-1b68c4d2ae62.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3MjM5NzMsIm5iZiI6MTcyMTcyMzY3MywicGF0aCI6Ii81MTUxOTMvMjgxMTE5NTk2LTNlZmU3YmM5LWY0NWMtNGQzMi04ZWQzLTFiNjhjNGQyYWU2Mi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzIzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyM1QwODM0MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01NDZkYjMzZDM3NGQxYjZiZTQ1OTkxNTI3NTE4MTcwM2IyMDE1ZWMyYjliZjIyNzc4MjI0NjMwODljZDY3OTFiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.boLevEj-iTy5TC1vvBtAOIDYalNaKj6qWXy_v06NgSA)
I can’t tell what’s wrong:
application/x-truetype-font
, which should already be supported.方正小标宋_GBK.TTF
. Could the uppercase extension be a culprit? But I feel like I’ve seen lots of font attachments with all-uppercase names. And the name shouldn’t matter at all if the MIME type matches.Encoding
in the ASS style is 1, which means “any”, so the recent(ish) encoding-related font selection changes shouldn’t be interfering with it. And XySubFilter is clearly able to load it, so the encoding matches well enough.name
TrueType table contains the exact string given in the ASS style as one of the two “family names”. And again, XySubFilter is clearly able to find this font, so this isn’t an issue with the GDI-based font selection.The text was updated successfully, but these errors were encountered: