[MPEG-OTSPEC] Rules for cubic bits in glyf flags include undefined behaviour for some configurations

Liam R. E. Quin liam at fromoldbooks.org
Wed Oct 4 02:09:50 CEST 2023


On Tue, 2023-10-03 at 17:05 -0600, Bob Hallissy wrote:
> 
> On 9/23/2023 1:02 PM, Laurence Penney wrote:
> > 
> > All the off-curve points between two on-curve points (with wrap-
> > around) must either
> > have the CUBIC flag clear, or have the CUBIC flag set.
> 
>  I find the above ambiguous 

Yes, i did too, and reworded it. Thanks!  This is what i have right now
in the draft for the next version i'll be posting in a few days:

[[

     
If the CUBIC flag is non-zero, the corresponding off-curve point
belongs to a Cubic Bézier path segment, and all of the following
conditions shall be met:

 * 
   The number of consecutive cubic
   off-curve points within a contour (without wrap-around) is even.
 * 
   Either all the off-curve points
   between any two on-curve points (with wrap-around) have the CUBIC
   flag clear, or they all have the CUBIC flag set.
 * 
   The
   CUBIC flag
   shall
   only
   be set
   to 1
   on off-curve points. For on-curve points it is reserved and shall be
   set to zero.
Every consecutive two off-curve points that have the CUBIC bit set
define a cubic Bézier segment. Within any consecutive set of cubic off-
curve points within a contour (with wrap-around), an implied on-curve
point is inserted by the font processor at the mid-point between every
second off-curve point and the next one.

If there are no on-curve points and all (even number of) off-curve
points are CUBIC, the first off-curve point shall be considered the
first control-point of a cubic Bézier curve, and the font processor
shall insert implied on-curve points between the every second point and
the next one as usual.

]]

I don't want to share the whole text yet, because it's not consistent;
the previous version is at
https://github.com/harfbuzz/boring-expansion-spec/tree/main/iso_docs
under September.
Here's the previous version:

[[
There are several restrictions on how the CUBIC flag can be used. If
any of the conditions below are not met, the behavior is undefined.
 * The number of consecutive cubic off-curve points within a contour
   (without wrap-around) is even.
 * Either all the off-curve points between any two on-curve points
   (with
   wrap-around) have the CUBIC flag clear, or they all have the CUBIC
   flag set.
 * The CUBIC **flag **shall only be set to 1 on off-curve
   points. It is reserved and must be set to zero for on-curve
   points.

> ]]

(pasted from the markdown, which has some minor formatting problems i
see)

As we discuss what the behaviour should actually be when those three
conditions are not met, i'll update the text.

liam

-- 
Liam Quin, https://www.delightfulcomputing.com/ Available for
XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text
Processing/A11Y training, work & consulting. Barefoot Web-slave,
antique illustrations:  http://www.fromoldbooks.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.aau.at/pipermail/mpeg-otspec/attachments/20231003/efaba612/attachment-0001.html>


More information about the mpeg-otspec mailing list