<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body><div class="auto-created-dir-div" dir="ltr" style="unicode-bidi: embed;"><style>p{margin:0}</style><div>Hi</div><p><br></p><p>Could there be a one-bit flag somewhere such that a font designer may choose which form of overlapping transparency behaviour is desired?</p><p><br></p><p>Or maybe two flags, each of one-bit, the first to indicate whether the font designer has specifically indicated which form of overlapping transparency behaviour is desired and the second to indicate, if the font designer has made a specific choice, which form of overlapping transparency behaviour the font designer has chosen.</p><p><br></p><p>William Overington</p><p><br></p><p>Saturday 9 January 2021</p><p><br></p><br><blockquote style="margin: 0 auto; padding: 0 2em; border-left:2px solid #00ADE5; white-space: pre-wrap "><br><br>------ Original Message ------<br>From: "Peter Constable" <pgcon6@msn.com><br>To: "Vladimir Levantovsky" <vladimir.levantovsky@gmail.com>; "'Georg Seifert'" <typogeorg@gmail.com>; "'Laurence Penney'" <lorp@lorp.org><br>Cc: "'MPEG OT Spec list'" <mpeg-otspec@lists.aau.at><br>Sent: Saturday, 2021 Jan 9 At 03:30<br>Subject: Re: [MPEG-OTSPEC] WD for AMD 2 and COLR v1 enhancements<br><br> <div class="WordSection1"> <p class="MsoNormal">While reading the <a href="https://www.w3.org/TR/css-color-4/" target="_blank"> CSS Color Module Level 4 draft</a>, a related complication was brought to mind by figure 11:</p> <p class="MsoNormal"> </p> <p class="MsoNormal"><img width="750" height="204" id="Picture_x0020_2" style="width: 7.8166in;height: 2.125in;" src="cid:0.3.1610189052702.14274" border="0"><br></p> <p class="MsoNormal"> </p> <p class="MsoNormal">If two elements of a composition overlap and have alpha < 1, their alphas would combine. What figure 11 is showing is a case in which the alpha is applied to the text as a whole (the containing text element). But it brings to mind an issue  for color fonts if glyphs are overlapping: In the case of a font like Use Your Imagination, the colour glyphs’ layers have alpha < 1, the glyphs intentionally overlap, and the expectation is that the alphas in the overlapping regions combine. E.g.,</p> <p class="MsoNormal"> </p> <p class="MsoNormal"><img width="401" height="277" id="Picture_x0020_3" style="width: 4.175in;height: 2.8833in;" src="cid:0.2.1610189052702.14274" border="0"><br></p> <p class="MsoNormal"> </p> <p class="MsoNormal"> </p> <p class="MsoNormal">But one could imaging a different colour font for a cursively connected face in which overlapping glyphs have connections with fills of the same colour and alpha, and with the intent that the alphas do not combine but that the overlapping  regions are intended to display with the same alpha as the stroke from each glyph would have—as in figure 11 above.</p> <p class="MsoNormal"> </p> <p class="MsoNormal"> </p> <p class="MsoNormal">The main point here is to point out one more way in trying to control compositional interactions between adjacent colour glyphs is non trivial, and a single example isn’t a sufficient representation of usage scenarios.</p> <p class="MsoNormal"> </p> <p class="MsoNormal"> </p> <p class="MsoNormal">Peter</p> <p class="MsoNormal"> </p> <div> <div style="border: none;border-top: solid rgb(225,225,225) 1.0pt;padding: 3.0pt 0.0in 0.0in 0.0in;"> <p class="MsoNormal"><b>From:</b> Vladimir Levantovsky <<span class="wt_Email">vladimir.levantovsky@gmail.com</span><span></span>> <br> <b>Sent:</b> Wednesday, January 6, 2021 2:23 PM<br> <b>To:</b> 'Peter Constable' <<span class="wt_Email">pgcon6@msn.com</span><span></span>>; 'Georg Seifert' <<span class="wt_Email">typogeorg@gmail.com</span><span></span>>; 'Laurence Penney' <<span class="wt_Email">lorp@lorp.org</span><span></span>><br> <b>Cc:</b> 'MPEG OT Spec list' <<span class="wt_Email">mpeg-otspec@lists.aau.at</span><span></span>><br> <b>Subject:</b> RE: [MPEG-OTSPEC] WD for AMD 2 and COLR v1 enhancements</p> </div> </div> <p class="MsoNormal"> </p> <p class="MsoNormal"><span style="color: rgb(31,73,125);">> </span>Your suggestion below sounds relatively simple, but I’m not sure it’s as simple as it seems.<span style="color: rgb(31,73,125);"></span></p> <p class="MsoNormal"><span style="color: rgb(31,73,125);"> </span></p> <p class="MsoNormal"><span style="color: rgb(31,73,125);">+1!</span></p> <p class="MsoNormal"><span style="color: rgb(31,73,125);">I don’t think it’s simple. If we assume it’s implemented …</span></p> <ul style="margin-top: 0.0in;"><li class="MsoListParagraph" style="color: rgb(31,73,125);margin-left: 0.0in;"> the number of layer groups can’t be prescribed, it would be up to a font developer to decide. We may think we do not need more than three layer groups but it’s not up to us to decide;</li><li class="MsoListParagraph" style="color: rgb(31,73,125);margin-left: 0.0in;"> we cannot assume to know the “meaning” of the layer group. Something simple, like e.g. “background” or “drop shadow” may seem straightforward, but like Peter said, even that can be problematic because shadow directions cast from a virtual light source would  affect rendering results based on direction;</li><li class="MsoListParagraph" style="color: rgb(31,73,125);margin-left: 0.0in;"> even if we think it’s ok to allow overlaps between glyphs in the same layer group – the overlaps of translucent background layers may still need blending;</li><li class="MsoListParagraph" style="color: rgb(31,73,125);margin-left: 0.0in;"> applications would have to completely change their text rendering pipeline, starting with the need to determine a number of layer groups from the font [possibly, per glyph]. Combining different glyph ranges on page may require different number of rendering  layers (e.g. color + monochrome glyphs on the same line of text), multiple layers need to be rendered, and it would have to be redone every time there are any viewport / layout / spacing / scale changes … </li><li class="MsoListParagraph" style="color: rgb(31,73,125);margin-left: 0.0in;"> in my opinion, any proposed change that affects how applications interact with fonts is a non-starter.</li></ul> <p class="MsoNormal"><span style="color: rgb(31,73,125);"> </span></p> <p class="MsoNormal"><span style="color: rgb(31,73,125);">Thanks,</span></p> <p class="MsoNormal"><span style="color: rgb(31,73,125);">Vlad</span></p> <p class="MsoNormal"><span style="color: rgb(31,73,125);"> </span></p> <p class="MsoNormal"><span style="color: rgb(31,73,125);"> </span></p> <div> <div style="border: none;border-top: solid rgb(225,225,225) 1.0pt;padding: 3.0pt 0.0in 0.0in 0.0in;"> <p class="MsoNormal"><b>From:</b> mpeg-otspec [<a href="mailto:mpeg-otspec-bounces@lists.aau.at">mailto:mpeg-otspec-bounces@lists.aau.at</a>] <b>On Behalf Of </b>Peter Constable<br> <b>Sent:</b> Wednesday, January 6, 2021 2:35 PM<br> <b>To:</b> Georg Seifert <<a href="mailto:typogeorg@gmail.com"><span class="wt_Email">typogeorg@gmail.com</span><span></span></a>>; Laurence Penney <<a href="mailto:lorp@lorp.org"><span class="wt_Email">lorp@lorp.org</span><span></span></a>><br> <b>Cc:</b> MPEG OT Spec list <<a href="mailto:mpeg-otspec@lists.aau.at"><span class="wt_Email">mpeg-otspec@lists.aau.at</span><span></span></a>><br> <b>Subject:</b> Re: [MPEG-OTSPEC] WD for AMD 2 and COLR v1 enhancements</p> </div> </div> <p class="MsoNormal"> </p> <p class="MsoPlainText">Georg:</p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">To discuss what might be feasible, I think we really need a better understanding of what set of problems might be solved. There has to be some limit to the functionality—we can’t provide Illustrator in a TTF—and I think to be feasible  any additional capabilities would need to be very minimal. The original use case that made colour fonts a reality was emoji, and I think none of this is needed for emoji. But this question really pertains to text faces. What are the kinds of effects </p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">You've given one example, with letters that have a 3D extruded appearance, with the bodies of the letters not overlapping, but each having a layer for a shadow that extends (at least for some glyphs) beyond the left side bearing. Of  course, the shadows could have gone to the right (virtual light source on the left), in which case the problem might not occur at all (at least for some implementations) because of how rendering is done. Note that the problem, in the most general case, isn't  limited to colour fonts, but can also arise for achromatic fonts if adjacent glyphs overlap and are styled with different colours. Here's an example using Calibri with letter spacing condensed to create overlap:</p> <p class="MsoPlainText"> </p> <p class="MsoNormal"><span style="font-size: 48.0pt;color: red;">A</span><span style="font-size: 48.0pt;">B<span style="color: red;">C</span>D</span></p> <p class="MsoNormal"><span style="font-size: 48.0pt;color: red;letter-spacing: -10.0pt;">A</span><span style="font-size: 48.0pt;letter-spacing: -10.0pt;">B<span style="color: red;">C</span></span><span style="font-size: 48.0pt;">D</span></p> <p class="MsoPlainText">Here’s a screenshot of how this appears in my mail agent:</p> <p class="MsoPlainText"> </p> <p class="MsoPlainText"><img width="192" height="168" id="Picture_x0020_1" style="width: 2.0in;height: 1.75in;" src="cid:0.1.1610189052702.14274" border="0"><br></p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">Now, each glyph overlaps on top of the glyph on its left. Someone might say, “Oh, but I want them to layer the opposite way.” That doesn’t imply there’s a compelling business case for text layout engines to add an option to control how  overlapping glyphs layer. </p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">I do understand that this non-colour font example isn’t entirely applicable to colour fonts, but it raises a valid question: how much machinery does it make sense to add, and what is an appropriate threshold of diminishing returns.</p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">Btw, I mentioned the <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fontspace.com%2Fuse-your-imagination-font-f43274&data=04%7C01%7C%7C57c87363b8634946d3d408d8b2919cd9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637455685753903745%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=knql33%2BclsVAiNEn17ZxPntDmbcfcdtgDVZoYlIKryY%3D&reserved=0" target="_blank"> Use Your Imagination</a> font, which has overlapping glyphs that have some transparency and so blend with simple alpha blending. If you look at the examples or try it out, you’ll notice the same right-over-left layering of adjacent glyphs, which is manifested  by the drop-shadow effect (a transparent black layer). The shadow effect used in this font didn’t require any additional data in the font. (That font was implemented using OT-SVG, but could just as well have been implemented using COLR v0.)</p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">Your suggestion below sounds relatively simple, but I’m not sure it’s as simple as it seems. First, there’s the question of what additional data is needed to describe layer groups. As I mentioned earlier, this wouldn’t be difficult for  COLR v0 colour glyphs, but for COLR v1 the notion of layer is not so simple. Then there’s a question of what controls for blending of corresponding layer groups from adjacent glyphs should be provided: would only simple alpha blending be sufficient? Without  example use cases, how do we decide that?</p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">Then, there’s the implication for text rendering engines: it implies that engines must render all colour glyphs in each line in three separate passes: layer groups 0 for all glyphs in the line, then layer groups 1, then layer groups  2. Is that additional complexity in rendering implementations worth it? I think more business justification would be needed to convince implementers.</p> <p class="MsoPlainText"> </p> <p class="MsoPlainText"> </p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">Peter</p> <p class="MsoPlainText"> </p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">-----Original Message-----</p> <p class="MsoPlainText">From: Georg Seifert <<a href="mailto:typogeorg@gmail.com"><span class="wt_Email">typogeorg@gmail.com</span><span></span></a>> </p> <p class="MsoPlainText">Sent: Wednesday, January 6, 2021 9:55 AM</p> <p class="MsoPlainText">To: Laurence Penney <<a href="mailto:lorp@lorp.org"><span class="wt_Email">lorp@lorp.org</span><span></span></a>></p> <p class="MsoPlainText">Cc: Peter Constable <<a href="mailto:pgcon6@msn.com"><span class="wt_Email">pgcon6@msn.com</span><span></span></a>>; MPEG OT Spec list <<a href="mailto:mpeg-otspec@lists.aau.at"><span class="wt_Email">mpeg-otspec@lists.aau.at</span><span></span></a>></p> <p class="MsoPlainText">Subject: Re: [MPEG-OTSPEC] WD for AMD 2 and COLR v1 enhancements</p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">I don’t think we need to have control for M x N layers. Assigning a layer group ID would be sufficient. And I don’t think in most cases we need more than three groups (e.g. background/shadow, body, highlights; and in most cases body  and highlights can be drawn together). This will not add much complexity. Draw all layers from each group for all glyph in the text box. I don’t think special control for blending between glyphs is needed, just draw then as it is now.</p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">so instead of drawing:</p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">    A.layer0, A.layer1, A.layer2, B.layer0, B.layer1, B.layer2 </p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">we do (assuming that layer0 and layer1 are in one group):</p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">    A.layer0, A.layer1, B.layer0, B.layer1, A.layer2, B.layer2</p> <p class="MsoPlainText"> </p> <p class="MsoPlainText">Georg</p> </div>   <hr>_______________________________________________<br><br/>mpeg-otspec mailing list<br><br/><span class="wt_Email">mpeg-otspec@lists.aau.at</span><span></span><br><br/><a href="https://lists.aau.at/mailman/listinfo/mpeg-otspec" target="_blank">https://lists.aau.at/mailman/listinfo/mpeg-otspec</a><br><br/></blockquote></div></body></html>