iOSFont.SystemFont and iOSFont.SystemFontSize Correct?

According to the docs, iOSFont.SystemFontSize returns the size of the system font and iOSFont.SystemFont without any parameters returns the default font in the default size. On my system, both methods return a font of size 14 px.

The problem is, to my eye this font size is smaller than the default font size used by other apps and it doesn’t match the font size used in Xojo’s iOSTable (which cannot be changed). According to the Apple HIG, the default system font size is actually 17 px.

I know that it’s possible to set the font size specifically (i.e. hard code it), but this negates one of the features of iOS8 which allows the user to choose their own default font size. So I’d prefer to use the SystemFontSize and SystemFont methods.

Has anyone else noticed this and how have you worked around it? Worth a Feedback report?

[quote=176741:@Jason Tait]According to the docs, iOSFont.SystemFontSize returns the size of the system font and iOSFont.SystemFont without any parameters returns the default font in the default size. On my system, both methods return a font of size 14 px.

The problem is, to my eye this font size is smaller than the default font size used by other apps and it doesn’t match the font size used in Xojo’s iOSTable (which cannot be changed). According to the Apple HIG, the default system font size is actually 17 px.

I know that it’s possible to set the font size specifically (i.e. hard code it), but this negates one of the features of iOS8 which allows the user to choose their own default font size. So I’d prefer to use the SystemFontSize and SystemFont methods.

Has anyone else noticed this and how have you worked around it? Worth a Feedback report?[/quote]

Have you tried to place two controls on the same view, one with system zero, the other with system 14 ? You could verify if it is indeed consistant or if the default is smaller. Otherwise, not to break the user choices while applying some correction, you could probably do something like fontsize*ratio in the control open event.

Here’s a comparison.

The code for the first label is:

me.TextFont = iOSFont.SystemFont me.Text = "System font, size: " + iosFont.SystemFontSize.ToText

The code for the second label is:

me.TextFont = iOSFont.SystemFont(17) me.Text = "Hard-coded font, size: 17"

And, for comparison, here’s the iOS Calendar app in the simulator:

Looks like what the system reports is accurate. Something like (pseudo code)
control fontsize = round(fontsize*1.21)
are to correct it. You could do that through all the controls at once upon opening the view by iterating through View.Control()

What I’m wondering is whether iOSFont.SystemFontSize should return 14. Shouldn’t it be 17?

From what I see on the screen, it is indeed 14, and it should certainly not return 17. Then why system zero does 14 and not 17 rests on the lap of Xojo engineers…

That’s what I mean Michel. I guess my point was a bit lost in translation. :slight_smile:

<https://xojo.com/issue/38750>