trueinteractions/tint2

Bold default TextInput font

Closed this issue · 4 comments

mrkev commented

I'm trying to bold the default font of a read-only TextInput using

text.font.bold = true;

this however throws an AssertionError:

AssertionError: A family name was not passed in for the font.

I can't even get the default system font. If I do

console.log(text.font);

I get the same AssertionError. How can I make a TextInput with the default system font, but bolded?

@mrkev Ah, good point. By default it doesn't request the font from the system if one has not yet been assigned.

A workaround is to assign your own font:

var font = new Font('Arial', 13);
font.bold = true;
text.font = font;

I'll take a look at what we can do to fix this in the next release.

mrkev commented

Ah ok, thanks!

Thanks for filing this issue, we really do appreciate you reporting this.
The workaround is no longer necessary, this will be released with 2.2.5 due next Monday (1/4/2016).
Feel free to reopen if you continue to have issues.

mrkev commented

Perfect, thanks!