On Tue, 31 May 2022 23:39:09 GMT, Nikita Gubarkov <d...@openjdk.java.net> wrote:

> `CTFontCopyAvailableTables` can return null, which causes subsequent call to 
> `CFArrayGetCount` to crash with SEGFAULT, just added a null-check.

It looks for a "maxp" table which is absent for this font.

Are you sure ? I know that is what we are looking for but we call an API to get 
all tables without
specifying any particular table so maOS doesn't know ... 

And that is a REQUIRED table per opentype + apple truetype
https://docs.microsoft.com/en-us/typography/opentype/spec/otff#font-tables
https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6.html
In shared code we throw an exception if we don't find it and you'd see this if 
you used the dynamic font loading APIs
and if it were installed on Windows or Linux we'd ignore the font.
I'm a bit surprised we get this far on mac without it - or that it isn't 
rejected by virtually every app.

Of course getTableBytesNative isn't guaranteed to return a table because you 
could ask for the 'abcd' table .. 
But that macOS API didn't ask for a specific table, it just returned null for 
ALL tables because  .... ? 
Seems to me that there's at the least a macOS documentation deficiency but I'm 
not sure you've found the answer
to my question.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8962

Reply via email to