V4 - TextStyle `font` VS `fontFamily`
See original GitHub issueHello guys, well done with V4 release! Looks like migration from V3 is going to be pretty straightforward and I’m looking forward to check performance 😃
There’s one thing tho I’m not really sure about. It might be a stupid question, but…
Shall I use font or fontFamilyfor TextStyle?
According to DOCUMENTATION-TextStyle:
font
Set all properties of a font as a single string
Deprecated - since version 4.0.0
And fontFamily is there.
On the other hand, also from DOCUMENTATION-Text:
A Text can be created directly from a string and a style object
var text = new PIXI.Text('This is a pixi text',{font : '24px Arial', fill : 0xff1010, align : 'center'});
So this guy is still using font and wait, there’s more:
V4 Text example is also using font.
I’m really puzzled by how does it work with font… I was even checking Text.js sources and it seems like it never uses style.font but it’s combining it like this._font = style.fontStyle + ' ' + style.fontVariant + ' ' + style.fontWeight + ' ' + fontSizeString + ' ' + style.fontFamily;
So what kind of sorcery is that? And which one should be used?
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)

Top Related StackOverflow Question
Cool, thanks for your help @SlawomirMazgaj
Sorted. Thanks @SlawomirMazgaj!