Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A similar problem was discussed at <a href="https://stackoverflow.com/questions/5414730/custom-installed-font-not-displayed-correctly-in-uilabel">Custom installed font not displayed correctly in UILabel</a>. There was no solution given.</p> <p>Here's the solution that worked for my custom font which had the same issue in UILabel, UIButton and such. The problem with the font turned out to be the fact that its ascender property was too small compared to the value of system fonts. Ascender is a vertical whitespace above font's characters. To fix your font you will have to download <a href="https://developer.apple.com/download/more/?=font" rel="noreferrer">Apple Font Tool Suite</a> command line utilities. Then take your font and do the following:</p> <pre><code>~$ ftxdumperfuser -t hhea -A d Bold.ttf </code></pre> <p>This will create <code>Bold.hhea.xml</code>. Open it with a text editor and increase the value of <code>ascender</code> attribute. You will have to experiment a little to find out the exact value that works best for you. In my case I changed it from 750 to 1200. Then run the utility again with the following command line to merge your changes back into the ttf file:</p> <pre><code>~$ ftxdumperfuser -t hhea -A f Bold.ttf </code></pre> <p>Then just use the resulting ttf font in your app.</p> <p><strong>OS X El Capitan</strong></p> <p>The Apple Font Tool Suite Installer doesn't work anymore on OSX El Capitan because of <a href="https://en.wikipedia.org/wiki/System_Integrity_Protection" rel="noreferrer">SIP</a> because it tries to install the binary files into a protected directory. You have to manually extract <code>ftxdumperfuser</code>. First copy the pkg from the dmg to a local directory afterwards unpack the <code>OS X Font Tools.pkg</code> with</p> <pre><code>~$ xar -xf OS\ X\ Font\ Tools.pkg </code></pre> <p>Now navigate into the folder <code>fontTools.pkg</code> with</p> <pre><code>~$ cd fontTools.pkg/ </code></pre> <p>Extract payload with </p> <pre><code>~$ cat Payload | gunzip -dc | cpio -i </code></pre> <p>Now the <code>ftxdumperfuser</code> binary is in your current folder. You could move it to <code>/usr/local/bin/</code> so that you can use it in every folder inside of the terminal application with the following.</p> <pre><code>~$ mv ftxdumperfuser /usr/local/bin/ </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload