Skip to main content
Participant
May 9, 2011
Question

Enumerating multiple-face embedded fonts

  • May 9, 2011
  • 1 reply
  • 321 views

We have found some nice fonts at http://www.theleagueofmoveabletype.com/ many of which consist of one OTF file per face. Is there a way to use these as embedded fonts in TLF markup and, likewise, the output from enumerateFonts, in such a way that they show up only once?

For instance, Fanwood consists of two files: one Regular and one Italic. Our users will have a simple text editor which will allow them to choose a font we will then encode into TLF. Currently, Fanwood shows up as two separate entries: Fanwood regular and Fanwood italic. Is there a way to embed them in such a way that there is only one Fanwood entry (like in Mac OS X Font Book) which is capable of either Regular or Italic face?

Thanks,

Patrick

This topic has been closed for replies.

1 reply

Adobe Employee
May 10, 2011

I think you can take advantage of FontMapping as follows.

GlobalSettings.fontMapperFunction = myFontMapper;
textFlow.invalidateAllFormats();

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