-
Notifications
You must be signed in to change notification settings - Fork 21
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
Clarify whether STAT Format 2 Axis Value Ranges are inclusive or exclusive #466
Comments
I think it’s clear from the spec that Format 2 is inclusive:
This makes sense, otherwise a range intended to include the axis max would be inconvenient to define. What seems to be missed by the spec is that contiguous ranges (which are of course common) have zero overlap in continuous maths but greater than zero overlap in the discrete maths of 16.16 numbers. As I mentioned in the other issue, the spec’s:
… is frequently violated, but a careful reading of the “error handling” (where T1 and T2 are named confusingly in the non-intuitive order!):
… leads to the higher range being used, thus 500 triggers the 500-600 range in the example in the original post. I would recommend improving the STAT Format 2 spec to clarify how contiguous ranges are handled, and improve the phrasing of the general handling of overlapping ranges. BTW I am surprised that axisValueTable records can be in any order. This would seem to make life harder for implementors. |
The spec’s wording for overlapping ranges is a bit confusing, since it isn’t clear whether touching ranges are considered overlapping. Also, if overlapping ranges aren’t allowed, why are there rules for what to do if the ranges do overlap? Perhaps consider replacing:
by something like:
Question: Would a font designer/producer want a different string just for the point at which the ranges touch? That is, use one string for the first range, use another string for the touching range, but use yet another for just the point at which the ranges touch? Are there compelling examples for this? Note: If we did want that kind of ability, one way we could do it would be to allow for a format 2 just for that one point, e.g. {750, 750–750} and rework the rules to allow for that. Or we could have a format 1 just for that point and rework things. |
Good rewrite. Forbidding overlaps apart from touching overlaps is a good move. I can think of a compelling case where we would want want a different string just for the point at which the ranges touch. Consider a font with a {-12, -12–0} // name = "Oblique" As you imply, the Upright range would be better represented as a format 1. I would suggest that format 1 and format 3 records take precedence over format 2 records. |
(Who wrote that confusing text?) I think the intent of that text might have been what to do in the event that a font failed to follow the recommendation and did have two tables with overlapping ranges. (Something that's strange, though, is that the wording in the first bullet point seems to make it encompasses the case described in the second bullet point. Makes me wonder if the original intent for the first bullet point was something different.) |
I strongly suspect that, in this bullet point
that |
Here's my proposed changes for the next version:
|
Btw, re this from Sairus' proposed text:
I wasn't sure whether this was intended in the sense of "it MUST be that at most one..." I went with "should" wording so as not to assert fonts that don't follow this are invalid, and then adjusted the following two bullets so that the guidance still covers the case of a font that doesn't follow the recommendation. |
Thanks, Peter,
Let me know what you think. I’m not totally against the “should” language, so (3) is probably the most important point here. |
The intent of format 4 was not as a (less efficient) format 1. So, the spec can be clear that it is not to be used that way. Per review feedback, adding the following after the description of format 4:
|
Why is this necessary? Whatever the intent, when a flexible representation is a natural superset of a simpler one, why forbid it from acting as the simple one? In general, such a facility is useful and meaningful, and can lead to better UI. |
This reflects the design intent and that the definition of format 4 makes it a superset of format 1 (and only 1). How is it useful to have two ways to express the same thing? How can it be more meaningful or lead to better UI? |
It probably makes little difference in this case, but in general it seems not to be useful to have such restrictions. One might prohibit many representations that have other supposedly more efficent or more normative forms (e.g. no collocated outline points, no lookups that are not used by features, no glyphs with uncompressed flags), which are at worst harmless and at best useful for performance or other reasons. |
Fair enough: relaxing "must" to "should". |
I'm reviewing to make sure Laurence's use case is accommodated involving two contiguous ranges but with a distinct name for the point at which the ranges meet. As a partial fix, adding this in the discussion of format 2 after the first two bullet points in the revision I gave 26 days ago:
|
And I've revised wording in an earlier portion that has been revised for issue #576: the first bullet in the proposed revision for that issue is split into two, as follows:
|
The spec does not clarify whether Format 2 Axis Value ranges are inclusive or exclusive. This affects the discussion of overlapping ranges because if we assume inclusive then, for example, ranges
400-500
and500-600
overlap, but if we assume exclusive then these do not overlap. Also, if ranges are exclusive then a nominal value that matches the max value would be invalid. Some discussion related to this is at Lorp/samsa#46Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: