> Date: Thu, 9 Jan 2020 23:14:04 +0100 > From: Vincent Torri <vincent.to...@gmail.com> > To: freetype-devel <freetype-devel@nongnu.org> > 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.