Jéluchu
Jéluchu

Reputation: 494

SwiftUI does not display custom fonts correctly

I have included the typography I wanted in the assets, as well as including it in "Info" in the "Fonts provided by application" area, the problem comes when I show the text with the custom typography, as there are some letters that are shown cut as in this image that the letter "g" is not shown complete.

I know it is not a typography error because I have used it in other places outside the app and these letters are displayed correctly, so I don't know what I have to do in SwiftUI to adjust it correctly.

enter image description here

Upvotes: 1

Views: 672

Answers (1)

Jéluchu
Jéluchu

Reputation: 494

  1. Download: https://developer.apple.com/download/all/?q=font

  2. Go to the folder where the saved typeface is located

  3. First this in terminal: ftxdumperfuser -t hhea -A d YOUR_FONT.ttf generate an xml, open it and edit the field descend, in case it is the upper part you edit ascend

  4. Then you go back to the terminal and type in ftxdumperfuser -t hhea -A f YOUR_FONT.ttf, delete the generated xml and compile the app

This works for all typography, so for the Navigate Title it will also work

enter image description here

Upvotes: 4

Related Questions