Closed nigelmegitt closed 5 years ago
A key question in my mind is whether support for font files embedded within the IMSC document, i.e. embedded content resource, is required. This can yield to unwieldy XML documents very rapidly, and most, if not all, containers formats, e.g. MXF and ISO BMFF, support embedding of resources.
If the requirement is to support glyphs defined in private use areas then embedded font support would also be needed, in my view, because it is the only generally reliable way to ensure that the private use area codes map to the right glyphs. There may be private schemes that can be constructed, but they would likely be brittle across time and between organisations.
I can see that this could be used in an unfortunate way as you describe @palemieux , for non-private use area fonts, but there would be no document constraint forcing the document author to embed the font, so this is a matter of the practices we need to support rather than impose.
You should be aware that when font embedding is used, it is most often the case that the font is a subset font; that is, it only contains the glyphs necessary to render the containing document. This significantly reduces the size of the embedding, particularly w.r.t. CJK fonts. So it may not be as unwieldy as you imagine.
it is most often the case that the font is a subset font;
Yes, I can see this use case being useful, and of reasonable impact on the size/complexity of the document.
Perhaps the HRM can simply limit the size of embedded resources.
Is there a readily available example of what a subset font resource looks like?
It "a subset font resource" is identical to a fully populated font resource, but has only those glyphs (and related table entries) that apply to a subset of characters supported by the full (non-subset) font. There is no change in format or syntax of the subset font.
@nigelmegitt I'm not convinced the use of private use areas is the right way to go, I would prefer using readable characters for accessibility/fallback reasons, but I do support the idea of adding support to the font element in IMSC1.2.
I also agree with @palemieux that we need to see if we want to allow referencing and/or embedding.
That said, we also need to think about the restrictions that we want to put in terms of syntax. For example, for referencing, there are so many ways to do it:
<font src="file.otf"/>
vs.
<font><source src="file.otf"/></font>
vs.
<font><source><data src="file.otf"/></source></font>
not even mentioning the use of fragment identifiers, which can point to source
or data
elements themselves pointing to external resource ...
I'm not convinced the use of private use areas is the right way to go
@cconcolato I agree - I am not convinced either, but think it should be an available option.
I also agree we should consider narrowing the permitted syntax for expressing this.
There are a number of unresolved issues:
@type
be limited to a certain set of values?This is probably a good topic to discuss at TPAC - I've added the agenda label.
As a strawman, I propose the following limits to font resources in IMSC 1.2: no more than 2 font resources, each no larger than 10 MB.
This doubles the limits imposed on D-Cinema subtitles.
The Timed Text Working Group just discussed Support `#font` TTML2 feature #imsc472
, and agreed to the following:
RESOLUTION: For FPWD limit fetched font resource to 10 megabytes
RESOLUTION: No constraint on @type but IMSC processors need to support minimum set of font formats
I have a comment about this:
8.4 Font Resources
A Presentation Processor SHALL support font resources of the following content types:
font/otf with TrueType or CFF glyph data; or
font/woff with TrueType or CFF glyph data.
Even though the comment for "otf" says TrueType or CFF glyph data, "otf" looks like a file extension and will certainly lead many implementors to believe that .ttf fonts are not supported. The bulk of our fonts at Netflix are .ttf, and I suspect this is true of the industry. There should be a less confusing way to express the intent (if it is not actually to not support .ttf) or simply add this line font/tff with TrueType glyph data.
@lcollinsnflx Which of the advanced text layout features (OTL, AAT, and SIL) are/should be supported? See https://www.iana.org/assignments/media-types/font/ttf
OTL is the most widely implemented set of layout features in fonts. Same goes for rendering support in the various layout engines. So an implementation of this spec that wants to support layout, especially for scripts that require it for intelligible rendering, should support OTL at a minimum.
@lcollinsnflx Thanks. Do you understand the difference between font/otf;outlines=CFF
and font/ttf;layout=OTL
?
Yes, what's your point?
@lcollinsnflx Oh. I meant: what is the difference? :)
the former has opentype CFF glyph data and opentype layout and the latter has truetype glyphs with open type layout tables.
It's still not clear where you are leading with this, especially since the spec mentions nothing about layout features.
@lcollinsnflx Oh. I meant the difference between font/otf;outlines=TTF
and font/ttf;layout=OTL
... I mis-typed last night.
In other words, is font/otf;outlines=TTF
equivalent to font/ttf;layout=OTL
, or does font/otf;outlines=TTF
include features beyond font/ttf;layout=OTL
?
It's still not clear where you are leading with this, especially since the spec mentions nothing about layout features.
Simply trying to understand the differences between these various font formats.
Well, for one, font/ttf;layout=OTL might also contain AAT, unless there is a different way to specify both. This has been true of many of Apple's fonts. Implementations that can handle AAT and OTL might prefer AAT due to performance characteristics. But, for the most part, font/otf;outlines=TTF and font/ttf;layout=OTL are identical. My original point was not that one could not understand that that the spec as written allows fonts with TrueType glyphs, but as written it suggests that you can only have them if the file extension is .otf. That would certainly exclude thousands of fonts that people might use for subtitles. If you don't add "font/ttf" then there should be more clarification of the actual intent regarding font file names.
@lcollinsnflx Thanks for the detailed information, and your patience.
Well, for one, font/ttf;layout=OTL might also contain AAT, unless there is a different way to specify both.
Ok, so it sounds like font/ttf;layout=OTL
must contain OTL layout but may also contain AAT layouts, which is ok if OTL support is required.
If you don't add "font/ttf" then there should be more clarification of the actual intent regarding font file names.
Yes, perhaps we could simply note that font/otf
includes Font file extensions used for OFF / OpenType fonts: .ttf and .otf, as specified at https://www.iana.org/assignments/media-types/font/otf
note that font/otf includes Font file extensions used for OFF / OpenType fonts: .ttf and .otf, as specified at https://www.iana.org/assignments/media-types/font/otf That would address my concern.
Just to note, TTML2, which defines the underlying feature, i.e., font
element, does not make any assumption whatsoever about names of resources or their extensions. That is, extension usage doesn't signify as far as TTML2 is concerned.
@skynavga Yes... the concern, as I understand it, was that font/otf
would imply that only .otf
files were supported.
Currently the
#font
TTML2 feature is not listed in IMSC 1.1. This means that its use is prohibited. This means that fonts can not be embedded or referenced by explicit URL.One of the proposed approaches to w3c/tt-reqs#15 is to use private use areas of the Unicode range and a font that defines glyphs for the code points used. To do that we would almost certainly a need to support
#font
since the only reliable way to make use of private use area code points is to reference the font that defines the glyphs explicitly, or to embed it.