freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Major bug with varfonts named instances when avar table p


From: Behdad Esfahbod
Subject: Re: [ft-devel] Major bug with varfonts named instances when avar table present
Date: Tue, 1 Aug 2017 12:22:54 +0100

On Tue, Aug 1, 2017 at 11:31 AM, Werner LEMBERG <address@hidden> wrote:
>> This is not necessary, AFAICS.  `psid' defaults to zero (this happens
>> during allocation of the structure), which isn't a valid value.  I've
>> documented that properly.
>
> Humm??  Nameid zero is very valid...

No, it's not, see below.

No.  Nameid zero is valid.  Read the name table spec.
 
What you mean is, it's not valid in this context.


> I see you changed it to 0xFFFFFFFF though.  I still like my patch
> better.  If postScriptNameID is available in fvar table but some
> entries miss it, they will report 0xFFFF.  So, you either should
> convert those to 0xFFFFFFFF as well, or just do what my patch did.

I was confused.  Will change this.

> Also, your patch says only namdID 6, ... valid.  That's also wrong.

???  I see the following in
https://www.microsoft.com/typography/otspec/delta181to182/fvar.htm:

I'll ask Peter to remove it.  Just because the spec says so, doesn't mean fonts wouldn't do otherwise.

My point is: nameid 0 is a valid nameid.  By using 0 to mean "not set" in this context, you are requiring all clients of this particular API (fvar) to check for nameid==0 and call that invalid.  In reality, most will forget and just pass it to the name table and get the copyright notice back.  Just use 0xFFFF which is used for this purpose all across the spec.

 

  The postScriptNameID field provides a name ID that can be used to
  obtain strings from the 'name' table that can be treated as
  equivalent to name ID 6 (PostScript name) strings for the given
  instance.  Values of 6 and 0xFFFF can be used; otherwise, values
  must be greater than 255 and less than 32768.  If the value is
  0xFFFF, then the value is ignored, and no PostScript name equivalent
  is provided for the instance.  The value 6 should only be used if
  the named instance corresponds to the font's default instance.


    Werner



--

reply via email to

[Prev in Thread] Current Thread [Next in Thread]