freetype-devel
[Top][All Lists]
Advanced

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

'post' table format 2.0 : typo in the computation of names count ? "Re:


From: Hin-Tak Leung
Subject: 'post' table format 2.0 : typo in the computation of names count ? "Re: Freetype-devel Digest, Vol 180, Issue 4"
Date: Fri, 10 Jan 2020 18:03:34 +0000 (UTC)

> Date: Thu, 9 Jan 2020 23:14:04 +0100
> From: Vincent Torri <address@hidden>
> To: freetype-devel <address@hidden>
> Subject: 'post' table format 2.0 : typo in the computation of names
>    count ?

> Hello

> in opentype spec :

> https://docs.microsoft.com/en-us/typography/opentype/spec/post#version-20

> it is said that :

> "If the name index is between 258 and 65535, then subtract 258"

> but in src/sfnt/ttpost.c line 219, 257 is substracted. Is it normal ?

> thank you

> Vincent Torri

That subtract 257 line was in the initial Freetype 2.0 commit, and been there for 20+ years so it is likely correct. That said, it has to mean that idx=0 is special... I think it is there because Freetype internally makes up idx=0 = .notdef if it is not there? You probably want to read freetype 1 change log to find out why it is -257 and not -258 :-).

Hmm, I think you don't understand that particular bits of code. If you read how it is used, "index" is used for allocating an array to store the whole array. Hence it needs to be one bigger than the largest index.

reply via email to

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