Skip to main content
Daniel_Bunte
Participant
July 8, 2011
Question

faking bold and italic styles

  • July 8, 2011
  • 1 reply
  • 429 views

hi there,

i hope this is the right forum, since i'm only talking about the FTE rather than the TLF

atm. i work with the FTE to create text from html. in my application, the font can be set dynamically, so i don't always know, if the requested styles like bold/italic are available, but i always want the text to appear like it is formatted with html tags like <em>,<strong>.

i check the availablity with FontDescription.isFontCompatible() - this is where the journey begins. what should i do if the requested style isn't available?

e.g. i use tahoma and have regular and bold embedded, but there's no italic nor bold-italic style available. i can of course force using _sans, but this really gives crappy results.

is there an easy and natively available way to fake bold/italic, or do i have to stretch/skew the text on my own to fake the styles?

thanks in advance!

best regards,

daniel

This topic has been closed for replies.

1 reply

Adobe Employee
July 11, 2011

You can map your font as the one you like and set the other attributes, when you find it is not compatible.

For example,

        function myFontMapper(fd:FontDescription):void
        {
            if (fd.fontName == "Arial Black")
            {
                fd.fontName = "Arial";
                fd.fontWeight = FontWeight.BOLD;
            }
        }