Using devices fonts in flashpunk


(josepho) #1

Hi there

I need to embed text in chinese to my game, I found a chinese font, but it makes the game file to size around 4mb more! So i changed to my plan B using a device font to showing the chinese language, but, i found that when i use for example “_sans” in the font param of the text it doesnt shows anything.

How can I use device fonts in the flashpunk text class?

Many thanks!


(Jacob Albano) #2

I don’t know of a way to do this so my answer might not be helpful, but are you sure you want to use system fonts for this? You probably won’t be able to guarantee that your users have that font installed, and 4mb isn’t really all that bad, especially nowadays.


(josepho) #3

Yup, the people that wants to see the chinese characters will have the chinese characters installed


(azrafe7) #4

Found out you need to set embedFonts to false to use device fonts:

	text.font = "_typewriter";     // "_sans" or "_serif"
	text.setTextProperty("embedFonts", false);

(josepho) #5

Many thanks! It worked!