PDA

View Full Version : Flash 8 embedding font is not possible !?


samroni
10-22-2005, 06:31 PM
i tried to embed font in flash 8 but it didn't appear in computer that doesnt have the font.

here's what i did:

- i embed the font, make a new name "acme-15 (embedded)" and add a linkage id "acme-15" ,then i embed the textlayer

//its not working (in flash player 8)

- i even tried to code some "as", then apply the new textformat in the textlayer with var "my_txt"

var text_fmt:TextFormat = new TextFormat();
text_fmt.font = "acme-15";
text_fmt.size = 15;

my_txt.autoSize = "left";
my_txt.embedFonts = true;
my_txt.selectable = false;
my_txt.setNewTextFormat(text_fmt);
my_txt.multiline = true;
my_txt.wordWrap = true;

//its still not working


i figured it out that if you publish in flash 7 or less... the embed is working.

any idea why?

how can i embed font in flash 8?


ps.: you can see the font i embed in the attachment. i published it to 3 different flash player, 6,7 and 8. only flash player 8 that doesnt work with embed font >.<

blue text is not embed. black text is the embeded one.

regards,

www.martinsamroni.com

oldnewbie
10-22-2005, 07:47 PM
http://www.actionscripts.org/forums/forumdisplay.php3?f=72

billingsgate
10-23-2005, 02:09 AM
http://www.actionscripts.org/forums/forumdisplay.php3?f=72

What is this supposed to link to? I would also like an answer to samroni's question. The URL above is incomplete.

oldnewbie
10-23-2005, 02:53 AM
The link I posted only leads to this thread in this Flash 8 general forum.

It wasn't posted here to start with... Some mod must of moved it!

samroni
10-23-2005, 09:02 AM
Thought someone has answered my question ;p...

im still waiting for typo master to help me... my portoflio stuck in this problem =(


ps.: please dont give me link.. i've traveled all over the place looking for the answer. they didnt give any clue how to embed in flash 8. i need answer ^^


cheers

madgett
10-24-2005, 04:00 AM
They all look the same to me, not sure what your issue is. You talking about antialiasing?

jjbilly
10-24-2005, 08:39 AM
Samroni, are you doing all this on the main timeline? I ask because I'm having some weird embed issues too. A component with an embedded font isn't working (fonts not showing) in movies published from Flash 8 (to Flash 7, what they were written in, and in which they work just fine) if there's any other text box (even static) on the stage using the same font. The issue gets cured when I create a new textfield on the stage with outlines embedded for the font used in the component.

aidant
10-26-2005, 05:24 PM
I had the same problem. Check the "linkage" for your font "acme-15" in the library. I found that I needed to check the box "Export in first frame" for the font to show up in Flash 8, while it seems to work fine with that unchecked in Flash 7.

Shaman
10-28-2005, 08:06 AM
Very often this happens with the export of handwritten fonts, like "Kids", etc. But when you change the font to some another e.g. Arial or any standard system with the same export settings then everything works fine. I guess that Flash has problem with handling of some exotic fonts

spi
10-28-2005, 01:26 PM
exotic or not, it doesn't work properly. Fonts and Flash...:mad:

specifying ranges (eg only numerals) doesn't work even for verdana!
yet it does for Arial.

_Jay
11-03-2005, 02:29 AM
I'm having the same problem.. my fonts aren't showing up when I publish a movie.. has anyone figured this out yet?

Using Flash 8 here.

keldon
11-03-2005, 02:59 AM
I have always been able to embed fonts for a dynamic textfield by simply selecting the 'Embed...' button in the properties panel and selecting what part of the font I wanted to embed.

That seemed to stop working in Flash 8.

I am working on a project that absolutely has to be Flash 8 and absolutely has to have fonts embedded and ideally 'anti-alias for readability...' feature on top of it all.

I struggled and struggled until I tried unchecking the 'Auto kern' checkbox.
Voila - it works.

This counts as a bug in my book.

Here are keywords for the spiders:
Flash 8 7 font embedding problem solution fixed embed dynamic

Happy Happy,
Keldon

_Jay
11-03-2005, 03:05 AM
I may have to change to all Dynamic text because I'm trying to get it to work in static text and it's not working.

[EDIT:] I just changed the drop down box where it says "Use device fonts" to "Anti-alias for readability" and poof it worked!

hangalot
11-03-2005, 01:29 PM
alot of the time the metrics for the font is screwy, opening it in fontographer and wacking it about in there and then exporting it as a ttf does help a lot.

L_RZA
11-03-2005, 08:03 PM
hmm, dunno if this will sound dumb .. but here goes ..

If I have any trouble with font in Flash [no matter which version] I simple break the thing apart, twice. Until it is a 'fill' [no rhyme intented] Then you never have trouble again ..

Although, myself, cant see why you'd be embedding, I dont think you really need to do that in Flash 8. Try changing your font setting in the properties panel "Anti-Alias for readibility"

jjbilly
11-04-2005, 10:12 AM
@L_RZA

Yes, that works, the problem is when you want your text dynamic - if you have an input box, or text that gets set by your script. Then you need to embed the font so that it's available for the client.

subsomatic
11-14-2005, 03:19 PM
I have tried all things suggested on this thread, and everything else I can find on the web so far.

I have changed all settings, I have clicked all buttons and I can't seem to get these fonts to show up.

I tried breaking apart the fonts but it looks....not so good....

Has anyone discovered a SOLID solution to this? I'm tempted to just go back and use flash 7.....

subsomatic
11-14-2005, 03:26 PM
I have tried all things suggested on this thread, and everything else I can find on the web so far.

I have changed all settings, I have clicked all buttons and I can't seem to get these fonts to show up.

I tried breaking apart the fonts but it looks....not so good....

Has anyone discovered a SOLID solution to this? I'm tempted to just go back and use flash 7.....


Ok - 2 minutes later I find this:

Note: When text is animated, the player turns off advanced anti-aliasing to improve the appearance of your text while it's moving. After the animation is complete, anti-aliasing is turned back on. Subpixel rendering is also disabled for fields with advanced anti-aliasing when they are cached as bitmaps, have a filter applied to them, or are drawn into a BitmapData object.

from http://www.macromedia.com/devnet/flash/articles/graphic_effects_guide_07.html

What I did: set the anti-aliasing for a dynamic text box to something OTHER than anti-alias for readability. Then I switched to this option once the textbox was created.

This seems to work, but considering no one else fixes helped me, I don't know if this is a solid solution or not....

Best of Luck.

subsomatic
11-14-2005, 03:31 PM
I have tried all things suggested on this thread, and everything else I can find on the web so far.

I have changed all settings, I have clicked all buttons and I can't seem to get these fonts to show up.

I tried breaking apart the fonts but it looks....not so good....

Has anyone discovered a SOLID solution to this? I'm tempted to just go back and use flash 7.....


I should also note - as soon as I embed the font, it doesnt work anymore.

????????

madgett
11-15-2005, 12:50 AM
@samroni

In your zip file, every version: 6,7,8 are all working perfectly...I'm not seeing what your issue is...

madgett
11-15-2005, 01:07 AM
Here is a dynamic example of embedding fonts in Flash 8, only thing in the library is the Book Antiqua font with Font as the linkage identifier:

1ok
11-17-2005, 12:49 PM
I have another weird problem. The fonts doesnīt appear on my IE, but on Firefox itīs ok. All fonts (static, dynamic).

My friend has exactly the same IE version and the website looks good on his machine. Any ideas?

MarcD
11-18-2005, 08:05 PM
This may or may not be the issue with some of the above, but Macromedia mentioned this issue between Flash Players 7 and 8 at http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=144b4be2&pss=rss_flash_144b4be2

Basically, I needed to close out all of my IE browsers after the update to Player 8 and then reopen. Everytime I viewed a new flash 8 page on a computer that had not yet upgraded to the Flash 8 player, it would prompt the browser to upgrade (which we did) and then it would display the new Flash 8 page - WITH NO TEXT.

On each computer, however, after closing out of every browser window and then going back to the webpage, the text was there. It took closing out of the browsers apparently to refresh the Flash Player 8 text engine completely.

Seemed to work on every PC in our office at least.

- Marc

madgett
11-18-2005, 08:18 PM
This is what you have to do with Internet Explorer that has Flash Player 7, it's one of those things with IE...on the other hand, with firefox it is an immediate change and all works properly.

If the computer doesn't have the flash player and you use IE it asks to be downloaded and then it works with no problems without having to close the browser. Trying to explain to a client that they might have to close and reopen the browser is usually what the case is 90% of the time for cases like this in my experience and it's the last thing people usually think of.

1ok
11-18-2005, 11:02 PM
Thatīs it. I tested on my computerīs house and it seems to be a player version problem. But I could never imagine that on my PC at work īcause I have already installed Macromedia Flash 8!

Isnīt it supposed to automatically install the player8?

samroni
11-19-2005, 12:43 AM
sorry not been active all this time... im moving to a new address...

heres the thing: embed is just not working in flash 8. prove: show me if you can embed it in flash 8... use any font that is very weird and exotic i might say... make it animated... and let see if its working


i use player 8.


=)

lionseyeball
12-14-2005, 08:28 PM
This is really causing me some headaches. Here's what I did.

Create a new .fla. In frame one, layer 1:
-type the action: textaluscious_txt.text = "Hi";
-place a dynamic text field on the stage.
-set it to Arial 14, color is black, center justified.
-name it textaluscious_txt
-click the Embed... button and select "All (39477 glyphs)" (after trying just the characters 'H' and 'i')

test movie and nothing appears.

Then I go back and click the Embed... button and select "Don't Embed."

text movie and "Hi" appears.

In real life, I've got a movieClip acting as a button with a custom class attached to it. The class has an init(label, etc...) function that is putting the label on the button. I have no way of telling what the labels are going to be, or even how many buttons there will be, so I have no options but to use dynamic text with embedded fonts for non-crapiness.

Never should have updated.

Is it just a coincidence that MM's web site looks like crap all of the sudden (missing graphics, etc) and Flash doesn't work at the same time that Adobe is rearing it's head as the new owner? I like Adobe, they are my second fav software manufacturer, but a mega-corporate merger is bound to have some hickups. Hopefully that's all this is!

mike

theelephantwords
12-16-2005, 01:33 PM
on http://h108design.com i use flash 8, and a font called 'letterman-solid'


it's all dynamic, coming in from an xml file, with css. of course, the letterman-solid font is defined in flash as i embedded the appropriate glyphs. i don't use the 'export in first frame', and the font isn't defined in the library, personally i think that way is too clunky.

if you click on animation, and then on any movie, you get a movie player with text on the side which is coming in from the xml, is formatted, is masked, and moves.

theelephantwords
12-16-2005, 01:41 PM
This is really causing me some headaches. Here's what I did.

Create a new .fla. In frame one, layer 1:
-type the action: textaluscious_txt.text = "Hi";
-place a dynamic text field on the stage.
-set it to Arial 14, color is black, center justified.
-name it textaluscious_txt
-click the Embed... button and select "All (39477 glyphs)" (after trying just the characters 'H' and 'i')

test movie and nothing appears.

Then I go back and click the Embed... button and select "Don't Embed."

text movie and "Hi" appears.

In real life, I've got a movieClip acting as a button with a custom class attached to it. The class has an init(label, etc...) function that is putting the label on the button. I have no way of telling what the labels are going to be, or even how many buttons there will be, so I have no options but to use dynamic text with embedded fonts for non-crapiness.

Never should have updated.

Is it just a coincidence that MM's web site looks like crap all of the sudden (missing graphics, etc) and Flash doesn't work at the same time that Adobe is rearing it's head as the new owner? I like Adobe, they are my second fav software manufacturer, but a mega-corporate merger is bound to have some hickups. Hopefully that's all this is!

mike


i did exactly what you did, and i got 'hi' to show up with the embedded font. are you setting 'textaluscious_txt' as the instance name or the variable? because it should be the instance name. if that doesn't work, i really have absolutely no idea why that's not working for you. it's a simple code that should work. maybe try reinstalling flash? restarting your computer? and you can set your labels in its own class and have them come in to your init so you know what you're dealing with, as a way to get around this thing.

lionseyeball
12-19-2005, 02:17 PM
Thanks guys, as you can imagine this is driving me nuts. I think I figured it out. I haven't reinstalled Flash yet, that might fix it.

This is a new quirk to Flash 8 (or atleast my install of Flash 8). When I embed fonts, it won't embed the bold or italic characters. My textaluscious_txt dynamic text field is set to bold and italic in the properties inspector. If I unbold and unitalicize the text field it works. Apparently the bold and italicized glyphs aren't embedded, and that's why they won't show up? I'm not the only one out there with this issue, and people seem to be fixing it by unchecking and rechecking various settings in the text field properties, which indicates to me that it is a bu... quirk in Flash 8.

mike

decent_scorp
12-19-2005, 02:21 PM
i tried to embed font in flash 8 but it didn't appear in computer that doesnt have the font.

here's what i did:

- i embed the font, make a new name "acme-15 (embedded)" and add a linkage id "acme-15" ,then i embed the textlayer

//its not working (in flash player 8)

- i even tried to code some "as", then apply the new textformat in the textlayer with var "my_txt"

var text_fmt:TextFormat = new TextFormat();
text_fmt.font = "acme-15";
text_fmt.size = 15;

my_txt.autoSize = "left";
my_txt.embedFonts = true;
my_txt.selectable = false;
my_txt.setNewTextFormat(text_fmt);
my_txt.multiline = true;
my_txt.wordWrap = true;

//its still not working


i figured it out that if you publish in flash 7 or less... the embed is working.

any idea why?

how can i embed font in flash 8?


ps.: you can see the font i embed in the attachment. i published it to 3 different flash player, 6,7 and 8. only flash player 8 that doesnt work with embed font >.<

blue text is not embed. black text is the embeded one.

regards,

www.martinsamroni.com
i guess problem in:
.autoSize = "left"

it must be any boolean value.

Ruben
12-19-2005, 02:59 PM
Dear decent_scorp, autoSize doesn't need to have a boolean value at all. In fact when you give it a boolean value flash will translate it to either "left" (when true) or "none" (when false).
Read up on it in the documentation (http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary729.html).

:) - Ruben

lionseyeball
12-19-2005, 03:37 PM
Okeedokee... I reinstalled Flash 8 from the CD this time instead of the downloaded file and it still doesn't work.

The question of the day is: Can anyone out there using Flash 8, publishing to Player 8, on XP Professional, embed a font and then display dynamic Arial text that is bold or italicized when testing the movie in Flash? I'd hate to have to go back to MX 2004 or publish in Player 7!

mike

lionseyeball
12-19-2005, 04:30 PM
New lessons learned: If I manually create a dynamic text field with embedded fonts (embedded through use of the "embed..." button in the text field properties window) I can see bold and italic text in flash player 7, but not in 8. If I create my text field with AS I can't get it to display embedded fonts at all, bold or not, in player 7 or 8.

Part of my problem is probably that I'm new to using actionscript to create my text fields. Here are the tests I've been doing. All of the code is on layer 1, frame one, of the main timeline. The manual_txt field is on layer 2 and has the same settings as AS_txt, but they were set manually through the propeties window:

//this doesn't format the AS_txt text until I click the button -whether publishing top down or bottom up, player 7 or player 8.
______________________________________
var simple_fmt:TextFormat = new TextFormat();
simple_fmt.color = 0x000000;
simple_fmt.font = "Arial";
simple_fmt.align = "center";
simple_fmt.bold = true;
simple_fmt.size = 14;

this.createTextField("AS_txt",1,0,20,131,40);
AS_txt.border = true;
AS_txt.selectable = false;
AS_txt.setTextFormat(simple_fmt);

AS_txt.text = "Hi";
manual_txt.text = "Hi";

button.onRelease = function(){
this._parent.AS_txt.setTextFormat(this._parent.sim ple_fmt);
}
______________________________________

If I add:
AS_txt.embedFonts = true;
I don't see any text in AS_txt whether I click or not. Even simplified to this level it doesn't put text into AS_txt, but it still shows up in manual_txt:

______________________________________
var simple_fmt:TextFormat = new TextFormat();
simple_fmt.color = 0x000000;
simple_fmt.font = "Arial";

this.createTextField("AS_txt",1,0,20,131,40);
AS_txt.embedFonts = true;
AS_txt.setTextFormat(simple_fmt);

AS_txt.text = "Hi";
manual_txt.text = "Hi";
______________________________________

//Take away embedFonts, and the text appears in both fields, but simple_fmt isn't applied:

______________________________________
var simple_fmt:TextFormat = new TextFormat();
simple_fmt.color = 0x000000;
simple_fmt.font = "Arial";

this.createTextField("AS_txt",1,0,20,131,40);
AS_txt.setTextFormat(simple_fmt);

AS_txt.text = "Hi";
manual_txt.text = "Hi";
______________________________________

What simple bone-headed mistake am I making here? All help is greatly appreciated.

-mike

acolyte
12-20-2005, 09:24 AM
Hello all


http://www.actionscript.org/forums/showthread.php3?t=90908

www.mat3d.com/txtefx.html (http://www.mat3d.com/txtefx.html)

/ if you can see the text if you press one of the black btns the font is embedd correctly / nevermind about the txt this is dummy txt /




_content_1 = new XML();
_content_1.ignoreWhite = true;
_content_1.load("styles/content.xml");
_content_1.onLoad = function(success) {
if (success) {
// Create some HTML text to display
var css_styles = new TextField.StyleSheet();
css_styles.load("styles/txtstyles.css");
css_styles.onLoad = function(ok) {
if (ok) {
// display style names
trace(this.getStyleNames());
trace("CSS loaded");
_level0.txtefxriser.dyntxt.html = true;
_level0.txtefxriser.dyntxt.autoSize = true;
_level0.txtefxriser.dyntxt.styleSheet = css_styles;
_level0.txtefxriser.dyntxt.background = true;
_level0.txtefxriser.dyntxt.backgroundColor = "0xFFFFFF";
_level0.txtefxriser.dyntxt.selectable = false;
} else {
trace("Error loading CSS file.");
}
};
}
};



regards m@

lionseyeball
12-20-2005, 03:43 PM
So, you deleted the text box and put a new one in another frame, set embedFonts to true, and it worked? I wonder how the technical writers would phrase that in the Flash 8 documentation;)

What happens if you try to bold or italicize some of that text, or use a different font? On my machine, the font I see looks like the _serif machine font, hinting that maybe it really isn't embedded.

mike

150tek
12-22-2005, 04:07 PM
Just in an effort to keep this post alive, I, too, have discovered the problem with embedding fonts in Flash 8. Being that I'm a relatively new actionscript junkie, what would the more experienced lot of this group say is the best route to take until adobe/macromedia figure this lil' obstacle out?

I've desgned the majority of my site thus far in Flash 8. Should I go and redesign it all back in Flash 7? And even if I did, would the general public that has the latest Flash viewer installed still not be able to see my embedded fonts?

ughhh, so close to an actual finished project and Flash pulls an Emeril.

Bam! :-)

lionseyeball
12-22-2005, 04:13 PM
I'm watching this thread closely, also. This is the first time I've had Flash give me a BAM like this. I've only been using Flash for two years, but that's a long time to use a complicated piece of software all day, every day, and not have at least one insurmountable problem -to MMs credit. Let's see how Adobe handles this one!

mike

acolyte
12-22-2005, 04:25 PM
Dear decent_scorp, autoSize doesn't need to have a boolean value at all. In fact when you give it a boolean value flash will translate it to either "left" (when true) or "none" (when false).
Read up on it in the documentation (http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary729.html).

:) - Ruben

Well >>>> heheheheHAHAHA Ruben

i doesnt sit 2 Week in front of my computer to find it out just about a few Hours over 2 Weeks not 2Weeks the whole time :)

Ruben
12-22-2005, 05:13 PM
i doesnt sit 2 Week in front of my computer to find it out just about a few Hours over 2 Weeks not 2Weeks the whole time :)Buahahahahaha, that phrase's so confusing I'd almost replace my current signiature.. hahaha

:p - Ruben

acolyte
12-22-2005, 08:37 PM
hahahahahahhhahhhahhahhahha DUDE i laugh my arse off ok
until i get a lungparalaxys

acolyte
12-22-2005, 08:44 PM
So, you deleted the text box and put a new one in another frame, set embedFonts to true, and it worked? I wonder how the technical writers would phrase that in the Flash 8 documentation;)

What happens if you try to bold or italicize some of that text, or use a different font? On my machine, the font I see looks like the _serif machine font, hinting that maybe it really isn't embedded.

mike

R U SERIOUS ?????????????????

i didnt checked it on any other machine until now
but i seriously embedd this fonts to this textframe ok :eek:

btw i got to say something in addition :

This isnt a Bug as you view my Page all static Pixelfonts are embed just fine ( i use the f8 Compiler )expect the Textframe in the Middle.
Thats because it is Css Styled and thats also why the embed fonts not working . I checked it out with MX 2004
and its not working either .Seems to be a limitation here that you can`t animate Css styled Markuptext.

>>>Edit >>>> : i tried with the wrong cssfile with fontfamily set / no wonder why it wont work :o :p

of cource you can animate css styled text

cheers Acolyte

150tek
12-30-2005, 01:13 AM
Not to be a lagging burden re: this topic, but with all the many posts -- I have yet to discover a cure for this problem!

Could someone please share with us a working solution for Flash 8 not being able to embed fonts correctly?

--Is the best option to revert back to MX 2004 pro?

Pleeeeeeeease pleeeasee help!

knees
01-02-2006, 06:32 PM
Has anyone had a problem where even regular fonts in Flash 8 display improperly on screens set to less that millions of colors (32 bit)? The text fields are covered with cross-hatching. It happens on my website: www.thesteamboatproject.com . Is there a workaround for this?

billingsgate
01-03-2006, 01:03 AM
Has anyone had a problem where even regular fonts in Flash 8 display improperly on screens set to less that millions of colors (32 bit)? The text fields are covered with cross-hatching. It happens on my website: www.thesteamboatproject.com . Is there a workaround for this?

I'd be glad to look, but no matter how many times I try, my browser gets stuck on your detectiontest page. I'm using Internet Explorer in Windows 2000. I have all the latest updates and patches for everything, including Flash 8 player. It never advances beyond your blank grey detectiontest page.

knees
01-03-2006, 07:48 AM
That is upsetting to hear! Ugh. I've spent days here trying to implement a streamlined Flash detection method. I'm using client side scripting and am pretty much just using what comes in the sample html file in the Flash Detection Kit, except for my content, alternate content, and no-script content.

Do you have javascript disabled? Ugh, but even if you do have javascript disabled another page should come up to tell you that.

I'm using Mac OS X with Firefox and Flash 8. It loads fine for me.

I just tried in Internet Explorer, Opera, and Safari: all just display the blank gray page.

Has anyone had this problem with client side detection?

knees
01-03-2006, 08:08 AM
Okay, it was a simple problem with the html. Works on all the browsers I can download now, but I can't test for windows.

Still, you need millions of colors to have the font display correctly. How do I get around that?

jjbilly
01-03-2006, 08:57 AM
Looks fine to me at 16 bit (I can go no lower). If you're still having a problem (that high) is there a specific place I should look?

knees
01-03-2006, 09:12 AM
That is great to hear. What OS and browser are you using? So far the fonts have failed to display properly on my iBook 12" at 16 bit and on a Windows XP home made machine at the same res.


This goes for any font on the website other than the main logo, which is a graphic.

jjbilly
01-03-2006, 09:59 AM
That is great to hear. What OS and browser are you using?

IE6.0 on XP professional.

knees
01-03-2006, 12:02 PM
I've found the problem only happens when I use both anti-alias for readability AND embedding. I don't have the millions of colors problem if I just use one or the other, but the font doesn't look very good unless I use both.

So, again, why does the display need millions of colors when both anti-alias for readability and font embedding are enabled?

Is there a way around this?

See for yourself: www.thesteamboatproject.com

loot001
01-22-2006, 03:34 AM
yeah, this embed issue IS a bug. i was trying to use flash 8 to embed Futura Light in a dynamic text box. worked fine in 7. but when i published from flash8 the text box showed in generic Times. I tried a whole bunch of diff. combinations of embed font. no luck. finally i put another text box on the _root layer and did the same thing and tested it and it finally works. but not before i had some issues in clearing the cache in IE, Firebox and Safari.
anyways, maybe part of the issue was the cache??

loot001
01-22-2006, 03:37 AM
not sure what i did , but finally it is working using anti-alias for readability AND embed font for uppercase, lower, numerals. i tried all glyphs, but that sucks -- added 120k to my file. seems like it is something in embedding, and then Not embedding and then embedding again??

Mortimer Jazz
01-24-2006, 09:44 PM
There are a couple of things to be aware of when you're mixing HTML/CSS and embedded fonts - these are worth remembering whenever you encounter strange Font problems in Flash.

Think of how normal HTML pages work - HTML doesn't embed fonts, it utilises what fonts the user has on his/her computer, which is why you need to specify a family of possible fonts in your CSS file - if the client's machine doesn't have one of them, it will use another one from the family instead.

Now think about what you are trying to do in Flash. Flash does support HTML text, but if you embed a font in a Flash textbox you are telling it to use that font and that font only. If you then apply CSS which specifies a "font-family", you are giving Flash conflicting instructions - you are saying "Use this particular embedded font ..oh, and here's a choice of fonts to use as well".
The result? It will usually display nothing at all. To get around this problem either do not specify a font-family in your CSS at all, or if you really want to specify a font-family, the *only* name in it must be the name of the embedded font.

For the same kind of reasons as mentioned above, normal HTML pages can easily display the normal, bold or italic version of a particular font together in one TextField. However, when you embed a font in Flash you usually choose to embed the normal version only - the bold and italicised versions are not embedded and so will not show up when you have HTML mark-up specifying bold or italicised text amongst normal text.

This is a bit of a problem because [to my knowledge] Flash is only designed to allow you to specify one embedded font per TextField. However, there is a workaround...

First, you embed the font you want to use, in the usual way. Next, create a couple of TextFields somewhere on the main timeline at author-time. In one, manually embed the bold version of that desired font (ie embed the font and then click the "B" button on the properties bar). In another, embed the italic version. Now you can have HTML mark up which displays normal, bold and italic text.

I hope some of this helps.
Cheers,
Neil

subsomatic
01-25-2006, 05:47 PM
I posted on this thread a long time ago and just thought that I would updated by saying:

The only time I was having trouble embedding fonts in a textbox was when I was trying to edit files that had originally been created and saved in Flash MX.

I know this isn't an answer to the problem, but at least it might help narrow down what the problem is ????

And if this is just a problem I'm having - ignore this post!

goliatone
01-27-2006, 05:07 PM
never seen a thread this long, and with so little info thats worth a post. A few interesting links...

im afraid, my post will be info-worthless. just want to keep posted.

jjbilly
01-30-2006, 08:15 AM
just want to keep posted.

Do you know you can subscribe without posting, by choosing Thread tools > Subscribe to this thread?

Cheers.

Ruben
01-30-2006, 08:41 AM
Tell me, what's the use of posting this in here jjbilly?

:confused: - Ruben


EDIT: My apologies jjbilly, I now see that you were referring to goliatone's post.

Mortimer Jazz
01-30-2006, 08:50 AM
never seen a thread this long, and with so little info thats worth a post.
Hi goliatone. That's a very subjective opinion.

I receive a lot of emails from people who have been struggling with font issues for days. Some of them could have solved their problems by reading through this thread instead of emailing me. To me, that indicates that this thread is a valuable resource.

I would also like to point out that we welcome anyone who makes an attempt to answer questions here. Yes, hopefully all threads will end with resolution, but provoking discussion is also good. I've been moderating these forums for years, and have seen some of the most useful threads evolve over time, and some of the best posters are those that have built up their knowledge through active participation.

It does not add any value to the forums if you simply rubbish a post. You are of course welcome to your own opinions, but it seems a little churlish to voice them publicly. I see you have quite a few posts under your belt, and I'm sure many have been of benefit to the forums. I hope you continue to focus on those in the future :]

As jjbilly points out, you can subscribe to a thread without posting.

goliatone
01-30-2006, 11:57 AM
edit:quote included
As jjbilly points out, you can subscribe to a thread without posting.

hehehe easy people, eaasy... :rolleyes:
ofcourse it was a personal and subjective opinion. now that im re-reading my post, it was as well unfortunate (not funy).
:o so sorry.
If i was meaning that it was a no good post, why would i like to be posted?




------------------------------------------------------------------------
i just upgraded to flash 8, so far i have the feelingthat a few things has changed, like how you deal with bitmaps now and how different is the feeling i have with fonts.
i started reading the post just with that in the back of my mind. So far, i just been using verdana in the past projects, with no need to embed fonts so i didnt find any issues.

Mortimer Jazz
01-30-2006, 01:02 PM
edit:quote included
If i was meaning that it was a no good post, why would i like to be posted?
Heh, I did wonder ;)
If I misunderstood what you were inferring then I also apologise :)

clinch
02-08-2006, 02:48 PM
I've had problems using Dynamic text within components. Fonts were not displaying properly.

I've blogged about my findings here: http://typo.chrisinch.com/articles/2006/02/08/flash-components-missing-fonts

I was finding that only parts of my font sets were showing up. I've posted a few potential solutions.

Mortimer Jazz
02-08-2006, 03:21 PM
Hey Clinch.
I read your blog post.

I couldn't replicate the problem using a very basic setup (dynamic TextField with a>p lower-case embedded, inside mc -> converted to swc -> dragged in to a new movie which has static TextField with some of the same chars in it)

Perhaps it's another Stage of your component development which is causing the issue? Note, I'm not using the V2 framework here and my MC is not linking to any class - it has also been placed on Stage at authortime.

I've attached the fla so you can check if my fla works for you (and exclude the possibility of a player issue). I tested it via the standalone player, IE and Firefox (all player versions 8.0.22)

Have you double-checked the export setting for the other Movie to make sure it is also set to F8?

Let me know how you get on.

Cheers,
Neil

pl_ato
02-14-2006, 04:18 PM
I just spotted this thread, usually I read formus and never join them, But I felt so outraged that I had to post something about what MM has done in F-8.

Ok so the problem as many of you have pointed out is you can't generate text, with the proper font setting. the simplest example I can think of: create a MC in the MC create a dynamic textbox give it anyInstancename, then try to generate a simple text command in the MC actions,

onClipEvent (load){
this.anyInstancename.text = 'MM really pounded the pooch on this one"
}

if your textbox was BOLDED, Italisized nothing will appear. the moment you remove bolding and the italics BAM! it all work as it should. I know this was already mentioned before, I tried to work out how to solve the problem, and the only way I could solve this was to publish my flash as F-7 then it all works great. you don't have to reinstall MX, but your work may have to be published as 7 if you want to generate nice fancy text.

-I thought I would never say anything bad about Flash .. but man ohh man I was pissed.

acolyte
02-14-2006, 05:31 PM
Hi Plato,

for me embedding fonts in Flash 8 works just fine ;)

It is also possible to animate css styled html Markup out of a xml cdata Node

cheers aco

/ i thought it is a bug but instead it was my sloopy kind of handling my .css file
well i used the one with font-family set

yeezhak
02-18-2006, 09:50 PM
First, I am very new to actionscripting, I may need some extra explaining on things.

Here is the setup:

My flash file has a tree component that loads data from an XML file (an .as file is also used making the tree component and the xml file work properly).

On the 1st frame of my fla file my actionscript includes this:

_root.menuTree_mc.menuTree._alpha = 00;
_global.style.setStyle("backgroundColor", "undefined");
//_global.style.setStyle("defaultLeafIcon", "nullicon");
_global.style.setStyle("folderOpenIcon", "nullicon");
_global.style.setStyle("folderClosedIcon", "nullicon");
_global.style.setStyle("disclosureClosedIcon", "nullicon");
_global.style.setStyle("disclosureOpenIcon", "nullicon");
_global.style.setStyle("textRollOverColor", 0xABAE8F);
_global.style.setStyle("textSelectedColor", 0xABAE8F);
_global.style.setStyle("color", 0xFFFFFF);
_global.style.setStyle("textIndent", 5);
_global.style.setStyle("indentation", 15);
_global.style.vScrollPolicy = "auto";

On my AS file I have the following:

//menuTree.setStyle("embedFonts", true);
menuTree.setStyle("fontFamily", "Silkscreen");
menuTree.setStyle("fontSize", 8);

When I enable the embedFonts line of code then nothing shows up in the component (yet I can click where something would be and actions still work).

I have uploaded my ttf font to my server, and embeded the silkscreen font in the library with the linkage name "Silkscreen" as well as the first two boxes checked, and href to the ttf typed in.

Thank you for your help. I have spent weeks on this looking at every semi related post to my problem.

If I can supply an further information just let me know!

Mortimer Jazz
02-19-2006, 07:04 AM
Hi yeezhak, welcome to the forums.

Right-click on your font-symbol in the library, select "linkage..." then choose "export for actionscript" (which will automatically select "export in first frame") and will also make the two top input fields selectable. Give it an identifier of 'Silkscreen' (ie using the top input field).

The method you used for your font is for when you're manually placing a TextField on Stage and then selecting a font from the properties panel's dropdown list. As you're setting the font dynamically, I believe it needs to be exported as I described above.

I also noticed a typo in your above code (setting the alpha to 00) - I didn't use all your code, so just in case I missed something else, here is the code I wrote to check it all worked:

stop();
var myXML = new XML();
myXML.ignoreWhite = true;
myXML.parent = this; //quick scope workaround
myXML.onLoad = function(s){
this.parent.setupTree();
}
myXML.load("tree.xml");

function setupTree(){
menuTree.dataProvider = myXML.firstChild;
menuTree.setStyle("embedFonts", true);
menuTree.setStyle("fontFamily", "Silkscreen");
menuTree.setStyle("fontSize", 8);
}

yeezhak
02-19-2006, 11:25 PM
Mortimer Jazz,

Thank you for your reply to my post, I appreciate it greatly. I have attached a zipped folder with an example fla, xml, and .as file along with the silkscreen font. If you run the swf file you will see how I want the Tree to function and look. As I couldn't get what you posted to work (probably because I didn't know if it was supposed to be on the .as file or the 1st frame of my fla as well as other factors on my side) would you be so kind as to check the .as file and see how your coding could be integrated or tweak mine so it works correctly. I did setup the linkage properly in the library for the font. Note that when the embed font code is active, nothing shows up in the tree.

Thank You,

Mortimer Jazz
02-20-2006, 08:46 AM
You're setting the font colour to white ;)
_global.style.setStyle("color", 0xFFFFFF);

Mortimer Jazz
02-20-2006, 09:09 AM
Hey yeezhak, there was one other thing that may be worth mentioning here

Change all "root" calls to "this.menuTree" - try to avoid using "_root" completely. It breaks encapsulation, and is generally regarded as a bad thing.

yeezhak
02-20-2006, 03:59 PM
Mortimer Jazz,

Yes I know I am setting my font color to white, my background is dark, so the text will be visible. I aslo made all the changes to the "_root" code. However, my Silkscreen font still dissappears when I enable:

this.menuTree.setStyle("embedFonts", true);

I just noticed, that if that line is in the .as file which doesn't have a library (and can't to my knowlege), How can it embed something it doesn't have? Shouldn't that coding be on my .fla file where that font symbol is in the library?

The one line responses are very confusing. I'm not following your thought.
Thanks for your effort and assistance.

(attached files are on page 7 on my second post)

Mortimer Jazz
02-20-2006, 04:33 PM
Attached is the working version (I embedded comic_sans, as I didn't want to install your font on this work machine).

Yes I know I am setting my font color to white, my background is dark, so the text will be visible.
From what I can see in your file, the component's background is always white, so you have white text on a white background. You have a dark background behind that. Am I missing something?

How can it embed something it doesn't have? Shouldn't that coding be on my .fla file where that font symbol is in the library?
No, your class is associated with the MovieClip which contains the component. It is fine where it is

yeezhak
02-20-2006, 04:40 PM
The components background IS white, but I set the alpha to 0.
The text still appears at 100% alpha. I disabled the leaf icons, so just the text is visible. If you exported a swf from the fla file I attached, this would be clear. You could substitute any font in the fla file if you didn't want to install the Silkscreen font.

My whole goal is to load xml menu data to a tree component like structure that would only have the text visible, as I have a complex background color gradient, with a complex shadow gradient over the text. I can refer you to an example online if needed, but more or less the attachments work the same.

Thanks.

Mortimer Jazz
02-20-2006, 08:02 PM
The components background IS white, but I set the alpha to 0.
The text still appears at 100% alpha. I disabled the leaf icons, so just the text is visible. If you exported a swf from the fla file I attached, this would be clear. You could substitute any font in the fla file if you didn't want to install the Silkscreen font.

Thanks.
The component I attached in the above post will work with an embeded font, but the background is still visible

You were setting the entire component's alpha to "00" (sorry I thought this was a typo, and that it was meant to be "100"). It would be incorrect to change the visibility of the entire component, however, with this particular component it turns out that there are major problems anyway.

The Tree uses an instance of the List component. This line of code makes the background transparent, but you lose all mouse events

_global.styles.ScrollSelectList.setStyle("backgroundColor", "false");


Looks like Macromedia is aware of this, and I've yet to find a decent hack on the forums or on Flashcoders. If you're looking for more info, you can search in the actionscript.org forums - there are quite a few posts about this problem.

Yes, I know I can swap the font - that's what I was telling you. I used comic_sans :)

Mortimer Jazz
02-21-2006, 04:16 AM
This works - I have added it to the sticky post in the components section as well (http://www.actionscript.org/forums/showthread.php3?p=453981#post453981) - please visit that thread if you want to download a zipped example.

import mx.controls.Tree;

class TreeNavMenu extends MovieClip
{
//declare props
private var menuXML:XML;
private var menuTree:Tree;

public function TreeNavMenu(){
loadXML();
}

private function loadXML():Void{
var parent = this;
menuXML = new XML();
menuXML.ignoreWhite = true;
menuXML.onLoad = function(s) {
if(!s) trace("Error loading XML");
parent.onMenuLoaded();
};
menuXML.load("menu.xml");
}

private function onMenuLoaded():Void{
menuTree.dataProvider = menuXML.firstChild;
menuTree.addEventListener("change", this);
styleTree();
makeTransparent();
}

private function makeTransparent() {
//http://www.flashgamer.com/2006/02/skinning_the_flash_datagrid.html
//http://philflash.inway.fr/
var mc = menuTree;
_global.styles.ScrollSelectList.backgroundColor = undefined;
mx.controls.listclasses.SelectableRow.prototype.dr awRowFill = function(mc:MovieClip, newClr:Number):Void {
mc.clear();
if (newClr == undefined) {
mc.beginFill(0xABCDEF, 0);
} else {
mc.beginFill(newClr);
}
mc.drawRect(1, 0, this.__width, this.__height);
mc.endFill();
mc._width = this.__width;
mc._height = this.__height;
};
//enable this line if you want to remove the border
//this.menuTree.border_mc._alpha = 0;
}

private function styleTree():Void{
this.menuTree.setStyle("embedFonts", true);
this.menuTree.setStyle("fontFamily", "Silkscreen");
this.menuTree.setStyle("fontSize", 8);
this.menuTree.setStyle("color", 0x000);
this.menuTree.setStyle("textSelectedColor", 0xABAE8F);
this.menuTree.setStyle("textRollOverColor", 0xABAE8F);
this.menuTree.setStyle("folderOpenIcon", "nullicon");
this.menuTree.setStyle("folderClosedIcon", "nullicon");
this.menuTree.setStyle("disclosureClosedIcon", "nullicon");
this.menuTree.setStyle("disclosureOpenIcon", "nullicon");
}


function change(event:Object) {
if (menuTree == event.target) {
var node = menuTree.selectedItem;
// If this is a branch, expand/collapse it
if (menuTree.getIsBranch(node)) {
menuTree.setIsOpen(node, !menuTree.getIsOpen(node), true);
}
// If this is a hyperlink, jump to it
var url = node.attributes.url;
var more:String = node.attributes.more;
if (url) {
_parent.placeholder._alpha = 0;
_parent.imageLoaded = url;
//_parent.url.loadMovie(more);
_parent.fullImage.play();
_root.addHolderVis_mc.loadMovie(more);
}
var info = node.attributes.info;
if (info) {
_parent.placeholder._alpha = 0;
_parent.textLoaded = info;
_parent.fullText.play();
}
// Clear any selection
menuTree.selectedNode = null;
}
}
}

Mucho kudos to Phil's Flash - the only solution I could find :)

Trams
03-14-2006, 01:10 AM
In Flash 8 I chose... "Bitmap Text (No Anti-Alias)" on the dynamic text field and it embedded the font fine. It didn't work without setting it to that. Doesn't anti-alias the text though, but I just used a font from Fonts For Flash. Worked great. :)

samroni
04-27-2006, 06:53 PM
oo my god... long have i given up on embeded font and i found my old thread back ^o^

well... i've redesign my website because of this stupid problem. and you know what, i got a new problem with text:

i dont know if you know this but dynamic text doesnt show up within mask.


i'm still hoping someone clear this mess up =)


in the mean time, you all can go to my new site www.martinsamroni.com

samroni
04-27-2006, 06:55 PM
In Flash 8 I chose... "Bitmap Text (No Anti-Alias)" on the dynamic text field and it embedded the font fine. It didn't work without setting it to that. Doesn't anti-alias the text though, but I just used a font from Fonts For Flash. Worked great. :)


if we can't set the anti-alias. whats the meaning of embeding font =pp

clinch
04-27-2006, 06:58 PM
oo my god... long have i given up on embeded font and i found my old thread back ^o^

well... i've redesign my website because of this stupid problem. and you know what, i got a new problem with text:

i dont know if you know this but dynamic text doesnt show up within mask.



To make dynamic text and masks work nicely together, put the dynamic text inside another movie clip. Then use that movie clip as the mask.

acolyte
04-27-2006, 09:04 PM
Hi All,

i recompiled my testfile with the flash8 Compiler,
would somebody drop a message here if the embedd works
this was embed with Antialiasing for Animation

ok i deleted the fonts out of the fontlibrary / this seems to be a seriouse bug
with Flash 2004 Mx this worked just fine :confused:

http://www.mat3d.com/txtefx.html

thnx aco

stolex
04-28-2006, 10:16 AM
I have the same problem with Arial and Dynamic Text box. I create dynamic box and embed Arial font. When I publish in flash version 8 I can't see nothing, but in flash ver.7 it forks fine. WHY?

Saroj
04-28-2006, 11:47 AM
This is not the problem with your code. You have to add the font to SWF. So that swf file itself carries the font you are using. Nomally all the peoples who access your swf wont have the font you specified in your flash file.

If this is the problem then please follow the instruction:

Open Library window.
click on New Font.
From the Font Symbol Properties window choose the Font Type and give a name if you want. Be sure that Bold should not be selected.

Then Press Ok.

Done...:)

acolyte
04-28-2006, 12:15 PM
This is not the problem with your code. You have to add the font to SWF. So that swf file itself carries the font you are using. Nomally all the peoples who access your swf wont have the font you specified in your flash file.

If this is the problem then please follow the instruction:

Open Library window.
click on New Font.
From the Font Symbol Properties window choose the Font Type and give a name if you want. Be sure that Bold should not be selected.

Then Press Ok.

Done...:)

I got the Font in the Library and No it doesnt work /
I think the Problem relies to dynamic text. I am starting with a empty textbox filling the Textbox
with css styled Htmlmarkup out of a Cdatanode with animation / I got no Problems with static Text.

as i said it worked just fine in Flash MX 2004
well if its that easy please upload a file where it is possible

kudos Aco

samroni
04-29-2006, 05:43 PM
To make dynamic text and masks work nicely together, put the dynamic text inside another movie clip. Then use that movie clip as the mask.

nice idea... thx man =)

samroni
04-30-2006, 03:58 PM
Hi All,

i recompiled my testfile with the flash8 Compiler,
would somebody drop a message here if the embedd works
this was embed with Antialiasing for Animation

ok i deleted the fonts out of the fontlibrary / this seems to be a seriouse bug
with Flash 2004 Mx this worked just fine :confused:

http://www.mat3d.com/txtefx.html

thnx aco


your embed font works in my computer. but i think its because i have lots of font... your fff fonts, i might have all of those.


whats the blue and red button btw

samroni
04-30-2006, 03:59 PM
This is not the problem with your code. You have to add the font to SWF. So that swf file itself carries the font you are using. Nomally all the peoples who access your swf wont have the font you specified in your flash file.

If this is the problem then please follow the instruction:

Open Library window.
click on New Font.
From the Font Symbol Properties window choose the Font Type and give a name if you want. Be sure that Bold should not be selected.

Then Press Ok.

Done...:)

did you even read my first post? i tried that already. thx anyway

acolyte
05-01-2006, 09:27 AM
Originally Posted by acolyte
Hi All,

i recompiled my testfile with the flash8 Compiler,
would somebody drop a message here if the embedd works
this was embed with Antialiasing for Animation

ok i deleted the fonts out of the fontlibrary / this seems to be a seriouse bug
with Flash 2004 Mx this worked just fine

Hi Samroni ,

in this Reply :
http://www.actionscript.org/forums/showpost.php3?p=428673&postcount=35

i posted a link to a txtefx question , you can download my constructionfiles (.fla) there .
Set the Fontembed in the upper txt frame to devicefonts to see the Effect .
I dropped out all FFF Fonts out of my Windows Fonts folder and it works for static text as i said.


code for the static text :

_root.createTextField("mytext", 30, 20, 300, 400, 50);
mytext.html = true;
mytext.htmlText = "i am static Text i am embedd !";
mytext.embedFonts = true;
mf = new TextFormat();
mf.font = "test";
mf.size = 16;
mytext.setTextFormat(mf);
mytext.textColor = "0xffffff";
mytext._alpha = 80;
mytext.selectable = false;




greets m@

artistwantaB
05-20-2006, 04:31 PM
Hello all,

Seems this is a common problem. I can get the embed font to work with a dynamic or static textfield created on the stage but using the creatTestField doesn't seem to work. I notiched someone asked this question about 4-5 pages ago but never read a response.

If I remove this line it works but not with the font I have embeded.

on last thing I will mention I am also importing the font from another library.

_root.theArtist.embedFonts = true;

Any Help

var lv_theArtist:LoadVars = new LoadVars ();
lv_theArtist.onData = function (stateData) {
_root.theArtist.htmlText = stateData;
};
//
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet ();
//
_root.createTextField ("theArtist", 400, 200, 100, 600, 600);
_root.theArtist.multiline = true;
_root.theArtist.wordWrap = true;
_root.theArtist.html = true;
_root.theArtist.embedFonts = true;
_root.theArtist.selectable = false;
theArtist.styleSheet = cssStyles;
cssStyles.load ("styles/theArtistStyles.css");
cssStyles.onLoad = function () {
_root.theArtist.text = this;
lv_theArtist.load ("vars/theArtist.html");
};

acolyte
05-20-2006, 04:56 PM
Hi wantaB

for me it seems you are missing a few lines about the textFormat.
For me the example works just fine with createTextfield
( notice that you need to choose the name from the linkage referer you set as you
includet your font in the Library ( not the name the Font says in the Library , only the name you choose the name you set as the linkage referer)

mf = new TextFormat();
mf.font = "test";<< this it not the Name of the Font / this is the linkage deferer
mf.size = 16;

greets A

artistwantaB
05-20-2006, 06:57 PM
mf = new TextFormat();
mf.font = "test";<< this it not the Name of the Font / this is the linkage deferer
mf.size = 16;
[/as]
greets A

Sorry I am not following. The linkage library name is "corsiva";

So applying it to my code. Is this correct?...

_root.theArtist.font = "corsiva";

I tried and no luck. Is there a specific placement of the above? Sorry first time using createTextField with CSS and Embeded Fonts.

acolyte
05-20-2006, 09:04 PM
Yes man ,

dont make any fontfamilysettings in the .css file . This doesnt work
because the fp looking then for the font clientsidet you want the fp to use the font delivered with your .swf

Here it works?
add a new font to the library give him a link referer and applie it to the Textformat this should work ?? i dunno
you can post you workfiles here

you dont need to assign the font to the Textfield. Instead of this assign the Font to the Textformat and assign the Textformat to your .theArtist.textfield
this would be much better because you can easily reuse your Textformat then over the whole Movie .

mf = new TextFormat();
mf.font = "corsiva";
mf.size = 8;

_level0.theArtist.setTextFormat(mf);


kudos Aco

artistwantaB
05-20-2006, 11:27 PM
Yes man ,

dont make any fontfamilysettings in the .css file . This doesnt work
because the fp looking then for the font clientsidet you want the fp to use the font delivered with your .swf

Here it works?
add a new font to the library give him a link referer and applie it to the Textformat this should work ?? i dunno
you can post you workfiles here

you dont need to assign the font to the Textfield. Instead of this assign the Font to the Textformat and assign the Textformat to your .theArtist.textfield
this would be much better because you can easily reuse your Textformat then over the whole Movie .

mf = new TextFormat();
mf.font = "corsiva";
mf.size = 8;

_level0.theArtist.setTextFormat(mf);


kudos Aco

I understand now. I assumed the cssStyle sheet would look in the .swf for the font.

I will post the work files if I run into trouble.

Thanks for reply.

Off-Topic
If you are a soccer fan you must be excited to have the WC in your backyard

artistwantaB
05-20-2006, 11:41 PM
Ok I am waving my white flag on this.

I think I am confusing myself. I need to see a working example.

I have two questions.

Can you use CSS with embeded fonts?

If yes, what properties does it control?

Everything EXCEPT the font-family?

Here is the zip. Just a crude example so I can see how it works.

acolyte
05-21-2006, 01:09 PM
Hello wantaB,

just four little mistakes:

1.)why are you not using a xml file
2.) you tried to import the text as normal Text not as htmlText
3.) never set the name of the font in the Library the same as the linkage referer
3.) hit "export for Actionscript" @ the linkage attributes


mf = new TextFormat();
mf.font = "corsiva";
mf.size = 24;
Stage.scaleMode = "noScale";
//
import flash.filters.BlurFilter;
import flash.filters.*;
import mx.transitions.Tween;
import mx.transitions.easing.*;
Stage.scaleMode = "noScale";
//
import flash.geom.*;
import flash.display.BitmapData;
//
var lv_theArtist:LoadVars = new LoadVars();
lv_theArtist.onData = function(stateData) {
_root.theArtist.htmlText = stateData;
};
//
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
//
//
XMLFile = "theArtist.xml";
mainContent = new XML();
mainContent.ignoreWhite = true;
mainContent.load(XMLFile);
mainContent.onLoad = readMainContent();
function readMainContent() {
mainContent.firstChild.depth = 0;
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.load("theArtistStyles.css");
cssStyles.onLoad = function() {
trace(mainContent.firstChild.childNodes[0].firstChild.nodeValue);
_root.createTextField("theArtist", 400, 200, 100, 600, 600);
_root.theArtist.embedFonts = true;
_root.theArtist.html = true;
_root.theArtist.autoSize = true;
_root.theArtist.styleSheet = css_styles;
_root.theArtist.setNewTextFormat(mf);
_root.theArtist.background = true;
_root.theArtist.backgroundColor = "0xFFFFFF";
_root.theArtist.selectable = false;
_root.theArtist.multiline = true;
_root.theArtist.wordWrap = true;
_root.theArtist.htmlText = mainContent.firstChild.childNodes[0].firstChild.nodeValue;
};
}


greets Aco

artistwantaB
05-21-2006, 02:54 PM
Hello wantaB,

just four little mistakes:

1.)why are you not using a xml file
2.) you tried to import the text as normal Text not as htmlText
3.) never set the name of the font in the Library the same as the linkage referer
3.) hit "export for Actionscript" @ the linkage attributes


Thanks for the assistance.

The basic reason why I am not using XML is I don't know anything about it. I am not a web designer or developer so I try to minimize the number of programs/languages I have to learn. This is mainly for my personal site and personal satisfaction. I barely have the time to keep current on five programs. (Currently flash, photoshop, lightwave, inDesign, and afterEffects. Flash is the newest program and first language I have attempted to learn. I know barely enough about dreamweaver, html and css to get things working. I hear a lot about XML but don’t know the advantages. Maybe you can shortly outline why you prefer it.

One other question. I noticed that set the font size in the AS. So I was curious and which font size would override each other the one in AS or the one on my CSS style sheet. Then I noticed that my cssStyle sheet doesnt actually do anything anymore. Doesn't control the size or color or anything.

Update:

OK I have everything working now including the CSS. One last problem...Everything works fine with the font in the library. When I try to import the Font from a shared library I don't get any test. I did some looking around and found tones of threads with people having similar problems. The shared library is working fine just not with the dynamic text field.

I probably missing something. I will keep looking.

Update:

I created a dummy text field with some text embed and now everything works fine.

artistwantaB
05-21-2006, 05:12 PM
I did some reading about xml, I think I will embark on learning more about it in the future. I want to offer my website in multiple languages and I think XML will be a great way to do that.

Thanks for the help.

acolyte
05-22-2006, 10:14 AM
Thanks for the assistance.
One other question. I noticed that set the font size in the AS. So I was curious and which font size would override each other the one in AS or the one on my CSS style sheet. Then I noticed that my cssStyle sheet doesnt actually do anything anymore. Doesn't control the size or color or anything.


Hi wantaB,

If you want to set the size by the .css file you dont have to applie any size information @ the Format . The SIze providet in the .css file will do it .

Yes thats the most common way for Multilingual Websites ,Xml .

In my opinion it would be a large benefit to your Website (Xml) .
With a little training on how to use xml you can administrate about every content in your Flashmovie dynamic / much better than having every Text static in your Movie.

good Luck

Aco

noseyPete
01-10-2007, 05:19 PM
I almost feel guilty for resurrecting this mammoth thread... but desperate times call for desperate measures... ;-) As far as I can see, no-one has addressed this variation of the topic so far.

I am attempting to render a dynamic text field, styled with CSS, using a BITMAP font, as ALIASED (jagged, not anti-aliased). I can only get it to be anti-aliased.

The font is embedded in the library. It has a linkage name. Its specified in the embed dialog as bitmap text and is in the CSS at the correct size. I am specifying embedFonts = true for the textField. It will appear as anti-aliased if I untick the 'bitmapText' checkbox in the 'New Font...' dialog, no worries. So I know everything is working. Its some sort of embedding issue.

In addition, I've followed everything I can from here (http://www.connectedpixel.com/blog/fonts/cssembedding) and here (http://www.connectedpixel.com/blog/fonts/embedding)(highly recommended if you're struggling with embedding).

I have built quite a large project that uses CSS globally to style text, and it is really important my fonts are bitmapped, not anti-aliased...

The only fix I can see at the moment is to set the .sharpness and .thickness properties for each field and make it look like its aliased... but it just doesn't get quite the same result and will require different settings for each font. What a pain in the ring!

Any donations gratefully received... :)

beau
01-12-2007, 06:46 PM
I've had that problem in the past as well - it seems to happen arbitrarily. Sometimes it works, sometimes it doesn.

noseyPete
01-12-2007, 11:33 PM
Thanks, Beau.

Good to know others have had the same problem... Unfortunately I haven't been lucky enough to have it work yet!

I tried all sorts of different fonts from Arial TTF to opentype, the lot.... no luck. Adobe.....!?

noseyPete
01-16-2007, 10:23 AM
OK, sorted.

Turns out, as with most things, its just a matter of trying out every conceivable combination...

Check http://www.connectedpixel.com/blog/node/27#comment-112 for comments and a little demo movie.

Wally69
03-05-2007, 11:37 AM
Hi,

I had a similar problem with embed fonts not showing up and found this:
Test scenario: Flash 8 FLA, publish to 8, 7, 6
1 Dynamic Text Field, antialias for animation, with manual embed fonts. font=Verdana
1 Static Text Field with device fonts enabled. Verdana, same settings as previous one.

Just that at first didn't work! the dynamic one didn't show, unless i commented or removed the static one on the timeline.
Then i managed to manual create another static textfield identical to the other one and this time it worked.

As i had both textfields on the fla, i switched from one to the other and in every case the probled showed when i used the "bad" one.

Then i found why were they failing and WHAT was the cause:

The two static tf's seemed identical, same font showed, size, etc, but when i manually changed the bad one to verdana, selecting from the font list, then it repaired itself and also started working.

As i investigated further i fount out the problem was the fotn name: the good ones had "Verdana", the bad one "verdana" notice the first letter.

It seems flash screws when it founds the fonts with same "name".
The bad one is obtained manually tiping the font name on the font list, like "verdana". Flash shows it as "Verdana" although internally it still is "verdana". If you do size report it will show BOTH fonts.

I hope this solves many problems with textfields and embedding as some errors seem to be very obscure, but when i found it out it solved every weird font embedding dissapearing problem i was having.

I attached the results from my tests if anyone wants to try it.

russtie
03-15-2007, 01:13 PM
As usual it's probably something simple.

I've embedded two fonts, exported in firstframe, linkage id etc. At runtime I load text from an XML file and then create three text fields and populate with the text. The text appears when tested locally, but when I publish to the server they dissappear?! I have to publish Flash 6 and I have Flash 9 player installed, is this the issue?

Here's my code:

library font linkage id "myFont" "logoFont"

/////////////////////////
stage.container_mc.createTextField("logo_txt1", _root.getNextHighestDepth(), 345, 23, 315, 145);
stage.container_mc.logo_txt1.multiline = true;
//stage.container_mc.main_txt.antiAliasType = "advanced";
stage.container_mc.logo_txt1.html = true;
stage.container_mc.logo_txt1.selectable = false;
stage.container_mc.logo_txt1.embedFonts = true;
stage.container_mc.logo_txt1.htmlText = "<font color='"+logocolour1+"' size='50'>"+logoText[0]+"</font><font color='"+logocolour2+"' size='50'>"+logoText[1]+"</font>";
stage.container_mc.createTextField("header_txt", _root.getNextHighestDepth()+1, 345, 73, 315, 98);
stage.container_mc.header_txt.multiline = true;
//stage.container_mc.main_txt.antiAliasType = "advanced";
stage.container_mc.header_txt.html = true;
stage.container_mc.header_txt.embedFonts = true;
stage.container_mc.header_txt.selectable = false;
stage.container_mc.header_txt.htmlText = headerText;
stage.container_mc.createTextField("main_txt", _root.getNextHighestDepth()+2, 346, 130, 320, 179);
stage.container_mc.main_txt.autoSize = "left";
stage.container_mc.main_txt.embedFonts = true;
//stage.container_mc.main_txt.antiAliasType = "advanced";
stage.container_mc.main_txt.html = true;
stage.container_mc.main_txt.htmlText = mainText;
stage.container_mc.main_txt.wordWrap = true;
stage.container_mc.main_txt.selectable = false;
var style_fmt:TextFormat = new TextFormat();
style_fmt.font = "myFont";
stage.container_mc.main_txt.setTextFormat(style_fm t);
var style_fmt2:TextFormat = new TextFormat();
style_fmt2.font = "logoFont";
stage.container_mc.logo_txt1.setTextFormat(style_f mt2);
var style_fmt3:TextFormat = new TextFormat();
style_fmt3.font = "logoFont";
stage.container_mc.header_txt.setTextFormat(style_ fmt3);

Please help!!!:eek:

russtie
03-15-2007, 01:40 PM
Sorry answer was simple. Shared libraries.

I recommend when working with embedded fonts to place in a shared library and export for runtime sharing.

Cheers.:)

bluerattle
04-01-2007, 10:50 PM
I just have been struggling with this dynamic text / embed font issue in Flash 8, and have a solution for my particular case.

Flash 8
Targeting Flash Player 8

I wanted to set up a dynamic text field with anti-aliasing for animation, but it would not appear. I embedded the fonts with "Latin 1 (388 glyphs)" fonts, and still no go.

Finally I found the solution: change the font list to "Basic Latin (95)", or even the more selective Uppercase, Lowercase, etc. Or pick All (39477 glyphs). All of these work -- and I can decide what trade-off to make in terms of SWF size vs. displayable text.

I assumed for a while that Latin 1, with all its glyphs, would be a superset of Basic Latin, and should work at least as reliably. Ass-u-me.

br

thebest
06-25-2007, 04:11 AM
i had the same problem n i visited this page while searching... thanks to everyone's input n links i managed to find the solution. it has been already stated tht wen u export ur movie change it to FLASH 7 from FLASH 8... don't forget to embed the font thu...it's working fine in my html file but i m yet to discover while it will work on clients PC.. thanks for the help. this site have some gud solution.
cheers
thebest!

elbjoern
08-17-2007, 10:24 AM
hi everybody,
i got a similar problem with embedding fonts with css, external as and an xml-file. i couldn't find a solution for my problem in this thread.

it's easy to use embeded fonts as long as i am programming in a fla-file. when i am using an external as-class-file my gernerated textfields won't be displayed. but why? as i said, when i am using a similar script directly in the fla everything is working. the way i am importing my xml-file and my css-file is the way adobe recommends. but why isn't that working with an external as?
attached you will find the files i am using. there a two layers in the fla file. one layer with the internal script, one with the external. so you can experiment yourself. hope i discribed everthing clearly and hope you can help me solve this damn problem.

cheers, elbjoern

Scuba_Steve
08-17-2007, 12:51 PM
you guys have obviously tried embedding fonts via the IDE and not AS right?

elbjoern
08-17-2007, 01:46 PM
i am not sure if i understand what you mean, but i think yes you are right.
what do you exactly mean with embedding via AS? you can i do that?

matbury
08-19-2007, 02:33 AM
Using shared libraries is probably the best route, you can also embed your font in an author-time TextField off the stage, and then that font will be available to other, dynamic TextFields.

If you're making all your TextFields at authoring-time then you have to make sure you've got "Anti-aliasing for animation" selected and "Auto-kern unchecked".

elbjoern
08-20-2007, 09:41 AM
okay, i hate flash ;)
the fault was writing StyleSheet instead of styleSheet. now everything is working just fine and i learned a lot about embedding fonts in flash ;) and of course correct typing :(
cheers, elbjoern

Fresh_ales
12-08-2007, 11:42 PM
:eek:
ok i have tryed several things.... no go hose...:mad:
my code

/*title*/
this.createTextField("title_0",this.getNextHighestDepth(),110,0,350,50);
myFormat2 = new TextFormat();

myFormat2.autoSize="center";
myFormat2.bold=true;
myFormat2.font="Tahoma";
myFormat2.size = 14;
var myColor2:String = "990000";
myFormat2.color=parseInt("0x"+myColor2);
myFormat2.embedFonts=true;

title_0.multiline=true;
title_0.wordWrap=true;
title_0.border=false;
title_0.setNewTextFormat(myFormat2);

title_0.text = "This is my title";
/*title*/

I just cent get the fonts embeded!?
If i create an dynamic text box with "mouse" not in AS and embed fonts works... but like this... no go
any idea?

matbury
12-10-2007, 12:49 AM
Create a font symbol with the font you want to use in the FLA library and set the linkage to export for actionscript. Then TextField.embedFonts = true; will work.

You can't embed the font in a TextFormat object!

atomic
12-10-2007, 04:32 AM
You embed the font in the created textfield, not in the format...

http://flash-creations.com/notes/dynamic_createtext.php

tobijas20
03-10-2008, 06:53 PM
I'm having the same problem. When I publish the movie as Flash7 or Flash9 I see embeded font, and with Flash8 I don't see anything. Isn't that stupid??

auntialias
03-11-2008, 08:16 PM
Parent SWF has 2 "dummy" text fields on stage in obscure location in order to embed font: Myriad Roman.

Parent SWF uses mc loaders to load child swfs. Each Child swf contains two dynamic text fields on child FLA stages; they load text from external text file, different text is loaded depending on which button is clicked.

Top (child swf) text box is one-line, uses letterspacing. Myriad Roman, 11pt, text is ALL UPPERCASE

Bottom (child swf) text box is multi-line, uses slight letterspacing. Myriad Roman, 10pt. Uppercase, Lowercase, Numbers, Punctuation.

Same font. Two different sizes.

Here's what's weird: Embedding worked for the bottom, multi-line text field, but not for the top one. :confused::confused::confused:

Do you have any idea why one would be successful and one not, and what can I do to make the top text appear?

(and do I have to embed the font at 10pt and also at 11 point?)