Flex / Flash: how to embed the same font in multiple SWC

I have the following project structure: - Flex project (SDK 3.3) - Several SWCs with graphs and text fields that are used as components in a Flex project.

Since I have many SWCs that use the same font in dynamic text fields, I don’t want to embed a font in every SWC. Instead, I want to have a library (RSL?) With a font from which all SWCs download the font.

I tried to create a library file using fonts using the Export Runtime feature in Flash. Although it works fine when I stay in Flash, Flex generates an “internal build error” when I try to use these SWCs in Flex.

Any ideas for a good font loading strategy?

Thanks a lot, Kolt

+3
source share
1 answer

In the past, I used flash to create a SWF file with embedded fonts. see this if you don't know what I mean for this). The link also contains other information that you may find useful, its not a link I tried to find, but it covers the necessary ones.

Once you have the SWF font, you can simply reuse it for each project. It is not swc, but it is as good as for fonts. I used CS3 for this (I mention this when I tried the trial version of CS4, and I think that they may have changed the way they create inline swfs fonts)

swf CSS, -

@font-face
{
  src: url("../theFolderWhereTheFileIs/YourFontFile.swf");
  fontFamily: "NameOfTheFontYouHaveEmbedded";
  font-weight : bold;
} 

SWF , StoneSansSemiBold.swf StoneSansItalic.swf

+1

Source: https://habr.com/ru/post/1709182/


All Articles