iOS Question B4I/iOS unable to render custom fonts correctly (Gotham-Medium and Gotham-Book)

ema01

Member
Licensed User
Longtime User
Hello,
i'm trying to port one app from android to iOS. The app on Android runs just fine.
In the iOS App i can't manage dialogs to work reliably: text disappear, height after sizetofit is set to zero and i have narrowed down the issue to the fonts i'm using in the app, because if i use another font (builtin or custom) the problem goes away.

I'm using two variants of the Gotham Font, Medium and Book, obtained from FreeFontsFamily. I have tried to look for alternatives on the net but they are always the same files so the problem is always the same.

In my application i get this log entry when the font is applied to some of labels, though all have problems in rendering (I have a routine for setting the font size based on label height/width and the height result is always wrong, measuring text dimension with the string MeasureHeight method always return zero for the height, regardless of font size.)

B4X:
!!! _NSLayoutTreeGetBaselineOffsetForGlyphAtIndex invalid glyph index 18446744073709551615
I don't know what glyph index 0xFFFFFFFFFFFFFFFF corresponds to.

I have made a small project that should exhibit part of the issue, when the multiline label gets assigned the gotham font the lines overlap.
Looking for pointers, other than "change the font" i would have no problem but you know how graphic designers are, they get fixated over these things (and i DO need to use gotham for another project as well because a lot of the ads and everything use gotham and the designers don't have issues)
 

Attachments

  • FontTest.zip
    57.5 KB · Views: 104

ema01

Member
Licensed User
Longtime User
Hi Erel,
I actually never noticed issues with AutoScaleAll, but that's probably because i resize the fonts on my own in code

I had no doubt it was an issue of the font file itself, because searching for "gotham ios" brings up a number of hits of people having the same kind of issues, applications and apps working on other platforms that won't render text if this particular font is used.
Guess i'll have to find a similar looking font but it would be interesting to dive into this problem and find out if it can be solved. It baffles me that nobody did that, and i don't want to risk wasting money buying this font on a store just to find out it's the same file i got for free

Aniway, thanks for confirming it's not just me
 
Upvote 0
Top