Skip to content

Conversation

pnstickne
Copy link
Contributor

There is a breaking change in that the fontWeight now only handles the CSS font-weight component. The fontStyle property handles 'italic', 'oblique', values from font-style. This makes the overall consistency cleaner but some code may need to be updated. This does not affect font-weight/font-style as with setStyle({font:..}).

Fulfills wish: #1370

Also fixes overwrite font/size/weight oddities - which may result in different behavior for code that was relying on such. All of the text examples appear to work and modification using the new features (while respecting the change in previous behavior) work better.

Fulfills: phaserjs#1370

This allows `fontSize` and `fontWeight` to be specified as part of the
style as supplied to the Text constructor (and `setStyle` method). In
addition the `fontStyle` and `fontVariant` properties can also be set -
although these are not exposed later.

This also fixes edge cases that could be caused if `Text#fontSize` was
used without `Text#fontWeight`, where the applied style defaults would be
overwritten/reset.
Added `cssFont`, `fontStyle`, and `fontVariant` properties for better
consistency and control.
Some minor cleanup of font component handling and comments.

Also adds a warning if an "unparsable font" string is encountered. Might
save someone some trouble.
@photonstorm photonstorm modified the milestone: 2.3.0 Jan 5, 2015
photonstorm added a commit that referenced this pull request Feb 11, 2015
Text - font components can be specified as part of "style"
@photonstorm photonstorm merged commit b560af9 into phaserjs:dev Feb 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants