Closed algrid closed 5 years ago
@algrid tryfont="{TITLE_FONT}"
instead.
@nicklockwood Tried that, I'm getting "Unexpected token 13
in font expression in UILabel...".
When I use Roboto-Medium 13
directly it works fine.
@algrid hmm, I'll look into that. It will probably work if you do:
<macro name="TITLE_W" value="66%"/>
<macro name="TITLE_FONT" value="Roboto-Medium"/>
<macro name="TITLE_FONT_SIZE" value="13"/>
<UILabel
top="previous.bottom + 12"
left="parent.left"
width="TITLE_W"
font="{TITLE_FONT} {TITLE_FONT_SIZE}"
text="some text"/>
@nicklockwood This time I get:
Maybe it's interpreting that dash as a minus sign and trying to calculate it...
It's not critical for me now, just wanted to report it :)
@algrid ah, I think I see the problem. It's interpreting Roboto-Medium 13
as an expression, not a string. try:
<macro name="TITLE_W" value="66%"/>
<macro name="TITLE_FONT" value="'Roboto-Medium 13'"/>
<UILabel
top="previous.bottom + 12"
left="parent.left"
width="TITLE_W"
font="{TITLE_FONT}"
text="some text"/>
(Note the single ' ' quotes around 'Roboto-Medium 13')
@nicklockwood
Works like this:
<macro name="TITLE_W" value="66%"/>
<macro name="TITLE_FONT" value="'Roboto-Medium 13'"/>
<UILabel
top="previous.bottom + 12"
left="parent.left"
width="TITLE_W"
font="{TITLE_FONT}"
text="some text"/>
Thanks!
Hello,
I'm trying to use a macro for a
UILabel
font like this:It works fine with the
TITLE_W
but forTITLE_FONT
I get:It would be nice to have this feature supported.