Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Another EmbedFonts Question


Hi guys! First post here, so I chose one of the classics... It could be answered before, but I searched the forums and did no find an answer.

I have a movieClip with several TextFields, that take their values from an XML file created dinamically by an ASP file. I have the fonts embedded (Eurostile in this case) and I am satisfied with the rendering. I embedded them with a font symbol and all that. It works fine. The problem is that, when I nest the movie in another one and call it with a loadMovie the text dissapears. I forced some text introducing some "foo" in the TextFields at authoring time and they appear but use the default font instead of the Eurostile.

And that's it. I call upon the mighty flash fu of the forums... and ready to build a sample file if the problem is not as common as I thought

Thanks

Zhen He




ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 05-26-2004, 03:19 AM


View Complete Forum Thread with Replies

Sponsored Links:

EmbedFonts
threre is a way to embed fonts
and define font siza in this ticker???

I' ve tried adding
text.embedFonts = true;
text.size = 20;
but doesn't work

Thanks in advance
manner

System.useCodepage = true;

function newsticker(content, posX, posY, depth, tempo) {
this.loadVariables(content);
this.onData = function() {
createTextField("text", depth, posX, posY, 10, 20);
text.html = true;
text.htmlText = news;
text.selectable = false;
text.autoSize = "left";

createTextField("text2", depth+1, posX, posY, 10, 20);
text2.html = true;
text2.htmlText = news;
text2.selectable = false;
text2.autoSize = "left";
text2._x = newstext._width;

function tick() {
text._x -= tempo;
text2._x -= tempo;
if (text2._x <= posX) {
text._x = posX;
text2._x = text._width + posX;
}
updateAfterEvent();
}
setInterval(tick, 30);
};
}

newsticker("ticker.txt", 0, 7, 1, 1);

View Replies !    View Related
EmbedFonts
Hi guys, I need to do this:


Code:
myStyle = new TextFormat()
myStyle.font = "kievit";

field.htmlText = "<FONT FACE='myStyle' SIZE='21' COLOR='#FFFFFF'>This is a text field bla bla bla bla</FONT>"
and get this result:

Code:
myStyle = new TextFormat()
myStyle.font = "kievit";

field.htmlText = "This is a text field bla bla bla bla";
field.setTextFormat(myStyle);
field.embedFonts = true

Did you understand? In the first example, how do I apply embedFonts without make the text disappear ?

View Replies !    View Related
EmbedFonts
Hi,

myTextField.embedFonts = true;
myTextField.setNewTextFormat(boldTextFormat);
myTextField.setTextFormat(boldTextFormat);

boldTextFormat is a Textformat that I create in the Library.

it works for some fonts but not for others.
for example it works for "Ariel" in English but not in Hebrew.
(if I create the text not through the code, Hebrew displays fine with Ariel)
It does, however, work with other Hebrew fonts.

What am I missing ?

Thanks,
Alex.

View Replies !    View Related
EmbedFonts
for my application. i embed the fonts in flash.

that works. but if i set the textformat on bold or italic for the textfield, the textline disappear...

ex.
textfieldFormat = new TextFormat();
textfieldFormat.bold = true*;
textfieldFormat.italic = true*;
textfield.setTextFormat(textfieldFormat);

* = true is the value of a variable. definied with a button.

only if bold and italic are false, i can see the textline.

then i tryed to embed the bold- and italic style of the font. the flashfile will be bigger and bigger. but i need a usable version .
BUT with the option BOLD or ITALIC in the Perferences Window of the Importete Font in the Libary, it dont works too... the textline disappear by clicking...

the only way that works is, when i take a other font. not the stile... ex.
"Testfont Std Light" is the normal font
if i want to take the bold version, i must take the font "Testfont Std Bold". That works with my AS code... but in my opinion it's not the best way...

do you know how i can use the BOLD and ITALIC fields in the Perferences from the fonts in the libary?

sorry for my english. its difficult for me to show my problem...

thank you

View Replies !    View Related
EmbedFonts
Hello

Trying to use embedded fonts but can't get the code below to work.Where's my error?

thumbTitleFormat=new TextFormat();
thumbTitleFormat.font="exportedArialFont";
thumbTitleFormat.align="center";
thumbTitleFormat.size=10;
thumbTitleFormat.color=0xFF0000;
createTextField("thumbTitle_txt",13,0,0,0,0);
thumbTitle_txt.setNewTextFormat(thumbTitleFormat);
thumbTitle_txt.autosize="center";
thumbTitle_txt.embedFonts=true;
thumbTitle_txt.text="text";

View Replies !    View Related
EmbedFonts
I am loading different movie clips into a container.
In those movie clips I am loading external text into dynamic textfields.
I create those text fields dynamically and I found myself in the position to embed the same font in every movie clip that I'm loading...
So my problem becomes this: instead of loading 20 external movieclips with 1-5kb each, I'm forced to load 20 with 21-25kb each, though they all use the same font.

this.embedFonts=true;
doesn't seem like the best solution for my problem, so do you have any other option?

View Replies !    View Related
EmbedFonts
i can't seem to get embedFonts to work - when i set it to "true," the text in my textbox disappears. i'm using the font "Arial" in my TextFormat. how can i get embedFonts to work?

View Replies !    View Related
GlobalStyleFormat.embedFonts
I'm trying to embed my fonts into a DataGrid. I put in:

globalStyleFormat.embedFonts=true;

and the text disappears. What am I missing?

View Replies !    View Related
EmbedFonts Problem ...
this codes don't work..but when i change embedFonts value to "false"
it works..Please help ..


def = new TextFormat();
def.color = 0x333366;
def.size = 11;
def.font = "Verdana";
H = 200;
sayi = 4;
for (i=0; i<sayi; i++) {
this.createEmptyMovieClip("list"+i, i);
liste = this["list"+i];
liste.createTextField("yazi", 1, 0, 0, 100, H);
liste.yazi.multiline = 1;
liste.yazi.text="egdjgdjgdsjghdjgd
ghsdjghdjgdhgd hg
gjdgj";
liste.yazi.border = 1;
liste.yazi.setTextFormat(def);
liste.yazi.autoSize = "left";
liste.yazi.embedFonts = 1;
}

View Replies !    View Related
EmbedFonts Question
Hi all,

I'm trying to create a dynamic text field from actionscript.
I get it working just fine until I try both changing the font by applying a textFormat obj and setting embedFonts = true. After I did that, the text won't show.
Is there any way to have the font changed and have it look smooth if I'm using the createTextField?

Thanks

View Replies !    View Related
Having A Problem With EmbedFonts.
I need somebody to point out what stupid mistake I'm making. If I embed the fonts, the text doesn't appear at all. This happens whether or not I use the setTextFormat() command.

code:

var let = _root.createEmptyMovieClip("letter" , 10);
let._x = let._y = 100;

let.createTextField("char_txt", 1, 0, 0, 300, 50);
let.char_txt.text = "Hello World";


var fmt = new TextFormat();
fmt.size = 40;
fmt.bold = true;
fmt.color = 255;
let.char_txt.setTextFormat(fmt);

// This line makes text invisible!
//let.char_txt.embedFonts = true;

View Replies !    View Related
Help: TextField.embedFonts
As soon as I change the text field properties to embedFonts by action script like:

myTextField.embedFonts=true;

All of my text disappears, any suggestions?

Thanks,
Kamran.

View Replies !    View Related
EmbedFonts In Nested MC's
Hey Gang,

Just one last try before I hang up this project... I have been on the AS.ORG site conversing about this and searching the web like a crackhead scouring his carpet for a lost rock.

I have a movieclip behind a mask, with nested movieclips containing jpegs and textfields generated on-the-fly with XML (sort of a moving gallery viewer).

All is well until I try to use embedFonts=true on them. Not too sure what the problem, because the same setTextFormat(myFont) works in other parts of this same movie.

Anyone have any experience in particular with this problem?

This seems like it should be listed somewhere as a major failing if it is a bug/feature.

Thanks in advance for any feedback or advice.

View Replies !    View Related
EmbedFonts Question
Please help...this is sort of a carry-over from an earlier thread...
if I'm sharing fonts from another library at runtime, does that mean I don't have to use an .embedFonts=true after every time I rewrite the .text of a textField in actionscript? Or do I still have to do that as before? And does anyone know how much filesize doing that actually incurs?

View Replies !    View Related
[F8] .embedFonts = True; ?
Hi Peeps, Iv been Taking a few tutorials and experimenting over the last few days and iv hit a major snag. Im trying to combine.

This
__________________________________________________ _________
this.createTextField("my_txt", 10, 10, 10, 320, 100);
my_txt.autoSize = "left";
my_txt.border = true;
my_txt.multiline = true;
my_txt.wordWrap = true;

var lorem_lv:LoadVars = new LoadVars();
lorem_lv.onData = function (src:String):Void {
if (src != undefined) {
my_txt.text = src;
} else {
my_txt.text = "Unable to load external file.";
}
}
lorem_lv.load("http://www.helpexamples.com/flash/lorem.txt");

__________________________________________________ ______
And This
__________________________________________________ ______

// 1
this.createTextField("thickness_txt", 10, 0, 0, Stage.width, 22);
this.createTextField("lorem_txt", 20, 0, 20, Stage.width, 0);
lorem_txt.autoSize = "left";
lorem_txt.embedFonts = true;
lorem_txt.antiAliasType = "advanced";
lorem_txt.text = "Lorem ipsum dolor sit amet.";
lorem_txt.wordWrap = true;

// 2
var style_fmt:TextFormat = new TextFormat();
style_fmt.font = "Times (embedded)";
style_fmt.size = 30;
lorem_txt.setTextFormat(style_fmt);

// 3
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function():Void {
// Values for TextField.thickness can range from -200 to +200.
lorem_txt.thickness = Math.round(_xmouse * (400 / Stage.width) - 200);
thickness_txt.text = "TextField.thickness = " + lorem_txt.thickness;
};
Mouse.addListener(mouseListener);

__________________________________________________ ___________
and this is what iv come up with.

__________________________________________________ ___________
// 1
this.createTextField("thickness_txt", 10, 0, 0, Stage.width, 22);
this.createTextField("lorem_txt", 20, 0, 20, Stage.width, 0);
lorem_txt.autoSize = "left";
lorem_txt.embedFonts = true;
lorem_txt.antiAliasType = "advanced";
//lorem_txt.text = "Lorem ipsum dolor sit amet.";
lorem_txt.wordWrap = true;

var lorem_lv:LoadVars = new LoadVars();
lorem_lv.onData = function (src:String):Void {
if (src != undefined) {
lorem_txt.text = src;
} else {
lorem_txt.text = "Unable to load external file.";
}
}
lorem_lv.load("http://www.helpexamples.com/flash/lorem.txt");

// 2
var style_fmt:TextFormat = new TextFormat();
style_fmt.font = "Times (embedded)";
style_fmt.size = 20;
lorem_txt.setTextFormat(style_fmt);

// 3
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function():Void {
// Values for TextField.thickness can range from -200 to +200.
lorem_txt.thickness = Math.round(_xmouse * (400 / Stage.width) - 200);
thickness_txt.text = "TextField.thickness = " + lorem_txt.thickness;
};
Mouse.addListener(mouseListener);
__________________________________________________ ____________
Only problem is it dosent populate the text feild with the text in the external file.
It works if you use the standard ".text ='blah' ;" I think iv wittled it down to
the ".embedFonts = true;" but im not sure why this would cause a problem.
Can anyone see a problem or am i completly barking up the wrong tree.

Any thoughts or input would be great.

Thanks,

Atomiser

View Replies !    View Related
[CS3] EmbedFonts Not Working?
Hopefully this one is pretty simple. I'm trying to embed all the fonts I use in the action layer of the first frame of the first scene. There's a bunch of them, but they all follow this format:
PHP Code:




var l12_fmt:TextFormat = new TextFormat();l12_fmt.font = "Lucida12";registration_mc.regName_input.embedFonts = true;registration_mc.regName_input.setTextFormat(l12_fmt);







When I load the app up on a test machine, it's using the correct font (which is not installed on that machine), but the text is all aliased and jagged. I thought embedded fonts were antialiased by default? I've experimented with the following line to no avail:
PHP Code:




registration_mc.regName_input.antiAliasType = "normal";






Anyway, the fonts are all created and stored within a folder called 'Fonts' in the library. Is there something wrong with my code? Do I have the right idea?

Also, is it possible to make the whole text format antialiased instead of doing each textfield individually? (I'm guessing this should be the default anyway, but something is preventing it.)

Edit: Um, correction, these fonts WERE installed on the test machine. I deleted them and tested it again and now the app uses a completely different font. So I take it to mean my embed code doesn't work at all.

View Replies !    View Related
EmbedFonts Not Working
I am not sure what is going wrong but I am trying to do a embedFont. I have done this before and it has worked. I am using the help files example


Code:
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "myFont";
this.createTextField("my_txt", 100, 100, 100, 160, 120);
my_txt.wordWrap = true;
my_txt.embedFonts = true;
my_txt.text = "Hello world";
my_txt.setTextFormat(my_fmt);
I have in the library a font named with linkage myFont. the help files mention to set linkage properties set as follows: the identifier set to my font and Export for ActionScript and Export in First Frame selected. I see that option on movieclip properties but not on the font properties I am using cs3.

not sure if this has anything to do with but the _rotation does not work either even if I comment out embed fonts

any help would be great

dave

View Replies !    View Related
[Q] Another EmbedFonts Thread... :(
I thought that I knew how to embed the font and make the text look nice, but I guess I don't...

Can somebody take a look at this code and tell me what I am doing wrong???
PHP Code:



createCity("us");
function createCity(level)
{
//    trace("function createCity with " + level + " ...");
    this.createEmptyMovieClip("city_mc", 50000);
    this.cityName_tf = new TextFormat();
    this.cityName_tf.align = "center";
    this.cityName_tf.bold = true;
    this.cityName_tf.color = 0x000000;
    this.cityName_tf.font = "Tahoma";
    this.cityName_tf.size = 12;
    
    for (var i = 0 ; i < this["city_" + level + "_arr"].length ; i++)
    {
        this.city_mc.attachMovie("MC_City", "city" + i + "_mc", 50000 + theDepth++, {_x:this["city_" + level + "_arr"][i].locX, _y:this["city_" + level + "_arr"][i].locY});
//        traceOut("level = " + level);
        this.city_mc["city" + i + "_mc"].createTextField("city_txt", 99999, 0, -25, 10, 10);
        this.city_mc["city" + i + "_mc"].city_txt.autoSize = true;
        this.city_mc["city" + i + "_mc"].city_txt.background = true;
        this.city_mc["city" + i + "_mc"].city_txt.backgroundColor = 0xCCCCCC;
        this.city_mc["city" + i + "_mc"].city_txt.border = true;
        this.city_mc["city" + i + "_mc"].city_txt.type = "dynamic";
        this.city_mc["city" + i + "_mc"].city_txt.text = this["city_" + level + "_arr"][i].fullName;
        this.city_mc["city" + i + "_mc"].city_txt.selectable = false;
        this.city_mc["city" + i + "_mc"].city_txt.setTextFormat(this.cityName_tf);
        this.city_mc["city" + i + "_mc"].city_txt.embedFonts = true;
        if (this.city_mc["city" + i + "_mc"]._x < 175)
        {
            this.city_mc["city" + i + "_mc"].city_txt._x = 0;
        }
        else if (this.city_mc["city" + i + "_mc"]._x > 700)
        {
            this.city_mc["city" + i + "_mc"].city_txt._x = Math.floor(Math.round(this.city_mc["city" + i + "_mc"].city_txt._width / -1));
        }
        else
        {
            this.city_mc["city" + i + "_mc"].city_txt._x = Math.floor(Math.round(this.city_mc["city" + i + "_mc"].city_txt._width / -2));
        }
//        trace("this.city_txt.text = " + this["city_" + level + "_arr"][i].fullName);
    
        this.city_mc["city" + i + "_mc"].cityName = this["city_" + level + "_arr"][i].fullName;
        
        this.city_mc["city" + i + "_mc"].State = this["city_" + level + "_arr"][i].State;
        this.city_mc["city" + i + "_mc"].zip = this["city_" + level + "_arr"][i].zip;
        this.city_mc["city" + i + "_mc"].cityDot_mc.onPress = function ()
        {
            trace("State : " + this._parent.State);
        }
    }





If you comment out this line, the text looks nice, but if you leave it as it is, it looks crappy...

this.city_mc["city" + i + "_mc"].city_txt.embedFonts = true;

Thank you...

View Replies !    View Related
Prob With EmbedFonts
Hey guys

Maybe you can help me on this.
I generate a text field using the createTextField function. when i turn the "embedFonts" function the text disappears.. The code:

ActionScript Code:
yourFormat2 = new TextFormat();
yourFormat2.color = 0x666666;
yourFormat2.font = "Osaka";
yourFormat2.size = 10;
_root.createTextField("abstract", 120, random(800)-100, random(200)+10, 100, 15);
_root.abstract.setTextFormat(yourFormat2);
_root.abstract.text = "blablabla";
///////////////// text doesn't appear when i turn this function to true:
_root.abstract.embedFonts = true;
/////////////////
_root.abstract.type = "dynamic";
_root.abstract.border = true;
(by the way, how do you format the AS text in a thread??)

View Replies !    View Related
EmbedFonts Not Shows
hi
i am using as2 to generate a text field using the code
class textgen1

ActionScript Code:
{
    var iname:String;
    var xpos:Number;
    var ypos:Number;
    var wid:Number;
    var hei:Number;
    var who:MovieClip;
    var dy_text:String;
    public function textgen1(what:MovieClip,inst:String,x:Number,y:Number,width:Number,height:Number,oritext:String)
    {
        who=what;
        iname = inst;
        xpos = x;
        ypos = y;
        wid = width;
        hei = height;
        dy_text = oritext;
    }
   
    public function txt_creation()
    {
        who.createTextField(iname,_root.getNextHighestDepth(),xpos, ypos, wid, hei);
        setValue(dy_text,iname);
    }

    public function setValue(txt:String,inst_name:String)
    {
        var my_fmt:TextFormat = new TextFormat();
        my_fmt.size = 24;
        my_fmt.font = "Arial";

        with (who[inst_name])
        {      
        setNewTextFormat(my_fmt);
        multiline = true;
        wordWrap = true;
        autoSize = "left";
        border=true;
        text = txt;
        type="dynamic";
        selectable=false;
        embedFonts=true;
        }
    }
but the text created on the state not shows only border shows
if i use embedFonts=false then the text is displayed.
whats the reason?
and i want to know that how i animate a textfield using as2 the text field is generated through createTextField command.

if anyone help me in this
thans

View Replies !    View Related
Embedfonts & Alpha
hi,
yes i know this issue has been discussed many time before, and i've read
many threads and post, but still found no solution.
basically, this is my code (which is found inside a function):

var _txt = txt_mc.createTextField("text",10,X,Y,W,STAGE_H);
_txt.html = true;
_txt.selectable = false;
_txt.multiline = true;
_txt.styleSheet = cssFormat;
_txt.htmlText = "<p class='"+Format+"'>"+Text+"</p>";
_txt.autoSize = "right";
_txt.wordWrap = true;

when 'Format' & 'Text' are parameters passed into the function containing
this code, and 'cssFormat' is styleSheet object, into which an external css
file was loaded.

at this point, when all works fine i want to set the alpha of the text (or
actually the MC containing it) to 0 (so later i can fade it in).
after adding -
txt_mc._alpha = 0;
not surprisingly, the text isn't affected by this change (only the other
graphic element in the MC), so i add -
txt_mc.text.embedFonts = true;
which causes the the text not to appear at all...

just for tesing, i added -
System.useCodepage=true;
but it made no change.

any solution?
thanks in advance,
eRez

View Replies !    View Related
EmbedFonts Woes
Sorry, I posted this on the tail end of another topic but was worried it wouldn't get looked at because it was marked as answered.

I have had this problem in the past and just gotten around it by manually drawing a dynamic text field and embedding fonts in it. Now I need to use differend styles that are assigned in loaded text. But I can't even get this simple test working. Can anyone please tell me what i'm doing wrong? If I comment out the embedFonts line, the text shows but in a default font. Otherwise, I only get a blank text field.

Just so you know, I've added 3 fonts to my library and named the linkage IDs: "bodyID", italicID" and "headerID". The font type and sizes all match what I've specified in my CSS styles.







Attach Code

this.createTextField("dynamic_txt", this.getNextHighestDepth(), 60, 70, 430, 340);
dynamic_txt.antiAliasType = "advanced";
dynamic_txt.border = true;
dynamic_txt.wordWrap = true;
dynamic_txt.multiline = true;
dynamic_txt.selectable = false;
dynamic_txt.html = true;
dynamic_txt.embedFonts = true;
dynamic_txt.condenseWhite = true;
dynamic_txt.styleSheet = bhrCSS;
dynamic_txt.variable = "vDynamic_txt";

var bhrCSS:TextField.StyleSheet = new TextField.StyleSheet();
bhrCSS.setStyle("body", {
fontFamily:'bodyID',
fontSize:'13pt',
color:'#808080'});
bhrCSS.setStyle("italic", {
fontFamily:"italicID",
fontSize:'13pt',
fontStyle:'italic',
color:'#808080'});
bhrCSS.setStyle("header", {
fontFamily:'headerID',
fontSize:'14pt',
color:'#84ABDB'});

vDynamic_txt = "I'm such an eeeediot!";

View Replies !    View Related
EmbedFonts Woes Pt. II
So, I'm back to haunt! Ok, kglad helped me earlier today by showing me how to apply several styles to one dynamic text field. This is great but part of the reason I couldn't get it to work was because I was using the variable name of the text field instead of the instance name.

But.. if I want to associate a variable from a parsed XML, how do I do that? Don't you have to use the variable name to populate the text field?

View Replies !    View Related
EmbedFonts Problem
Hello,

The Problem.
I'm trying to figure out why my embedded fonts are not displaying. I have a dynamic textfield created using "createTextField" which loads external .htm files. The external .htm file uses the <p> and <h1> tag, which are formatted by embedded style sheets in my actionscript. Everything works fine, except when I try to embed "Century Schoolbook" and "Cooper Black" into my movie in the following code:

[--code--]
_root.createTextField("foodInfo_txt", 100, 5, 5, 390, 75);
with (foodInfo_txt) {
autoSize = true;
selectable = false;
html = true;
multiline = true;
wordWrap = true;
embedFonts = true; <--- when true, my textField is blank!
}
[--/code--]

Solutions I've tried.

Placed a dynamic text field for each typeface on the root stage, adding the character sets needed via the "Character..." button on the Properties panel.
Added each font to my Library item, and exported it in the first frame for actionscript with a linkage ID of "CenturySchoolbookReg" and "CooperBlackReg".


The solution?
Do you know the solution? Is there some conflict with embedded style sheets? It works fine on my system, of course, b/c I have those typefaces installed, but once I add embedFonts = true on my text field, it goes blank! One strange thing I noticed is that the Properties panel has my linkage IDs for my fonts listed in the dropDown. I tried using these for my text fields on the stage, but this still had no effect.

I appreciate your help!
eklemen





























Edited: 03/23/2005 at 11:45:53 AM by eklemen

View Replies !    View Related
EmbedFonts In AS3 Class
I can't seem to find anything to say whether or not I am to use the Class name given when I export the font for Actionscript. I have done that when setting up my styleSheet but it doesn't seem to be working. Is there something new I've missed with AS3?

View Replies !    View Related
EmbedFonts With Multilanguage
Hi, i'm french, sorry for my bad language...

I use a font in a library and i do :
//-------------------------------------------------------
var fontClass:Class = getDefinitionByName( myFont) as Class;
Font.registerFont( fontClass );

//-------------------------------------------------------
then
//-------------------------------------------------------
var font:Font = new fontClass()
var tf:TextFormat = new TextFormat()
tf.font = font.fontName

//-------------------------------------------------------

I use Arial in libray but i can't see russian text for exemple, -> "test проверка"
With fontEmbeds = false i see this entire text but with fontEmbeds = true i see just "test"

How can i do ?

View Replies !    View Related
Problem With EmbedFonts
Hello all,

I am having a problem using embedFonts. It just won't work. At first I thought it was something in my code, but it seems to be working fine except for the embed. So I went through the help doc on it and even using the example code it won't work. I am guessing it must be how I am setting up the font in the library. So here is what I am doing.

In the library, I select New Font... I name the font Pakt an choose the font I am using which is Pakt-Black. Then I use this code:

ActionScript Code:
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "Pakt";

this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160, 120);
my_txt.wordWrap = true;
my_txt.embedFonts = true;
my_txt.text = "Hello world";
my_txt.setTextFormat(my_fmt);




Nothing. So I comment out the embedFonts and the setTextFormat and everything works. So what am I doing wrong here? Thanks!

View Replies !    View Related
[AS3] EmbedFonts Problem
Hey guys,
Probably just a quick fix here, but this embedFonts is driving me nuts. When embedFonts is set to true the font disappears, however when it's not set it's visible. It's a bitmap font too (Everyday).

The code is as follows atm:

ActionScript Code:
var label:TextField         = new TextField();label.embedFonts            = true;label.autoSize                 = TextFieldAutoSize.LEFT;label.antiAliasType         = AntiAliasType.ADVANCED;label.selectable             = false;label.defaultTextFormat     = formatText();

the formatText() function is as follows:

ActionScript Code:
private function formatText():TextFormat         {            var format:TextFormat    = new TextFormat();            format.font                = "Everyday";            format.color            = 0x000000;            format.size                = 10;            format.bold                = false;            return format;        }


and I'm embedding the font with
ActionScript Code:
[Embed(source="Everyday.ttf", fontFamily="Everyday")]
at the start of the class

Any tips?

View Replies !    View Related
EmbedFonts Not Working
I've added the font to my library and set the linkage with export to first frame checked but its not working. Can someone see what I'm doing wrong?


Code:
function labelUpFormat():TextFormat{
var textFormat = new TextFormat();
textFormat.size = 10;
textFormat.font = "Whitney-Bold";
textFormat.align = "left";
textFormat.bold = true;
textFormat.color = lfOrange;
return textFormat;
}

var id = _root.dif.createTextField("id",_root.dif.getNextHighestDepth(),200,200,200,200);
id.embedFonts = true;
id.type = "dynamic";

id.text = "This is my text";

id.setTextFormat(labelUpFormat());
id.selectable = false;

View Replies !    View Related
EmbedFonts Question
Let's say I make a textbox on frame one of my movie and embed a font called "Crazyface-Bold" into that textbox.

Can I create an empty text field at runtime and assign it a font value of "Crazyface-Bold"?

Would that work? The reason I ask is that I only need certain ranges and I don't want to embed a whole font into the library. Creating text fields on the fly is a must though.

View Replies !    View Related
EmbedFonts And HtmlText
Can somebody help me with this?...

I want to embeded a font using linkage, but when I assigned it html format the text just disapeared.

I´m copy the code:

//-----------------[my code] ----------------------//
var mi_fmt:TextFormat = new TextFormat();
mi_fmt.font = "myLinkage_font";


this.createEmptyMovieClip("_mc",1);
_mc.createTextField("_txt",1,0,0,150,150);
var texto:TextField = _mc._txt;
texto.embedFonts=true;
texto.html=true;
texto.htmlText="<b>hola</b> este es un texto htmtl";
texto.setTextFormat(mi_fmt);

//-----------------[my code] ---------------------//

Thank you very much

View Replies !    View Related
AS - EmbedFonts = True; Help Please.
Hi all,

I have encountered a problem with creating a preloader dynamically and trying to embed a font into the textfield. When i set

textfield.embedFonts = true;

it does not work. The whole textfield disapears when i enable embedding. Could anyone please tell me where im going wrong:


ActionScript Code:
// Stop playback right here ;D
stop();
 
// Text field to display percent loaded
_root.createTextField("prc_txt", _root.getNextHighestDepth(), 0, 0, 450, 250);
 
// Percent textfield format settings
var prcFormat:TextFormat = new TextFormat();
prcFormat.color = 0x000000;
prcFormat.align = "center";
prcFormat.font = "Garrison Sans";
prcFormat.size = 100;
prc_txt.text = 0;
prc_txt.setNewTextFormat(prcFormat);
prc_txt.embedFonts = true;
prc_txt.autoSize = true;
prc_txt.selectable = false;
prc_txt.border = true;
prc_txt.borderColor = 0xFFCC00;
 
// Centering the textfield on screen
function placeText() {
    _root.prc_txt._x = Math.round((Stage.width/2)-(prc_txt._width/2));
    //  _root.prc_txt._y = Math.round((Stage.height/2)-(prc_txt._height/2));
    _root.prc_txt._y = Math.round(preloader._height+preloader._y)+3;
}
// Initialize textfield position
placeText();
 
// Setting preloading actions
_root.onEnterFrame = function() {
    var prc:Number = Math.round((getBytesLoaded()/getBytesTotal())*100);
    if (prc<=99) {
        // Update percent display
        prc_txt.text = prc;
        prc_txt.setNewTextFormat(prcFormat);
        centerText();
        // Update surfer outline
        preloader.wave._y = (prc*4.7) * -1;
    } else {
        onEnterFrame = undefined;
        gotoAndPlay(3);
        prc_txt.removeTextField();
    }
};


Thanks to all in advanced.
Rikki

View Replies !    View Related
EmbedFonts - Text Not There, Then There
I'm experiencing an odd issue regarding embedded fonts.

I've created a ton of font .swf movies using swfmill (http://www.swfmill.org/) that work fantastically for dynamically loading only the fonts I need at runtime.

step 1:
load font movies at runtime

step 2:
populate ComboBox component w/ available fonts (a mini font menu)

- this font menu updates a global TextFormat.font based on which font you select

step 3:
create a dynamic text field, embedFonts = true; - put some text in it

The problem:
no visible text
see: http://www.wraevn.com/sample/fontMenu_2.jpg
http://www.wraevn.com/sample/fontMenu_1.jpg)

step 4:
(still running, didn't close movie) using ComboBox font menu change font

The weird:
text appears

I'm not sure what's happening here - sometimes the text DOES appear at load, but it's all garbled, and a literal screen redraw sometimes fixes the problem (e.g. moving something over the text field, then off it again so Flash has to redraw that part)

Usually though, the text simply isn't visible.

I'm checking the TextFormat that gets applied when the dynamic text field is created and it has a valid font

I'm even calling the change event handler for the font menu before the text field is created to ensure that the TextFormat.font is valid.

I've even tried calling the change event AFTER the text was created - all to no avail.

PLEASE HELP!!

... UPDATE ...

So - I threw a sample up on my site so you could see what's going on, but it seems to work! - but only online - not when publishing in the IDE, or viewing via HTML in a browser locally, just online.

http://www.wraevn.com/sample/fontMenu.html

... END UPDATE ...

here's the text creation function

ActionScript Code:
function createText():Void {
    //   
    var question:MovieClip = _root.createEmptyMovieClip("txt_mc", _root.getNextHighestDepth());
    var qText:TextField = question.createTextField("txt", question.getNextHighestDepth(), 0, 0, Stage.width, 100);
    qText.type = "input";
    qText.multiline = true;
    qText.autoSize = true;
    qText.wordWrap = true;
    qText.align = "left";
    qText.embedFonts = true;
    //
    qText.text = _qLipsum;
    //
    question._x = 5;
    question._y = 150;
    qText._width = 230;
qText.setTextFormat(questionTextFormat);
}

View Replies !    View Related
StyleSheet And EmbedFonts
Hi,

is it possible to use them both together?
I use a partly embedded font, wich is in an dynamic TextField in the library, exported for ActionScript.
I can see it with enumerateFonts and use with TextFormat, but no chance with StyleSheet, which shows nothing as soon as I set TextField.embedFonts to true.
Here is what it looks like.

I've attached the files, if anyone may want to have a look on it.

View Replies !    View Related
Problem With Embedfonts
hi all,

i attempted to make a swf with the sample fla from the url,

http://www.macromedia.com/support/flashremoting/ts/documents/scrollpane_textfields/good.fla

the filesize of my swf is over 6.4mb while the original one is 26kb only.

i'm using flashmx pro 2004.

thanks in advance and merry x'mas.

View Replies !    View Related
CreateTextFields & Embedfonts Question
Any one knows how to embed fonts in conjunction with createTextField

so ..

how do I use / get working :

text = new TextField();
or
text2 = createTextField ("t", 1, 10, 100, 100, 200)

fontArray = text.getFontList();

trace(fontArray)

will I use that to find my embedded font and attach it to a textField I create ??

How do I embed fonts .. through a textfield with embed font on or what ??

If anyone can shine some light on this that would be really appreciated !

Nyls

View Replies !    View Related
Textfield.embedFonts Not Working
Hi,

I'm unable to see my dynamic textfields when i use myTextField.embedFonts=true;
Why does this happens?
I need to have my fonts embbebed because i want to mask my textfileds.

View Replies !    View Related
CreateTextField With EmbedFonts Using HtmlText
Hello
I've searched the forum but haven't found the solution or the answer.
Is it possible to use these three options together: to have a dynamic text field with embed fonts and using html text. It seems that embed fonts and html text are not working together. Whenever I turn off one of them the text appears. Is there any solution for this. I am loading text from external txt file with html links in it so I would need this option.

this would be example code
_root.createTextField("mytext", 1, 100, 100, 300, 100);
mytext.html = true;
mytext.embedFonts = true;
myformat = new TextFormat();
myformat.size = 11;
myformat.font = "Verdana";
mytext.setNewTextFormat(myformat);
mytext.htmlText = "<a href="http://www.kdshfsd.com">this is my</a> text";


Thank you

View Replies !    View Related
EmbedFonts=true Fails
Hi everyone: using MX2004, and looping through an array to create mutliple dynamic textfields, my font refuses to embed.

How to I ensure that a font is embedded? Linkage? or what? I've already tried to embed the font through creating a textfield in frame 1 with "embed" is true, and in the library by importing the font and adding Linkage properties ( export for actionscript, frame 1), but its still not working.
code:
// mv is a reference to a newly created moviClip
mv.createTextField("txt", mv.getNextHighestDepth(), 0, 0, 100, 22);
mv.txt.html = true;
mv.txt.htmlText = a[cols];
//
var txtFmt = new TextFormat();
txtFmt.embedFonts = true;
txtFmt.font = "ProFontWindows";
txtFmt.size = 15;
//
mv.txt.autoSize = true;
mv.txt.setTextFormat(txtFmt);

View Replies !    View Related
It Says EmbedFonts=true, But It's Not Happening
i am sure the property embedFonts is in this method, so can anyone tell me why if i rotated this mc, the text goes blank?
i know both the fonts and the css are ready (on a trace) so what else am i missing?

Code:

var mc:UIMovieClip= new UIMovieClip()
mc.addChild(tf);
mc.x=_x;
mc.y=_y;
with(tf)
{
styleSheet=css;
embedFonts=true;

autoSize=TextFieldAutoSize.LEFT;
wordWrap=true;
mulitline=true;
selectable=true;

if(_w != undefined) width=_w;
if(_h != undefined) height=_h;

}
var vs:XML=XML(page_content.text_copy[i].children());
tf.htmlText=vs.toString();
tf.addEventListener(Event.ADDED_TO_STAGE,onstage)
tf.addEventListener(TextEvent.LINK,linkclicked);

View Replies !    View Related
EmbedFonts Strangely Not Working
If I use this code in a blank fla file it works fine. But when I'm using in my class it doesn't work at all. Doesn't show anything. In fact, I put it in my main timeline in the fla and it doesn't even show. It doesn't make any sense.. I'm not even getting any errors. it's the same code. My fla basically preloads images, then preloads an xml file and does this at the same time.

It may be hard not seeing the whole fla/.as, but you would have to sift through a lot of junk. I figure maybe someone may have an idea of why this may not be working.


Code:
var displayTitle:TextField = new TextField(); //this is in the class News

//all this is in the Class init function
var fnt:Font= new FuturaCondensed();
displayTitle.embedFonts = true;
displayTitle.autoSize = TextFieldAutoSize.LEFT;
displayTitle.border = false;
//progressOutput.color=1380EC;
displayTitle.selectable = false;
displayTitle.textColor=0x000000;//blue: 1380EC
displayTitle.x=0;
displayTitle.y=0;
var titleFormat:TextFormat = new TextFormat();
titleFormat.font = fnt.fontName;//here!
//titleFormat.font = "Helvetica";
titleFormat.color = 0x000000; //0x1380EC <--blue
titleFormat.size = 70;
displayTitle.wordWrap = true;
displayTitle.width = 500;
displayTitle.defaultTextFormat = titleFormat;
//myTitle.height=(myTitle.height)*.3;
//displayTitle.height=displayTitle.width=500;
addChild(displayTitle);
displayTitle.text="Hello Everyone!";

View Replies !    View Related
Htmltext / Embedfonts / Textarea
Hi,

I'm sure someone knows this but I've searched all post and the web, tried all suggestions and still no luck ...

I have a textarea that I set to html, I also using Arial embedfonts for which I have created font symbols I export for the actionscript. I am using AS 2.

Unfortunately it will only display the text with embedFonts=false and NOT true.

I have attached the .fla if anyone can help.

Thanks

View Replies !    View Related
EmbedFonts - What's Wrong With This Picture?
Hello,
I'm having problems with embedFonts - the text is not visible. I've added a font to the library called myFont with the appropriate linkage identifier. It is designated as Ariel, pt size 6, with no bold, bitmap, or italic. I've also created a dummy dynamic text field with font set to myFont, pt size 6. Here's the code:


Code:
var tf=node.getMC().createTextField("tf", node.getMC().getNextHighestDepth(), -20, 5, 40, 20);
tf.text=node.getDisplayName();
tf.multiline = true;
tf.wordWrap = true;
tf.autoSize=true;
tf.selectable=false;
tf.embedFonts = true;

var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0x000000;
my_fmt.align="center";
my_fmt.font="myFont";
my_fmt.size=6;

tf.setTextFormat(my_fmt);
//also tried tf.setNewTextFormat(my_fmt) ...to no avail...
Let the comments commence.

View Replies !    View Related
EmbedFonts And Special Characters
Hey all, got a question. I have the Trademark symbol in some text in an XML document. The text eventually gets loaded into Flash and displayed using a font that is embedded via creating a font symbol in the library and using the font from actionscript. All of the text displays fine, in the right font and everything, with the exception of the Trademark symbol. It shows up as a rectangle. Any idea how I can get this character to work also? I have tried having an invisible text field on my stage with that character embedded in it, that still doesn't work...ideas?

View Replies !    View Related
StyleSheet And TextField.embedFonts
Hi,

I'm on a problem since two days and no solution in sight.
I try to use an external StyleSheet with an embedFont. But as soon as I switch embedFonts to true, nothing happens anymore.

The font is embedded in an dynamic TextField on the library (so I can embed parts of the font and doen't have to import the whole font), it's definitively there, I can find it width enumerateFonts and use it with TextFormat. But if you click here, you see the un-embedded TextFields most likely in an alternative Font (wich both are shown correctly on my system), the correct embedded-font TextField with TextFormat but nothing on StyleSheet with embedded font.

Does anyone sees the error?

Here's the code and the files are attached.
thanks.


PHP Code:



import flash.display.Sprite;
import flash.text.StyleSheet;
import flash.text.TextFormat;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;

var cssLoader:URLLoader = new URLLoader();

var myStyleSheet:StyleSheet;
var myTextFormat:TextFormat;

var text1:TextField;
var text2:TextField;
var text3:TextField;
var text4:TextField;

function init() {
    traceFonts();
    initTextFormat();
    cssLoader.addEventListener(Event.COMPLETE, completeHandler);
    cssLoader.load(new URLRequest("css/textfeld.css"));
}

function initTextFormat():void {
    myTextFormat = new TextFormat();
    myTextFormat.font = "Christopherhand";
    myTextFormat.size = 40;
    myTextFormat.color = 0xFFFFFF;
}

function initStyleSheet(cssString:String):void {
    myStyleSheet = new StyleSheet();
    myStyleSheet.parseCSS(cssString);
    traceStyles(myStyleSheet);
}

function initTextFields():void {
    text1 = setTextfield(myStyleSheet, "StyleSheet", false, 0,0);
    text2 = setTextfield(myStyleSheet, "StyleSheet", true, 0,188);
    text3 = setTextfield(myTextFormat, "TextFormat", false, 250,0);
    text4 = setTextfield(myTextFormat, "TextFormat", true, 250,188);

    for (var i:int = 1; i<=4; i++) {
        addChild(this["text"+i]);
    }
}


function completeHandler(event:Event):void {
    var cssString:String = event.currentTarget.data;
    initStyleSheet(cssString);

    initTextFields();
    for (var i:int = 1; i<=4; i++) {
        TextField(this["text"+i]).htmlText = "<span class='header'>| Dorem ipsum |</span>";
    }
    trace("******** TextField-Content:String *********");
    for (var i:int = 1; i<=4; i++) {
        trace(TextField(this["text"+i]).htmlText);
    }
    trace("******************************************");
    trace("");
}


function setTextfield(defaultFormat:*, type:String = "TextFormat", embed:Boolean = true, x:int = 0, y:int = 0 ):TextField {
    var t:TextField = new TextField();
    t.x = x;
    t.y = y;
    t.width = 250;
    if (embed) {
        t.embedFonts = true;
    } else {
        t.embedFonts = false;
    }
    if (type == "TextFormat") {
        t.defaultTextFormat = TextFormat(defaultFormat);
        //trace(t.getStyle);
    } else {
        t.styleSheet = StyleSheet(defaultFormat);
        //trace(t.styleSheet.getStyle("text1"));
    }
    t.antiAliasType = AntiAliasType.NORMAL;
    t.wordWrap = true;
    t.autoSize = TextFieldAutoSize.LEFT;
    t.multiline = true;
    return t;
}



function traceStyles(style:StyleSheet):void {
    trace("****** CSS Data Content ********");
    var styleNames_array:Array = style.styleNames;
    for (var i = 0; i<styleNames_array.length; i++) {
        var styleName_str:String = styleNames_array[i];
        var styleObject:Object = style.getStyle(styleName_str);
        trace(styleName_str);
        for (var prop in styleObject) {
            trace(" "+prop+": "+styleObject[prop]);
        }
        trace("");
    }
    trace("************************************");
    trace("");
}

function traceFonts():void {
    var embeddedFontsArray:Array = Font.enumerateFonts(false);
    trace("****** Show embedded Fonts ********");
    for (var i:uint = 0; i < embeddedFontsArray.length; i++) {
        trace((i+1)+".) fontName: " + embeddedFontsArray[i].fontName);
    }
    trace("***************************************************");
    trace("");
}



init(); 

View Replies !    View Related
MyText.embedFonts... Disappear ?
When I set:

myText.embedFonts=true;

my text disappears... why ?

thanks

View Replies !    View Related
EmbedFonts With Arial - Problem
hi,

my embed font, Arial, looks "blurry"...
my method: createTextField();
placed on whole numbers, registry-point should be top, left (i guess?).

why does this embed font looks so blurry...?
what am i doing wrong?
is any workaround out there avoiding/handling this problem?
i'm working with flashmx.

greets teebee

View Replies !    View Related
EmbedFonts Not Working If Using Same Font Twice
I am having problem importing the same type font more than once.

In Library I imported Arial font twice, but with different size setting:

Name: arial-11
Font: Arial
Size: 11 (size field must be set)

Name: arial-20
Font: Arial
Size: 20 (size field must be set)

For each above font, right click and select Linkage...
Inside Linkage set following properties:

Identifier: arial-11
Export for ActionScript (checked)
Export in first frame (checked)

Identifier: arial-20
Export for ActionScript (checked)
Export in first frame (checked)


In AS:

var paragraphSmallLeft_fmt:TextFormat = new TextFormat();
paragraphSmallLeft_fmt.color = 0x000000;
paragraphSmallLeft_fmt.font = "arial-11";
//
var paragraphLargeLeft_fmt:TextFormat = new TextFormat();
paragraphLargeLeft_fmt.color = 0x000000;
paragraphLargeLeft_fmt.font = "arial-20";

this.createTextField("test1_txt", this.getNextHighestDepth(), 0, 0, 300, 30);
with (test1_txt) {
embedFonts = true;
border = false;
html = true;
wordWrap = true;
selectable = false;
multiline = false;
condenseWhite = true;
htmlText = "Test 1";
_x = 50;
_y = 30;
antiAliasType = "advanced";
thickness = 100;
setTextFormat(paragraphSmallLeft_fmt);
}
//
this.createTextField("test2_txt", this.getNextHighestDepth(), 0, 0, 300, 30);
with (test2_txt) {
embedFonts = true;
border = false;
html = true;
wordWrap = true;
selectable = false;
multiline = false;
condenseWhite = true;
htmlText = "Test 2";
_x = 50;
_y = 60;
antiAliasType = "advanced";
thickness = 100;
setTextFormat(paragraphLargeLeft_fmt);
}

Only one (always only first) text field will appear fine. HELP

View Replies !    View Related
EmbedFonts + CreateTextField = No Cigar :(
I've embedded a font in my library(instance name "Arial") and created a new text field using createTextField. But nothing appears. Here is my code:

ActionScript Code:
this.createTextField("myText", 1, 100, 100, 300, 100);
var myFormat:TextFormat = new TextFormat();
myFormat.font = "Arial";
myText.multiline = true;
myText.wordWrap = true;
myText.html = true;
myText.embedFonts = true;
myText.setTextFormat(myFormat);
myText.text ="Hooray!";




Alternatively, if I create a text field on the stage, give it an instance name of myText, and choose "Arial*" from the font menu, it works perfectly.

Any suggestions?

(Noticed this in the Adobe documentation: "After you've embedded a font in your library, you can use it with a text field on the Stage." Does this mean this method won't work for createTextField?)

View Replies !    View Related
LoadMovie And EmbedFonts Not Co-operating
So I'm attempting to embed a font in a dynamic text field and have run into a little issue with it. Basically at the moment, I've got this sort of thing going on:

- a Font Symbol with linkage ID "sydnie" (that's the name of the font)
- a dynamic text field with instance name "screenText"
- then something like this to make it work:

var fontFixer = new TextFormat();
fontFixer.font = "sydnie";

screenText.embedFonts = true;
screenText.setNewTextFormat( fontFixer );

Now, this actually works perfectly fine. When I export, the font is there and everything looks good. HOWEVER, the movie in question is a small mp3 player for a site that is actually loaded from within another movie (using loadMovie() ) and for whatever reason, the font doesn't get embedded when it's opened from that other movie. I've tried adding the font symbol to the library of the parent movie, but that didn't seem to help anything.

I'm new to the forum, so if this has been covered before, by all means, a link to an existing thread would be perfectly helpful. Any insight?

View Replies !    View Related
EmbedFonts - Can't Make It Happen
Hey,
I've been working on this all day - I am trying to embed a font into a text field and can't seem to find ANY documentation for AS3 on it...big suprise...

anyway

so far I have added the font to my library, set the linkage for actionscript, gave my textField the instance name "my_txt" and added this code to the timeline:

var font_Style:TextFormat = new TextFormat();
font_Style.font = "Font1";
my_txt.embedFonts = true;
my_txt.htmlText = "some testing text";
my_txt.setTextFormat(font_Style);

This doesn't work. But it's all I know how to do.

(when I erase the 3rd line "my_txt.embedFonts = true" it will display the text but not with the text embedded).

Has anyone got this working for AS3 yet?

Thanks for any help at all.

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved