Font Management


(Bora Kasap) #1

Hi guys, im working on a text adventure library for flashpunk, im looking for the easiest way for using multiple fonts in a flashpunk Project. Do you have any ideas or links that can help me out?


(Martí Angelats i Ribera) #2

The way to use multiple fonts using FlashPunk is done following this steps:

  1. Add the fonts to the project.
  2. Embeding the font (usually in the Main.as). The name that you set to the font family will be the used one (it’s done using the regular way).
  3. Use the options font property to change it. It must be the same string as the embed font (code below).
  4. (optional) If you want to change the font after making the Text simply use the font property.
var options:Object = {font: "My font"}; //Add all the other options here
var text:Text = new Text("Hello World!", 0, 0, options);

text.font = "My other font";

PS: I don’t know if there is any program that can help you to make the code faster after design.