dcsimg
A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: Why do my font aren't displayed smoothly ?

Hybrid View

  1. #1
    Member
    Join Date
    Oct 2002
    Location
    Montréal
    Posts
    80

    Why do my font aren't displayed smoothly ?

    Hi,

    I’m experiencing strange thing with Dynamic text boxes and how text (font) is displayed.

    Here is my problem:
    I have two text boxes in my swf.
    Text box 1 is a ‘Static Text’ text box which display text using one usual font (ex: impact)
    Text box 2 is created with the function ‘createTextField’ and display text got from an external text file, using the same font as Text Box 1 (ex: impact)

    When viewing the swf file with the Flash Player, the characters displayed by the Text Box 1 are smooth, and nice to read. But the characters displayed by the Text Box 2 are rough, irregular.

    I have tried different things, but without success.
    That drive me crazy, am I missing something ?

    Do anyone know what to do ?

    Thanks,

  2. #2
    poet and narcisist argonauta's Avatar
    Join Date
    Nov 2001
    Location
    Under the bed
    Posts
    2,080
    click on the dynamic textbox.

    on the properties panel, click "character"
    select embed fonts for outlines: "all characters"
    click ok. try it

    did it work?
    my blog: blog.innocuo
    Sponsored by your mom.

  3. #3
    Member
    Join Date
    Oct 2002
    Location
    Montréal
    Posts
    80
    I have finaly tried it.

    But did not work.

    I'm using the function 'createTextField' in order to create my text erea. So I have tried the 'MyTextField.embedFonts = true;' to do what you said. But doing so the text is not anymore displayed when viewing my swf with the Flash Player (the text area stay empty).

    Could it work when creating dynamicly the text area ?
    I haven't found any other function in the AS dictionnary.

    If you have an other idea, it would be great.

    Thanks.

  4. #4
    Member
    Join Date
    Oct 2002
    Location
    Montréal
    Posts
    80
    even after adding the font in the library it still doesn't work.

    sh*&%t, I though I had found the solution.

    I will continue ...

  5. #5
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    You are on the right track...

    Can you attach your .fla?

  6. #6
    Member
    Join Date
    Oct 2002
    Location
    Montréal
    Posts
    80
    Salut !

    Here is the AS I'm using:
    The 'BandBioText.embedFonts = true;' is in comment because when using it the text is not even displayed. I can found a way to make it work.

    If you have a solution ....


    // Create textfield to show results
    createTextField("BandBioText",1,259.9,132,437.9,32 0);
    BandBioText.multiline = true;
    BandBioText.wordWrap = true;
    BandBioText.html = true;


    BandBioTextFormat = new TextFormat();
    BandBioTextFormat.align = "right";
    BandBioTextFormat.font= "Impact";
    BandBioTextFormat.color= "#ffffff";
    BandBioTextFormat.size= "12";
    BandBioText.setTextFormat(BandBioTextFormat);


    //BandBioText.embedFonts = true;


    // add scrollbar component
    this.attachMovie("FScrollBarSymbol","scroller",2);
    scroller._x = 727;
    scroller._y = 132;
    scroller.setSize(320);
    scroller.setScrollTarget(BandBioText);
    scrollColors = {lightest:0x999999, medium:0x666666, darker:0x333333, darkest:0x000000};
    scroller.setStyleProperty("arrow", scrollColors.darkest);
    scroller.setStyleProperty("face", scrollColors.medium);
    scroller.setStyleProperty("shadow", scrollColors.darker);
    scroller.setStyleProperty("darkshadow", scrollColors.darker);
    scroller.setStyleProperty("highlight", scrollColors.darker);
    scroller.setStyleProperty("highlight3d", scrollColors.darker);
    scroller.setStyleProperty("scrollTrack", scrollColors.darker);


    Content = "In March of 2002, the convergence....";
    BandBioText.htmlText = '<font face="Impact" size="12" color="#ffffff">' + Content + '</font>';

  7. #7
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Did you add a new font(Impact) to the Library?

  8. #8
    poet and narcisist argonauta's Avatar
    Join Date
    Nov 2001
    Location
    Under the bed
    Posts
    2,080
    you attached the font Impact in another Textfield right? embedding all the characters?

    maybe this is also wrong:

    code:
    '<font face="Impact" size="12" color="#ffffff">' + Content + '</font>'



    I think instead you should invert the use of the " and '

    like this:

    code:
    "<font face='Impact' size='12' color='#ffffff'>" + Content + "</font>"



    i'm not sure if that would output a different text. Try it.

    Second of all, if you're using html, try not to use textformat (at least not more that once, as you're formatting text through your html font tags as well).

    Now, if you can, it's be better if you post your fla.

    [edit]
    and now you left me thinking about it. WHy do you use the font tags, and htmlText?????? just use mytextbox.text=Content Content being a string, as you're already adding the TextFormat. There's no need to add html, unless you're doing a more complicated formatting (one word blue, oothe black and bold, other green, etc) in that case is way ieasier just using html.

    Anyway, tell us tell us what happened?
    [/edit]
    Last edited by argonauta; 08-22-2003 at 12:36 AM.
    my blog: blog.innocuo
    Sponsored by your mom.

  9. #9
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    This works...

    code:

    // Create textfield to show results
    createTextField("BandBioText",1,50,50,438,320);
    BandBioText.multiline = true;
    BandBioText.wordWrap = true;
    BandBioText.border = true;
    BandBioText.html = true;
    BandBioText.embedFonts = true;
    BandBioText.htmlText = "<u><font color='#FF0000'>In March of 2002, the convergence....";

    BandBioTextFormat = new TextFormat();
    //BandBioTextFormat.align = "right";
    BandBioTextFormat.font= "Font1";
    //BandBioTextFormat.color= 0xFF0000;
    BandBioTextFormat.size= "16";
    BandBioText.setTextFormat(BandBioTextFormat);

    // add scrollbar component
    this.attachMovie("FScrollBarSymbol","scroller",2);
    scroller._x = 500;
    scroller._y = 50;
    scroller.setSize(320);
    scroller.setScrollTarget(BandBioText);
    scrollColors = {lightest:0x999999, medium:0x666666, darker:0x333333, darkest:0x000000};
    scroller.setStyleProperty("arrow", scrollColors.darkest);
    scroller.setStyleProperty("face", scrollColors.medium);
    scroller.setStyleProperty("shadow", scrollColors.darker);
    scroller.setStyleProperty("darkshadow", scrollColors.darker);
    scroller.setStyleProperty("highlight", scrollColors.darker);
    scroller.setStyleProperty("highlight3d", scrollColors.darker);
    scroller.setStyleProperty("scrollTrack", scrollColors.darker);

    stop();



    Impact font was set as a new font(Font1) in the Library and Linkage set.
    You got to be careful when using html formated text and a TextFormat.
    Some code will contredict each other... It all depends what your trying to display...
    Last edited by oldnewbie; 12-02-2004 at 02:01 PM.

  10. #10
    Member
    Join Date
    Oct 2002
    Location
    Montréal
    Posts
    80
    Thanks all for your help.

    But I’m having now another problem.

    Attached are the resources.
    Which are 3 fla files.

    First.fla – include one Button that load the two other movies when released.
    Main.fla – just contains an empty MC use as container for the third movie.
    Bio.fla – Include the AC discussed above.


    This architecture represents the architecture I’m using in my project. Of course the Main.swf isn’t normally empty.

    The problem I have is that when the line ‘BandBioText.embedFonts = true;’ is activated in the AC of Bio.fla the text is not displayed. If I put this line as comment the text is displayed, but not as I want (smoothly).

    Trying to find the solution, I realized that if the second and third swf are loaded in the first one without using a button (I mean the line ‘loadMovie ("Bio.swf", _root.content.main);’ directly written at the first frame of the First.fla and the button removed) it is working great, and the text is displayed as I want.

    I hope you will have some ideas.

    Thanks
    Attached Files Attached Files

  11. #11
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    You have to add the font in each of the movies' Librairies...

    And watch your syntax... The font's name is "Font1" and not "Impact" although "Impact" is the font assigned to "Font1"... And set Linkage to export on the first frame... Right-click the font in the Library and set Linkage.
    Last edited by oldnewbie; 12-02-2004 at 02:02 PM.

  12. #12
    Member
    Join Date
    Oct 2002
    Location
    Montréal
    Posts
    80
    Thanks for your help Oldnewbie.

    It's now working great.

    But I have another problem (one after another):
    I have to use the same thing for a text area that displays text comming from an XML external file. When the line ‘NewsText.embedFonts = true;’ is active into my AS the HTLM tags (<br \>) that are present in the text (coming from the XML external file) are not recognize, but if the line ‘NewsText.embedFonts = true;’ is set as comment it's working great (of course without the smooth characters).

    I have to say that I still haven't really get the interaction between all the possible parameters for a text field. Their interaction doesn't seem logic to me. (I will get it !!)

    but if you have an idea for this new one ...

    regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center