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
info on storing/using font files in attachments #115
Conversation
The practice of storing fonts in mkv seems to be community knowledge but there's almost no hint of the practice in the specs. This adds some expectations about that here. IIUC a font may or may not used Some questions:
|
For the record: mkvmerge doesn't link attachments to tracks at the moment. I don't know of software that does. To your questions:
|
So then when is |
ecd5d4f
to
74b7b53
Compare
So far I could only find 2 files that use AttachmentLink, but in both cases it is invalid since the element is storing the value http://www.archive.org/download/scope2010/scope.mkv Both use |
To be honest I don't have a good example/use case for |
Yes, the |
If an MKV file has an attached font and an SRT subtitle track (which makes to reference to the font name), then should what is the player recommended to do? Since AttachmentLink has almost no |
I think what actual players do, at the moment, is to extract all attached fonts to the file system somewhere, register them with the OS, play back the file (at that point the font names will be known to the OS), and remove the temporarily stored fonts afterwards. The assumption is that if a font is attached, it is highly likely that it's used in the subtitles. There doesn't seem to be a real need for a strong link between track and attachments at the moment. |
Yes, for subtitles and, very rarely (I guess we did it only once and not in Matroska), for intertitle versions in different languages. |
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.
clarify the use of AttachmentLink
Updated to remove references to |
Following the discussions on #115
LGTM |
LGTM, but I don't understand why there were originally upper limits of 999.9 and 9999.9. |
These may be limits in Webm to make sure people don't set crazy values that
can't be displayed. But IMO these values sound very arbitrary.
Le 26 mai 2017 15:33, "Dave Rice" <notifications@github.com> a écrit :
… LGTM, but I don't understand why there were originally upper limits of
999.9 and 9999.9.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#115 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAoJNXF51Rzbs66dP7QWKu9xn1Z6nOUVks5r9tSkgaJpZM4MhcYb>
.
|
LGTM |
What is the status on this? (FYI: In the meantime I found different alphabets for subtitles in different Indian languages. And there are also top to bottom "subtitles", in addition to the left to right and right to left ones.) |
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.
I consider the wording here to be very ambiguous, as there's talk about "fonts stored in Attachments that match the names…". Is this talking about a font name? An Attachment name? The file name or the logical name encoded somewhere within the font file?
Personally I'd rather see a section go into detail and describe the possibilities here:
Depending on the font format in question, each font file can contain a name which will be referred to as
Font Name
from now on. ThisFont Name
can be different than the Attachment'sFileName
, even when disregarding the extension.
In order to select a font for display, a Matroska Reader SHOULD consider both theFont Name
and the base name of the Attachment'sFileName
, preferring the former when there are multiple matches. If none of the Attachments are a match, the Matroska Reader SHOULD attempt to find a system font whoseFont Name
matches the one used in the subtitle track.
In addition to different wording, we might also have to state that the procedure should only be used for certain MIME types — so that we don't expect players to try to interpret every attachment as a font. Font MIME types are slightly problematic, though, as official MIME types for fonts haven't been around that long, and a lot of players only support the unofficial ones. For that reason mkvmerge
is still using the old and non-standard application/x-truetype-font
. See also this MKVToolNix FAQ entry.
This is wrong and only due to a bug. It uses the proper |
39bc9ef
to
da03658
Compare
I rewrote the last paragraph to
That should address @mbunkus 's issue in #115 (review). |
da03658
to
c4e134c
Compare
It seems that The situation is rather confusing and it may be helpful to document the historical background - why a player may need to handle various mimetypes if it wants to support embedded fonts. Two basic points are:
So, nearly 100% of font-embedded MKVs created between 2004 and 2020-ish use legacy mimetype(s); not because they are "broken" but simply because they were created before the standard was established. Btw, it's true that a single font file may have multiple font names. (1) Obvious for TTC. (2) Font Family name vs. Full font name: e.g. "Times New Roman" + {\b1} and "Times New Roman Bold" may work identically in SSA/ASS. (3) A CJK font generally has a CJK name and an ASCII name, e.g. SimHei (ASCII font name) = 黑体 (Chinese font name). If the font name(s) of an attachned font file are necessary for some reason, one has to look into the attached file itself (the 'name' table of TTF) - because font names are not stored as Matroska elements, and the font file name can be quite random (e.g. lucon.ttf -> Lucida Console). |
…ated as it's not used. And since it's main goal was to remove attachments when removing tracks that reference them.
* allow restricting font loading to fonts with an AttachmentLink, if any is found (usually not). * file fonts have priority over system fonts (they may have the same name but different content)
and what a writer should do According to the findings from #518
and mention "font/otf" for "application/x-truetype-font"
+ don't assume to use a font it has to be installed (VLC doesn't)
6476b0e
to
df347b0
Compare
I integrated @mbunkus text into the paragraph and reordered things. Now we have a proper Font Name definition. (although it says we may also use the filename) |
dc90789 |
…8081 and fix a typo
I added I did not add
It is in fact a web-only thing that required special browser/plugin support. |
Thanks, that makes sense. Actually, That said, since SHOULD is not MUST, technically that is not a big problem and everything is looking good to me now. Thanks very much for carefully having documented this confusing, complicated situation. Really appreciated, and this should be really helpful for various developers. E.g. see https://trac.ffmpeg.org/ticket/9419 |
The changes have been integrated and the list of MIME types mentioned, application/x-truetype-font being valid for font/ttf and font/otf
No description provided.