I get failures reading the Name of a Font object on iOS.
The Size property works for me.
Code like this:
if (RealbasicVersion() >= 2020)
{
REALobject font = nil;
if (REALGetPropValueObject(o, "Font", &font))
{
FreeLater(font);
if (REALGetPropValueString(font, "Name", &TextFont))
{
// okay
return TextFont;
}
else
{
DebugMessage("Failed to query Name property of font.", font);
}
}
else
{
DebugMessage("Failed to query font property");
}
}
So we get font property from Graphics on iOS and query name. Name fails for some unknown reason.
@William_Yu, you have an idea?
DerkJ
(DerkJ)
2
Maybe you need the graphics.Font as string?
Not sure if font is supported on ios.
https://documentation.xojo.com/api/graphics/graphics.html#graphics-fontName
There is no FontName for iOS.
But a Font property and that doesn’t have a name for some reason.
1 Like
DerkJ
(DerkJ)
4
It seems there is missing a crucial part in ios then.
William_Yu
(William Yu)
5
Yes, apparently Graphics.Font is returning an iOSFont object instead, we’ll get that fixed.
<https://xojo.com/issue/62908>
But there is iOSFont and Font. Both have a name property, but I can’t get it!?
William_Yu
(William Yu)
7
Yes but for iOSFont the Name is of type Text (so you would need to use REALGetPropValueText) while for Font it is a String.
Thanks. REALGetPropValueText seems to work, but looks like I currently can’t change the font on graphics as I can only assign Font, not iOSFont.