[MPEG-OTSPEC] Colour fonts and PDF

Olaf Drümmer o.druemmer at callassoftware.com
Sat Feb 6 00:27:19 CET 2021


From version 1.0 onwards, PDF has always had a font type called "Type3" (whose roots go back to PostScript Type 3 fonts). Glyphs in a Type3 font (or rather one of its two subtypes) in PDF essentially can contain any combination of graphic objects, using any feature that can be used in a PDF page description. Thus, in principle a colour font can be 'transcoded' into a Type3 font in PDF (and that is what some applications do - that can handle colour fonts - when they export to PDF).

Whether that's a good idea, is a completely different story. Given that adoption of colour fonts grows over time, it will probably be smarter to have a future version of PDF support colour fonts directly (as an extension to its current support  of OpenType). At this moment I have no insights though where that discussion stands within the PDF working group at ISO TC 171 . I am sure somebody will chime in here with more up to date info.

Olaf

PS: I used to be involved in that ISO PDF working group for a decade or so but am not participating anymore in any direct fashion.

> On 5. Feb 2021, at 21:01, Peter Constable <pgcon6 at msn.com> wrote:
> 
>> PDF document being produced by extracting the layers from the COLR/CPAL font
> 
> Displaying in colour with a COLR v0 font requires layer info to be extracted from the font at _some_ point in the process, but there are different possibilities for where. 
> 
>> and producing a multilayer PDF document.
> 
> OK, one possibility is that a text engine pulls the layer info from the font, renders the text, and the rendered bitmap gets embedded into the PDF. But that wouldn't be a "multilayer PDF".
> 
> For text in a PDF, the font data can be embedded into the PDF. One conceptual possibility-and maybe this is what you had in mind-would be for a PDF writer to create layered text elements in the PDF, and also to read the font data and create multiple derivative fonts that don't include a COLR table but each usable for one of the text layers-similar to the different Galileo fonts in your linked PDF. While that's a conceptual possibility, I'd be surprised if there were any applications that did this: I don't think it's really needed.
> 
> A different conceptual possibility involving embedded font data would be simpler-and maybe this is what you have in mind:
> 
> When text is laid out (colour font or non colour font), the layout result will describe the text in terms of glyph IDs and positions. Text elements in a PDF document are just that: glyph IDs with positions. The PDF viewer then displays each glyph, by glyph ID, at a particular position. Now, when text using a COLR v0 font is laid out, the layout result still has glyph IDs and positions, but it also includes a z-order and colour details. Text elements in the PDF format might not include glyph-by-glyph z-order and colour properties, but I expect it would have z-order and color info for the text element as a whole. All of the different-coloured glyphs using a COLR v0 font are glyphs from that font. So, the PDF could have layered text elements plus that font embedded (potentially with the COLR table removed, since it wouldn't be needed when the PDF document is viewed).
> 
> I wouldn't be surprised if some applications can do this now, though I can't point to any specific case.
> 
> I did an experiment with some apps that can display colour text using a COLR v0 font and output to PDF. Viewing a page in Firefox and then printing using the Windows PDF print driver, that combination does produce a PDF that displays the COLR v0 colour glyphs in colour. However, it seems like it may be embedding the entire line containing the colour glyphs as a bitmap-I'm not able to select text from the line, even non-colour text. I don't know if that might be a limitation in Firefox, in the print driver, or both.
> 
> 
> 
> Peter
> 
> -----Original Message-----
> From: mpeg-otspec <mpeg-otspec-bounces at lists.aau.at> On Behalf Of William_J_G Overington
> Sent: Friday, February 5, 2021 9:21 AM
> To: mpeg-otspec at lists.aau.at
> Subject: [MPEG-OTSPEC] Colour fonts and PDF
> 
> What is the current situation regarding colour fonts and PDF (Portable Document Format) please?
> 
> I seem to remember that some years ago there was something - possibly in this list - about somebody having produced an experimental program that had input of text and the program produced a PDF document, without any alteration being needed to the PDF specification, the  PDF document being produced by extracting the layers from the COLR/CPAL font and producing a multilayer PDF document, one layer for each colour. Has that idea been developed and become mainstream please?
> 
> Producing an end result like the long-possible facility of using a set of fonts and manually combining several layers, one for each font, as in the following example.
> 
> https://na01.safelinks.protection.outlook.com/?url=http:%2F%2Fwww.users.globalnet.co.uk%2F~ngo%2Fmosaic3.PDF&data=04%7C01%7C%7C4a175f29fce9448ae85708d8c9fa792a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637481424904885211%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=U3ZrPfLLYcVISxwwHGG%2F6bcvH6Mu%2Bld89x%2B3UqmDlw8%3D&reserved=0
> 
> William Overington
> 
> Friday 5 February 2021
> 
> _______________________________________________
> mpeg-otspec mailing list
> mpeg-otspec at lists.aau.at
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.aau.at%2Fmailman%2Flistinfo%2Fmpeg-otspec&data=04%7C01%7C%7C4a175f29fce9448ae85708d8c9fa792a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637481424904885211%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=U%2BC9EtdAcdI3Ghgh3XNecYYlJvZh8WDetTY7%2F6gDl%2Bo%3D&reserved=0
> _______________________________________________
> mpeg-otspec mailing list
> mpeg-otspec at lists.aau.at
> https://lists.aau.at/mailman/listinfo/mpeg-otspec

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1388 bytes
Desc: not available
URL: <https://lists.aau.at/pipermail/mpeg-otspec/attachments/20210206/c2fa1cb7/attachment.p7s>


More information about the mpeg-otspec mailing list