I made an error in my original post. I meant to say the compiler went nuts.
Both Builder and the compiled swf are wrong. It's way more than a 1 pixel
shift. The right side radio button is unchanged (height works out to 23), the
left side radio button I set the height to 15. Both the radio buttons are set
to exactly the same y coordinate
- Original Message -
From: ag_rcuren
To: flexcoders@yahoogroups.com
Sent: Thursday, August 06, 2009 8:40 AM
Subject: [flexcoders] Re: Flex Builder vs Embedded Fonts - Partially solved
There is a know bug in flex 3 with embedded fonts where they display one
pixel higher. This make button labels and other things look off center. As far
as I have seen this affects all embedded fonts and is due to the way they are
anti aliased. There are a couple work arounds out on the web some involve
changing the measure code, or simply moving the text component down by 1 pixel.
But this happens in the compiled swf not just inside of Flex builder.
--- In flexcoders@yahoogroups.com, "Warren" wrote:
>
> OK -- after some digging I think I know what's going on. I'm embedding
Verdana font. I'm thinking the issue is that the vertical spacing in the font
is different than the default font Flex Builder is using. As a result, the
measurement routine is off.
>
> This feels like a bug to me -- I'll be checking the Adobe bug system next.
The only way I can figure out how to fix this is to embed exactly the same font
that Builder is using by default.
>
> Can anyone tell me how to determine this?
>
>
> - Original Message -
> From: warrenonflex
> To: flexcoders@yahoogroups.com
> Sent: Wednesday, August 05, 2009 8:38 AM
> Subject: [flexcoders] Flex Builder vs Embedded Fonts
>
>
> Recently I had the need to embed font's in my Flex 3 application. I used
the CSS code (see below) to embed the fonts and make them global. Worked great
except Builder went nuts. The Builder display doesn't look like the website.
Elements are shifted about, text doesn't line up properly (for example, radio
button text doesn't center on the radio icon), etc. It's a mess. I am using
Builder version 3.0.2.214193
>
> So I have two questions:
>
> 1) If I create a swf of the fonts and embed it in flex using the swf, will
Builder prefer this?
>
> 2) What is the default font for Flex or how do I determine what it is in my
install? If I knew that, I could embed it and hope that Builder would stop
messing up.
>
> 3) What Am I Doing Wrong?
>
> Warren Koch
>
> /* CSS file */
>
> @font-face {
> font-family: MainFont;
> src: url("assets/fonts/verdana.TTF");
> unicode-range: U+0020-U+007E;
> advancedAntiAliasing: true;
> }
>
> @font-face {
> font-family: MainFont;
> src: url("assets/fonts/verdanab.TTF");
> unicode-range: U+0020-U+007E;
> advancedAntiAliasing: true;
> fontWeight: bold;
> }
>
> @font-face {
> font-family: MainFont;
> src: url("assets/fonts/verdanai.TTF");
> unicode-range: U+0020-U+007E;
> advancedAntiAliasing: true;
> fontStyle: italic;
> }
>
> @font-face {
> font-family: MainFont;
> src: url("assets/fonts/verdanaz.TTF");
> unicode-range: U+0020-U+007E;
> advancedAntiAliasing: true;
> fontWeight: bold;
> fontStyle: italic;
> }
>
> global {
> font-family: MainFont;
> }
>
<>