Rpgccv
Rpgccv

Reputation: 137

Flex - Embedding .ttf font in Spark TextInput "prompt"?

This is what i have:

Main.mxml:

<fx:Style source="Main.css"/>
    <s:TextInput x="72" y="95" focusColor="#CECB02" prompt="E-mail: "
             skinClass="components.TextInputSkin"/>

TextInputSkin.mxml:

 <s:RichText id="promptDisplay" includeIn="disabledWithPrompt,normalWithPrompt" x="10" y="7"
        color="#666666" fontFamily="Acens" fontSize="15" trackingRight="1"
        color.normalWithPrompt="#333333"/>
    <s:RichEditableText id="textDisplay" d:userLabel="Text Display" x="10" y="7" width="230"
        fontFamily="Acens" fontSize="15" heightInLines="1"
        width.normal="282" color.normal="#999999"
        tabStops.normal="S0 S50 S100 S150 S200" trackingRight.normal="1"/>

Main.css

@font-face
{
    fontFamily: Acens;
    src: url("C:\WINDOWS\Fonts\Acens.ttf");
    embedAsCFF: true;
}

So, the "promptDisplay" in a computer(online) that does not have "Acens.ttf" installed shows the predefined one, but the inputed text is showed correctly with the embeded font!! Any explanation/solution for that!?

Thanks ;-)

Upvotes: 1

Views: 1461

Answers (1)

Stanislav Zayarsky
Stanislav Zayarsky

Reputation: 91

Specify fontStyle="normal" or "italic" to prompt RichText. And be sure that in css you declare it the same.

Upvotes: 4

Related Questions