Giant size font characters work in Caps, fail to render some characters in app?

Low priority: this probably won't often matter!

I made three really big fonts of 240 character height for my clocks app. Big characters, not all that big in total.

Their character widths are 93, 108, and 190. Only 16 characters in each (including space and <?>. And only 12 in the largest one.

The fonts all work fine in Caps—but the widest one (190x240) fails in my app (Mac Simulator): no errors, but only the first 6 characters in the table will render with drawText. (The digits 0 through 5.) The remaining characters render as blank. I'm simply doing drawText directly to the screen.

The other two fonts work completely.

The failing font's 4x3 image table is 760x720 px. (The next-biggest font, which works, has a 4x4 table of 432x720.)

Between those sizes, I wonder if there's some hard-coded limit, on either the width or the the total memory of a font's bitmap?

I'm already all set for my use case—loading the same PNG as an image or as an imagetable works fine, so I am just doing it that way instead of as a font.

But I thought I'd report this in case there's a font limit that isn't intentional.

I can supply the font if useful. (Separate .fnt and .png.)

We'll look into it, thanks!

1 Like

I'm pretty sure the problem is our font pages use 16 bit values in the offset table.. In retrospect, saving 2 bytes per character probably wasn't worth it. :confused: But also this seems like a case where using image tables makes a lot more sense.

I'll think about whether it's worth the trouble to add a flag in the struct to signal 32 bit offsets (I'm leaning towards no) but we definitely need to add a compiler error there if the font data can't actually fit in the struct.

I vote: keep it as is, show an error maybe, and use your time elsewhere :slight_smile: This is an edge case that devs can work around.... depending on where the limit falls in practice. Maybe a "big font" much smaller than mine—like for a scrolling banner—could fail if it had a full character set? My font is only the digits.