[MPEG-OTSPEC] SHORT vs int16 vs ???

Behdad Esfahbod behdad at behdad.org
Fri Aug 14 23:59:32 CEST 2020


On Fri, Aug 14, 2020 at 2:57 PM Dave Crossland <dcrossland at google.com>
wrote:

> On Fri, Aug 14, 2020 at 4:31 PM Behdad Esfahbod <behdad at behdad.org> wrote:
>
>> On Fri, Aug 14, 2020 at 2:19 PM Dave Crossland <dcrossland at google.com>
>> wrote:
>>
>>> On Fri, Aug 14, 2020 at 1:36 PM Behdad Esfahbod <behdad at behdad.org>
>>> wrote:
>>>
>>>> On Fri, Aug 14, 2020 at 7:40 AM Eric Muller <eric.muller at efele.net>
>>>> wrote:
>>>>
>>>>> At the same time, the names of structures in OpenType tables end up in
>>>>> code, documentation, tools' UI, discussions on this list, our heads, etc..
>>>>> Changing them every two months is not going to help. I would prefer such
>>>>> changes to occur infrequently, may be accumulating them in a backlog in the
>>>>> mean time.
>>>>>
>>>>
>>>> Not just that: Peter's unilateral renaming was a disservice to the
>>>> specification: he replaced the obscure-looking "SHORT", "USHORT", "LONG",
>>>> "ULONG", with common words "int16", "uint16", "int32", "uint32", even
>>>> though those do not match the similarly-named types in computers and
>>>> languages, because the OpenType ones are always big-endian.  If he had
>>>> consulted others, we could have reached a universally-unambiguous and clear
>>>> names.
>>>>
>>>
>>> What alternatives do you propose, Behdad, Peter, Eric, anyone? :)
>>>
>>
>> BEInt16, BigInt16, ..
>>
>> I know matches my initial, but not what I suggest. :-)
>>
>
> Humm.
>
> https://www.google.com/search?q=%22BEInt16%22+%22BigInt16%22 0 results
>
> https://www.google.com/search?q=%22BEInt16%22
> <https://www.google.com/search?q=%22BEInt16%22+%22BigInt16%22> 232 results
>
> https://www.google.com/search?q=%22BigInt16%22
> <https://www.google.com/search?q=%22BEInt16%22+%22BigInt16%22> 22 results
>

That's good! That's the point! To make it clear these are types defined by
the spec, not widely-understood types.

C++ seems to be adopting int16_be_t etc naming, but even that I can't
verify quickly using Google search.


> Common words "int16", "uint16", "int32", "uint32", plus a prominent notice
> to remember that these are always big-endian, seems more pleasant to read
> to me, than these obscure but accurate terms.
>

We are not talking about a literary novel. We are talking about a technical
specification. Precision is of utmost important.

Back to the original topic: the renaming was unjustified. The old names
(USHORT etc) are reflect in a lot of software as Eric pointed out. They are
in FontTools. In HarfBuzz we had to rename from those; we went with INT16,
etc; but we had to rename again. Both times because MS headers use those
names to mean something different!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.aau.at/pipermail/mpeg-otspec/attachments/20200814/ccdf9faa/attachment.html>


More information about the mpeg-otspec mailing list