CounterMarch Systems

comfortably self-assured


We used to blog more before twitter came along.

Flex Embedded Font Issue

We're running in to a weird 3 pixel offset issue when using an embedded font in a Flex app. The offset emerges when applying bold or italics to text in an mx:Text or mx:Label tag. Plain text seems to render OK. The swf we're referencing has plain. bold and italic versions of the font embedded in it.

We can't figure out what the deal is. other than to think it's some sort of bug with maintaining text positioning when applying bold or italics to a string.

<mx:Style>
@font-face {
src: url("fonts.swf");
fontFamily: "Gill Sans MT";
}
global{
fontFamily: "Gill Sans MT";
}
</mx:Style>

<mx:HBox left="3" top="3" color="#777777" right="0" horizontalGap="0">
<mx:Text text="Event" fontSize="14" />
<mx:Text text="Silly Event..." fontSize="14" fontStyle="italic" />
<mx:Text text="Stupid !@$% Event!?" fontSize="14" fontWeight="bold" />
</mx:HBox>

Flash player version is 9.0.47.0. Flex is 2.0.1. Anyone got a clue?

Comments
JabbyPanda's Gravatar I've just tried your sample code with a "Arial" font applied (do not have "Gill Sans MT" font installed).

In my case all 3 texts are correctly alighned at the bottom without any shift.

I blame the font. not a Flex... Have you tried your sample with another font?
# Posted By JabbyPanda | 8/31/07 12:09 PM

About the blog

7 years of outstanding software development

CounterMarch Systems is a professional consulting firm specializing in Adobe technologies with a special focus on higher education.

2771 Red Oak Circle
Bethlehem, Pennsylvania 18017
610.280.3455
Contact Us