<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Found the solution. Although .suit doesn't look like a folder, it
    can be addressed like a folder.<br>
    I.e. to open the font in included in Maestro.suit, I must use:<br>
    <span class="comment-copy"> local
      file=io.open("/Library/Fonts/Maestro.suit/..namedfork/rsrc")<br>
      <br>
      (see
<a class="moz-txt-link-freetext" href="https://apple.stackexchange.com/questions/8455/how-do-i-convert-a-suitcase-font">https://apple.stackexchange.com/questions/8455/how-do-i-convert-a-suitcase-font</a>
      )<br>
    </span><br>
    <div class="moz-cite-prefix">Am 1/18/2019 um 5:56 PM schrieb Jan
      Angermüller:<br>
    </div>
    <blockquote type="cite"
      cite="mid:fc1ef630-b39b-72ba-06a5-4928354ba945@angermueller.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      Jari et al,<br>
      <br>
      I am finally converting my Perfect Layout plug-in to MacOS<br>
      (here a first preview: <a class="moz-txt-link-freetext"
        href="https://www.youtube.com/watch?v=vFUpFmfAGMk"
        moz-do-not-send="true">https://www.youtube.com/watch?v=vFUpFmfAGMk</a>
      ).<br>
      <br>
      The plug-in includes a tool for reading fonts and their metrics.<br>
      Unfortunately there seems to be a weird problem with .suit font
      files on MacOS.<br>
      They seem to be not readable through io.open.<br>
      .ttf and .otf works fine, but opening .suit simply returns an
      empty string.<br>
      <br>
      Any ideas on this? I don't have much MacOS insider experience, so
      any help is appreciated.<br>
      Does it have to do with how MacOS handles some resources that are
      actually containers/wrappers for other files?<br>
      <br>
      Here is my test code:<br>
      <pre class="lang-lua prettyprint prettyprinted" style=""><code><span class="kwd">local</span><span class="pln"> input </span><span class="pun">=</span><span class="pln"> assert</span><span class="pun">(</span><span class="pln">io</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">"/Library/Fonts/Tahoma.ttf"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"rb"</span><span class="pun">))</span><span class="pln">
</span><span class="kwd">local</span><span class="pln"> data</span><span class="pun">=</span><span class="pln">input</span><span class="pun">:</span><span class="pln">read</span><span class="pun">(</span><span class="str">"*all"</span><span class="pun">)</span><span class="pln">
print</span><span class="pun">(</span><span class="pln">string</span><span class="pun">.</span><span class="pln">byte</span><span class="pun">(</span><span class="pln">data</span><span class="pun">,</span><span class="lit">1</span><span class="pun">))</span><span class="pln"> </span><span class="com">--prints the correct value 0</span><span class="pln">
io</span><span class="pun">.</span><span class="pln">close</span><span class="pun">(</span><span class="pln">input</span><span class="pun">)</span><span class="pln">

</span><span class="kwd">local</span><span class="pln"> input </span><span class="pun">=</span><span class="pln"> assert</span><span class="pun">(</span><span class="pln">io</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">"/Library/Fonts/Maestro.suit"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"rb"</span><span class="pun">))</span><span class="pln">
</span><span class="kwd">local</span><span class="pln"> data</span><span class="pun">=</span><span class="pln">input</span><span class="pun">:</span><span class="pln">read</span><span class="pun">(</span><span class="str">"*all"</span><span class="pun">)</span><span class="pln">
print</span><span class="pun">(</span><span class="pln">string</span><span class="pun">.</span><span class="pln">byte</span><span class="pun">(</span><span class="pln">data</span><span class="pun">,</span><span class="lit">1</span><span class="pun">))</span><span class="pln">  </span><span class="com">--prints nothing, but value 0 </span><span class="pln">would have been expected
io</span><span class="pun">.</span><span class="pln">close</span><span class="pun">(</span><span class="pln">input</span><span class="pun">)</span><span class="pln">  </span></code></pre>
      <br>
      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.<br>
      <br>
      Jan<br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
JWLua mailing list
<a class="moz-txt-link-abbreviated" href="mailto:JWLua@jwmusic.nu">JWLua@jwmusic.nu</a>
<a class="moz-txt-link-freetext" href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>