Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

External Embedded Fonts, Dynamic Text Fields, Latest?

LEGEND ,
Oct 18, 2007 Oct 18, 2007
Hi all,

I'm stuck in Flash8 land. Mostly because I use mProjector and MDM Zinc to extend flash projectors and neither support AS3 correctly to date. That said..

Is a Flash8 SWF capable of using fonts embedded in "other" SWFs? I realize this is an ongoing difficulty and a well known area of confusion and well, I'm confused. All the attempts I've made so far in linking have succeeded or failed in various ways, but never fully work.

What I'd love to do is use dynamic text fields populated by data from a database (or XML file), with CSS styling, using fonts that are embedded in a 'master font SWF'. (and I'd like ice cream with that too!)

I import fonts into, say, 'shared.fla'. I set them all up for exporting via linkage (to shared.swf). I open up my other FLAs (say, main.fla) and I drag the fonts from the shared.fla library into main.fla's library. In looking at the linkage, I see it properly set it to Import for Runtime Sharing (shared.swf). I can see the font available in the main.fla font list and can select it and use it just fine. I have to set the dynamic text field to embed fonts to actually see them (and also myTextField.setStyle("embedFonts",true)).

Now all that works well and fine, but the kicker is when I want CSS to style my text. If I specify a embedded font linkage identifyer in CSS, the text disappears. i.e. I load 'style.css' and I have h1 { font-family: someEmbeddedFont; }, the <h1> text will now disappear.

Any clues in how I can specify a font to use in CSS that's embedded so it'll work, WITHOUT This font needed to be embedded in the actual library (as in, not a linked asset)? Because it works fine if I embed the font into every single SWF. But when I try to use it as a shared asset, this doesn't work.

Any ideas on how someone can achieve this?

This is so I can changed my shared.swf and supply all new fonts with the same linkage identifiers and change the font in a whole project without re-exporting any other SWFs.

Thanks for any info!
TOPICS
ActionScript
3.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Oct 31, 2007 Oct 31, 2007
I was more or less asking if you could create 2 new documents and just slap in the font and settings as an example file for all of us looking to share some font assets properly.

I'd be happy to host a ZIP containing the example files on my server and you can put a .txt file in with credits to you and/or your company.

re-edit:

I mostly want your solution because sharedfonts.com's solution (which by the way, does work) is actually being exported as Flash 6, AS1. Also your method only requires...
Translate
LEGEND ,
Oct 19, 2007 Oct 19, 2007
We've got nobody who does localizations here? Surely someone has to do this stuff.. Bump!

It's very useful for caching and ease of replacement to desire to put re-used assets of all sorts in their own files once instead of multiple times. To be able to change the font used in a whole project by merely replacing one .SWF is obviously ideal. Also to change color and style via CSS is just as idea. But to do both would be magical.

Surely there has to be a way..
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 22, 2007 Oct 22, 2007
bump
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 24, 2007 Oct 24, 2007
wtb answer..

Is it possible to use fonts embedded in one SWF (a.swf) inside another SWF (b.swf) while being able to assign the fonts via an external CSS file?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 24, 2007 Oct 24, 2007
yes. search for a tutorial. there are too many steps and quirks for a forum discussion.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 26, 2007 Oct 26, 2007
I don't want to indicate that I'm a novice user in any way shapr or form, nor that I'm avoiding searching the subject. I assure you I've been up and down google on this issue and I can do 'parts' of what I want to do, but not all of it.

I can embed fonts in an external SWF and use then in dynamic fields elsewhere. I can either link directly in my library or specify it via AS. I can load those fonts in multiple ways, but what works best is the typical daisy chain loader with a font embedded seperately, one SWF per font. Etc. That much is obvious and has always worked.

What does not work, despite a few articles claiming it would, is specifying a font identifier in CSS. I cannot get this final step to perform in AS2 / F8.

I have Flash CS3 and I see the fonts class can make short work of this, however I use MDM Zinc and Screentime mProjector and neither of them support AS3 completely. So I am forced to use AS2, and do not have this class.

And so I'm here.. There really shouldn't be too many steps involved in this, it's just importing a font in whatever way I haven't found that will enable its outline rendering when called during CSS. Neither specifying the font identifier as the actual font name nor a completely random idenfier name works FYI (as most people ask first).

I think everyone can benefit from extracting font styling from their SWFs so this would be useful information here for everyone. Less recompiling is always ideal.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 26, 2007 Oct 26, 2007
i've done this with as2 and as3 and found both were quirky, illogical and not all simple. (that's similar to my experience positioning and sizing objects when you use flash full-screen.)

i can tell you they both can be done, but they are both experiences i would not repeat without being well-paid.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 26, 2007 Oct 26, 2007
Could you give me any direction or links or anything in the way of information on what you mean?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 26, 2007 Oct 26, 2007
in as2, i think you use the font's library name, not its linkage id. in as3, you use the font name not the class name and not the library name. i can check that for sure when i get home to my project files.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 30, 2007 Oct 30, 2007
Thanks kglad! Sorry I couldn't get to this post in a few days, I'm sure you know how work load goes up and down the crazy scale ;). I will try using the library name, never tried that before! I appreciate the tip!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 30, 2007 Oct 30, 2007
you're welcome.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 30, 2007 Oct 30, 2007
BTW could you tell me which of the methods you use to actually load that asset? I tried the runtime shared method, also tried importing the asset SWF with a text field in it containing the outlines and also tried just linking directly to this font and haven't been able to figure out which method you're using.

I named the linkage one thing and the library name something else. Neither seem to trigger the font to be displayed. 😞
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 30, 2007 Oct 30, 2007
loadMovie() and i used the font name, same as in as3.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 30, 2007 Oct 30, 2007
So you use the sharedfonts.com method? Via embedding the text into a text area..

Just to clarify, you:

1. Make a SWF containing a movieclip on stage. In the movieclip you place a dynamic text field with the font embedded into it. The movieclip in this is exported for runtime sharing.

2. Make a SWF that contains a movieclip in the library that is linked to the movieclip in step 1 above via import for runtime sharing. It has the same library name and ID.

3. You then import the SWF made in step 2 into your project into a movieclip on stage (visible or not), and then have access to using the fonts embedded in step 1.

Is that the method you do?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 30, 2007 Oct 30, 2007
no.

i create a swf that contains the shared assets including fonts that are added to the library. i then load that swf into other swfs that need access the shared assets.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 30, 2007 Oct 30, 2007
So you don't even need to use the exploit of runtime shared assets. Most of my tests were based on that daisy chain load so I'll give your method a try. Thanks for the insights!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 30, 2007 Oct 30, 2007
correct.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 31, 2007 Oct 31, 2007
I guess it's amazing but I honestly, wholly cannot get this to work.

I made a new AS2 Flash 8 FLA (Forte.fla) with only the Forte font with a size of 22 in the library. The name of the library element was Forte. The linkage was set to "Export for Actionscript" and "Export in first frame".

I made another FLA (main.fla) Flash8 AS2. In actionscript I created an empty movie clip named "Asset_Forte" at the next highest depth and Asset_Forte.loadMovie("Forte.swf"). I also made a dynamic text field on the stage of this main.fla document and set it to Arial 22pt (no bold or italics, etc). I did not embed anything into it.

I made a TextTormat object (my_fmt) and set my_fmt.font = "Forte";. I put some text in the dynamic text field to start so I just applied the formatting (status_text.setTextFormat(my_fmt);).

This did not work. I started adjusting random things like naming the font in the Forte.swf library to Forte22 and tried my_fmt.font = "Forte22";. That didn't work.

I adjusted the linkage to "Export for runtime sharing" and specified Forte.swf as the SWF to share from. This did not work.

I then dragged the font from the Forte.fla's library (while "Export for runtime sharing" was enabled) into the library of main.fla. I checked the link and it was proper, "Import for runtime sharing, Forte.swf". I used both linkage attempts again (Forte and Forte22) with my_fmt.font and neither worked.

Would it be possible at all to get a couple FLAs from you that examplifies how you do this particular trick? I can't seem to get the settings right. I would be indebted to you!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 31, 2007 Oct 31, 2007
i can't send you the as2 files. that was a client project.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 31, 2007 Oct 31, 2007
I was more or less asking if you could create 2 new documents and just slap in the font and settings as an example file for all of us looking to share some font assets properly.

I'd be happy to host a ZIP containing the example files on my server and you can put a .txt file in with credits to you and/or your company.

re-edit:

I mostly want your solution because sharedfonts.com's solution (which by the way, does work) is actually being exported as Flash 6, AS1. Also your method only requires 1 file instead of 1 font asset and a loader (2 files each font). When I change the documents to Flash 8 AS2 I get nothing but errors. I think sharedfonts.com is relying on the hack being available in older versions of flash and this is just why when I reproduce it in functional flash8, it simply doesn't work.

re-re-edit:

Nevermind.. found a working example finally, and this one isn't easy to find (unless you know his name or w/e): Shared Fonts in Flash

His method works for me on the web, and offline. It ended up being if I ever save my documents as Flash CS3 and export to Flash 8, it won't work. But if I save-as down to Flash8 and then publish as flash8 also, it works. Very weird, but, works..
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 31, 2007 Oct 31, 2007
no, it's too time-consuming. it was a lot of trial-and-error work in as2 and it was a lot of trial-and-error work in as3.

i undercharged for the as2 project when i failed to recognize how much time this would take. and i'm not enthusiastic about doing it again for free.

the as3 project was for kglad.com and i knew that was going to be time-consuming but that was ok. parts of that code i can share but i wouldn't want to re-write it, either.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 31, 2007 Oct 31, 2007
And there are quirks to note.. If you use the method above and then try to use a normal built-in font for something, it's actually defaulting to using one of the embedded fonts. e.g. if I set my_fmt.font = "Arial" it will never change it to arial. Nor in CSS does it work. It just uses a embedded shared font instead.

Very, very weird..

edit:

Didn't see your reply.. I understand, not everyone has time to help other people out. No worries, that other tutorial did the job and should be more than easy to understand for everyone else. Thanks anyhow.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 31, 2007 Oct 31, 2007
you're welcome.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 31, 2007 Oct 31, 2007
You didn't help haha. The method I'm using is from a post linked on another forum that wasn't even showin up in common sense google searches. Thanks for trying though.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 31, 2007 Oct 31, 2007
i know not everyone can be helped without step-by-step instructions. and sometimes even step-by-step instructions aren't enough.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines