[JW Lua] Opening a .suit font file on MacOS doesn't work, ttf and otf works
Jan Angermüller
jan at angermueller.com
Fri Jan 18 17:56:36 CET 2019
Jari et al,
I am finally converting my Perfect Layout plug-in to MacOS
(here a first preview: https://www.youtube.com/watch?v=vFUpFmfAGMk ).
The plug-in includes a tool for reading fonts and their metrics.
Unfortunately there seems to be a weird problem with .suit font files on
MacOS.
They seem to be not readable through io.open.
.ttf and .otf works fine, but opening .suit simply returns an empty string.
Any ideas on this? I don't have much MacOS insider experience, so any
help is appreciated.
Does it have to do with how MacOS handles some resources that are
actually containers/wrappers for other files?
Here is my test code:
|localinput
=assert(io.open("/Library/Fonts/Tahoma.ttf","rb"))localdata=input:read("*all")print(string.byte(data,1))--prints
the correct value 0io.close(input)localinput
=assert(io.open("/Library/Fonts/Maestro.suit","rb"))localdata=input:read("*all")print(string.byte(data,1))--prints
nothing, but value 0 would have been expected io.close(input)|
When I extract the Maestro.ttf font that is included in Maestro.suit and
run the code directly on Maestro.ttf, it also works fine.
Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20190118/6cb1d04e/attachment.htm>
More information about the JWLua
mailing list