"Fix Vertical Position Issue of Custom iOS Fonts" Code Answer's
You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "Fix Vertical Position Issue of Custom iOS Fonts" answered properly. Developers are finding an appropriate answer about Fix Vertical Position Issue of Custom iOS Fonts related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like Fix Vertical Position Issue of Custom iOS Fonts. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on Fix Vertical Position Issue of Custom iOS Fonts.
Fix Vertical Position Issue of Custom iOS Fonts
So this is a modified version of kolyuchiy's answer.
I opened my font with Glyphs, and then exported it without modifying anything. Somehow, magically, the vertical alignment issue was gone!
What's better is that the new font plays nicely with methods like sizeWithFont:, so it doesn't have the issues mentioned by Joshua.
Fix Vertical Position Issue of Custom iOS Fonts
A similar problem was discussed at Custom installed font not displayed correctly in UILabel. There was no solution given.
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 Apple Font Tool Suite command line utilities. Then take your font and do the following:
~$ ftxdumperfuser -t hhea -A d Bold.ttf
This will create Bold.hhea.xml. Open it with a text editor and increase the value of ascender 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:
~$ ftxdumperfuser -t hhea -A f Bold.ttf
Then just use the resulting ttf font in your app.
OS X El Capitan
The Apple Font Tool Suite Installer doesn't work anymore on OSX El Capitan because of SIP because it tries to install the binary files into a protected directory. You have to manually extract ftxdumperfuser. First copy the pkg from the dmg to a local directory afterwards unpack the OS X Font Tools.pkg with
~$ xar -xf OS\ X\ Font\ Tools.pkg
Now navigate into the folder fontTools.pkg with
~$ cd fontTools.pkg/
Extract payload with
~$ cat Payload | gunzip -dc | cpio -i
Now the ftxdumperfuser binary is in your current folder. You could move it to /usr/local/bin/ so that you can use it in every folder inside of the terminal application with the following.
~$ mv ftxdumperfuser /usr/local/bin/
All those coders who are working on the Whatever based application and are stuck on Fix Vertical Position Issue of Custom iOS Fonts can get a collection of related answers to their query. Programmers need to enter their query on Fix Vertical Position Issue of Custom iOS Fonts related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about Fix Vertical Position Issue of Custom iOS Fonts for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of Fix Vertical Position Issue of Custom iOS Fonts while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "Fix Vertical Position Issue of Custom iOS Fonts". Visit this developer's friendly online web community, CodeProZone, and get your queries like Fix Vertical Position Issue of Custom iOS Fonts resolved professionally and stay updated to the latest Whatever updates.