ericdrowell / KineticJS

KineticJS is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
http://www.kineticjs.com
3.98k stars 752 forks source link

Using bold AND italic on Text #976

Open bgaillard opened 10 years ago

bgaillard commented 10 years ago

Hi, as mentioned in the documentation a Text shape has a fontStyle which can take one of the following values : normal, bold, italic.

How can we use a bold AND italic style ? In our case it is necessary because we are developing a text editor which has 2 buttons (bold and italic) which can both be enabled together.

Perhaps KineticJS Text should support a new font property which will have a similar behavior as the CSS font property http://www.w3schools.com/cssref/pr_font_font.asp ?

Anyway, for the moment what are our solutions to implement this bold AND italic functionality with KineticJS ?

heqiao commented 10 years ago

var text = new Kinetic.Text(); text.setFontStyle('bold italic');