Flex - Flash Builder Design View not showing embedded fonts correctly

Posted by Crusader on Stack Overflow See other posts from Stack Overflow or by Crusader
Published on 2010-12-13T05:17:50Z Indexed on 2011/02/28 23:25 UTC
Read the original article Hit count: 417

Filed under:
|
|
|

Tools: Air 2, Flex SDK 4.1, Flash Builder, Halo component set (NO Spark being used at all)

Fonts work perfectly when running the appliction, but not in design view. This effectively makes design view WORTHLESS because it's impossible to properly position components or labels without knowing what the true size is (it changes depending on font...)

...

CSS included in root component like so:

<fx:Style source="style.css"/>

CSS file:

/* CSS file */
@namespace mx "library://ns.adobe.com/flex/mx";

global {
    font-family:Segoe;
    font-size:14;
    color:#FFFFFF;
}

mx|Application, mx|VBox, mx|HBox, mx|Canvas {
    font-family:Segoe;
    background-color:#660000;
    border-color:#222277;
    color:#FFFFFF;
}

mx|Button {
    font-family:Segoe;
    fill-colors:#660000, #660000, #660000, #660000;
    color:#FFFFFF;
}
....

Interestingly (or buggily?), when I try pasting the style tag into a subcomponent (lower than the top level container), I get a bunch of warnings in the subcomponent editor view stating that CSS type selectors are not supported in.. (all the components in the style sheet).
Yet, they do work when the application is executed. Huh?

This is how I'm embedding the fonts in the root level container:

 [Embed(source="/assets/segoepr.ttf", fontName="Segoe", mimeType="application/x-font-truetype", embedAsCFF='false')]
 public static const font:Class;

 [Embed(source="/assets/segoeprb.ttf", fontName="Segoe", mimeType="application/x-font-truetype", fontWeight="bold", embedAsCFF='false')]
 public static const font2:Class;

So, is there a way to get embedded fonts to work in design view or what?

© Stack Overflow or respective owner

Related posts about flex

Related posts about flash