embedding fonts is a pain, and a royal one at that... it IS possible though, just need patience...
;)

All the fonts you are calling in your style sheet need to be in the library, they also need to be set as linkable objects [change linkage/properties]. Note the names you give them very carefully. Each state, bold, italic etc also needs to be created separately.
;)

Referencing the name of the font is critical, if it doesn't work when you reference your given name, try the font's actual name. Then, make sure you make the style EXACTLY the same as the embedded font; so don't assign 'bold' to your style when you are referencing 'regular'.

The order in which you construct the text field is also important, putting embedFonts at the start or at the bottom can make all the difference [before/after you assign text=].

Also, don't tell anyone else (shhhh), but I have found that assigning HTML text to .text= seems to work better [and still shows HTML even] than using .htmlText=

I use this order with success to show HTML text:

.html = true;
.embedFonts = true;
.styleSheet = __cssStyles;
.text = __sMoreText;//NOT .htmlText=

Good luck! I wish you the grace of a quick resolution,
;)

Sebastian.

allandt bik-elliott (thefieldcomic.com) wrote:
Hi guys

I'm in AS2 and trying to create a textfield, embed fonts in and apply a
stylesheet - if i use embedfonts it doesn't render but if i omit it,
everything renders fine (but the fonts aren't embedded so won't render
properly elsewhere)

i can't see what's going wrong - could you take a look please?

    private function setupCopy():Void
    {
        _tfMoreText = _mcPanelViewer.createTextField("_tfMoreText",
_mcPanelViewer.getNextHighestDepth(), _nTypeStartX, _nTypeStartY,
_nPanelTotalWidth, 30);
        //_tfMoreText.embedFonts     = true; // making the text disappear
        _tfMoreText.html         = true;
        _tfMoreText.styleSheet     = _cssStyles;
        _tfMoreText.selectable     = true;
        _tfMoreText.border        = true;
        _tfMoreText.borderColor = 0x999999;
        _tfMoreText.htmlText     = _sMoreText;

        trace(_tfMoreText.htmlText); // traces '<p class="bodyText"><span
class="white">My text</span></p>'
    }

fonts are fun

thanks guys
a
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to