Sitemap

Amicuk Programming Answers

Embed font example for CS3

-0001-11-30   Views:0

Advertisement

I'm trying to use the following script to embed a font in a CS3 flash file. When I publish and preview it, all I get is a blank screen :S Can someone tell me if this script is valid for AS3/CS3? Thanks. package { //import flash.util.describeType; imp

I'm trying to use the following script to embed a font in a CS3 flash file. When I publish and preview it, all I get is a blank screen :S Can someone tell me if this script is valid for AS3/CS3?
Thanks.
package {
//import flash.util.describeType;
import flash.display.MovieClip;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.AntiAliasType;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormatAlign;
   public class Test extends MovieClip {
      // be sure this is pointing to a ttf font in your hardrive
      [Embed(source="Arial.ttf", fontFamily="foo", mimeType="application/x-font-truetype")]
      public var bar:String;
      public function Test() {
          var format:TextFormat          = new TextFormat();
          format.font              = "foo";
          format.color                = 0xFFFFFF;
          format.size                 = 130;
          var label:TextField         = new TextField();
          label.embedFonts            = true;
          label.autoSize              = TextFieldAutoSize.LEFT;
          label.antiAliasType         = AntiAliasType.ADVANCED;
          label.defaultTextFormat     = format;
          label.text                  = "Hello World!";
          addChild(label);
          trace(label.text);
          label.setTextFormat(format);

The replay answer
Advertisement
Im not sure if u can do it with flash cs3.
i change a little ur code to :
package {
//import flash.util.describeType;
import flash.display.MovieClip;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.AntiAliasType;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormatAlign;
import flash.text.Font;
   public class Test extends MovieClip {
      // be sure this is pointing to a ttf font in your hardrive
      [Embed(source="arial.ttf", fontFamily="foo", mimeType="application/x-font-truetype")]
      public var arialfont:Class;
      public function Test() {
          Font.registerFont(arialfont)
            var format:TextFormat          = new TextFormat();
          format.font              = "foo";
          format.color                = 0xFFFFFF;
          format.size                 = 130;
          var label:TextField         = new TextField();
          label.embedFonts            = true;
          label.autoSize              = TextFieldAutoSize.LEFT;
          label.antiAliasType         = AntiAliasType.ADVANCED;
          label.defaultTextFormat     = format;
          label.text                  = "Hello World!";
          addChild(label);
          trace(label.text);
          label.setTextFormat(format);
and it works fine with flash cs4, only first time it will ask to confirm flex sdk location ( have to have flex sdk to use embed, u can downlaod it free from adobe.com)
hope that helps

Go to See the other 4 answers

Embed fonts in Flash CS3 and load in Flex at runtime

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I want to embed fonts in the library of Flash CS3, compile it into a SWF and load it in my flex up at runtime and register the embedded font. I'm able to get the linked class in Flex but the font doesn't show. The FLA has a font called Viner Hand[More]

Embed font example for CS3

Category:DefaultRelease time:-0001-11-30Views:130

I'm trying to use the following script to embed a font in a CS3 flash file. When I publish and preview it, all I get is a blank screen :S Can someone tell me if this script is valid for AS3/CS3? Thanks. package { //import flash.util.describeType; imp[More]

CS3/AS2 -Text Scroll Box Cannot Embed Font, Need To Link Font From Server??

Category:DefaultRelease time:2015-10-11Views:130

Hi all - ok here goes somethin So I bought a text scroller flash file and am now trying to tailor it to my needs. This is it: http://activeden.net/item/dynamic-external-text-scroll-with-easing/2612 It is composed of several movieclips which link to t[More]

Embed fonts not available error (But they are available sysetm fonts)

Category:DefaultRelease time:2015-10-11Views:130

Hello! I tried to search and actually did found some answers regarding font problems, but they did not help. So I am explaining here my problem in hope that someone can help me. My company bought a HP Xeon X3450 @ 2.8Ghz. @Gb RAM DD3 1333 with Window[More]

How to embed fonts AND keep bookmarks?

Category:DefaultRelease time:2015-10-11Views:130

Hello, newbie here. I use MS Sql Server Reporting Services to generate a lengthy report, often over 100 pages. The report must be distributed as a PDF, and it must use some slightly unusual fonts, and it needs bookmarks. Reporting Services has a PDF[More]

How to Embed Fonts and make Grayscale in Acrobat Pro 9 PDF

Category:DefaultRelease time:2015-10-11Views:130

I supplied my printer with a PDF but he says that I need to "Embed The Fonts" in the PDF. I made the original document in MS WORD and then I created the PDF in Acrobat Pro 9 but nowhere along the way did I see anything that asked me to Embed The[More]

How to embed fonts in document for all users

Category:DefaultRelease time:2015-10-11Views:130

Hello, we are using a custom font for our documents. I know it's possible to embed fonts in document when saving. Is there an option to enforce this setting with a policy? I cannot find the right policy in the Office Policy templates. We are using Of[More]

How to embed fonts in PowerPoint?

Category:DefaultRelease time:2015-10-11Views:130

Is it possible to embed fonts in a PowerPoint presentation?I just spent a half an hour looking through the menus and Help and I couldn't find an option to enable that feature. It doesn't seem to be available. But, that doesn't mean it's not possible.[More]

How to embed fonts in PDF Pack (Adobe X)

Category:DefaultRelease time:2015-10-11Views:130

I watched a video that showed a "preflight" button in the tool dropdown... I have to embed the Times New Roman font in  a document, but cannot figure out how.....The PDF Pack online subscription services Does Not Come With Acrobat (the desktop a[More]

Can I embed fonts in a pdf document?

Category:DefaultRelease time:2015-10-11Views:130

I wish to publish a Pages document and to do this I need to convert it to pdf and ensure that my fonts can be embedded into the pdf document. I am not sure how to proceed. How do you embed fonts in PDF from Pages 4.1?Preview does a nice job of embedd[More]

Embed fonts in PDF

Category:DefaultRelease time:2015-10-11Views:130

I want to publish a book on lulu.com which I created with MS Word for Mac. It must be in PDF format with embeded fonts. Firstly, how does one save a file as a PDF? Secondly, how does one embed fonts? Thanks!There are several ways to make a PDF. The b[More]

Hot
Hello all, just want to say I LOVE my new Ipod (haven't had one since the first gen nano) I was just curious, what would be the best way to open the videos in say Sony Vegas or Windows Movie maker? I tried a converter last night and the video was hor [More]
I Have an HP Officejet Pro 8500 Wireless. Trying to print to it from my iPad2. Having some problems. Trying to print docs or files from the iPad usuall gets me a page that looks scrunched up to one side. Is there a good printer app (preferably free [More]
Acrobat Reader 9.3.3 will not successfully complete the update to 9.3.4. It complains about not having permission for a key (error 1402). Other forum posts and Adobe knowledge base articles do not supply a solution. When I try to uninstall Reader 9 c [More]
Hi everyone, I just got a macbook pro (OSX Lion) for the first time and was playing around with it to learn all the features. I did a software update and when it was done, an iCloud icon appeared on my dock. While playing around with the track pad fe [More]
This is the second time I have had a problem with my account. I am extremely frustrated with it. A while ago I was not able to purchase anything including free apps. At that time I had an outstanding balance. Which had been from using a visa card on [More]
Hi I am just configuring my iview to display my Crystal Report but I just get a blank screen. These are the paramters I am using: My report in BO is: frs://Input/a_163/009/000/2467/1c8c69c861bbb952.rpt In the iview I set: Appplication Paraters as: cm [More]
hi all, i need to use a library in an SSIS package and I need to know if I  can do it without Visual Studio? i have SQl Server data tools installed on the server but i don't have the full visual studio. is it possible to use the library on the server [More]
In the Philippines, could I use broadband sticks to connect to the internet using an Iphone4? Since i do not have access to a wi-fi.No that will not work.  DO you have a cellular data plan?  That will give you internetRead other 2 answers [More]
I just bought an X220i laptop. I've spent a weekend downloading updates and drivers and searching the forum and support site, but I have two unresolved issues. Once I bring the computer back from hibernation, the wireless radio is off and will not tu [More]
Hi SAP gurus I am trying to create a wsdl file from a BAPI. I have followed all the steps and finally using transaction WSADMIN, I create the webservice. When I select SAVE AS (in the explorer window) it gives me an option with .XML. However, when I [More]