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
Hi CRM Experts, we have created a service Order (BUS2000116) and afterwards we want to create a Service Notification (BUS2000117). When pressing the button 'Follow-Up' a Pop-Up is opening where we normally should have the option to select the items w [More]
How do download songs from my itunes account to my wifes ipod nano with her own account?To what iTunes library is the nano normally synced? The iTunes library you use (i.e. all tracks are in a single iTunes library). An iTunes library in a different [More]
I have three computers right now. One 2010 iMac, one 2012 Macbook Pro and a new 2014 Macbook pro. I have logged out and uninstalled creative cloud from the iMac. After buying the new MacBook Pro (2014) I have used the 2012 laptop to copy my entire us [More]
I WANT TO KNOW THE PHYSICAL PATH OF CURRENT WORKING FILE IN JAVA ON BOTH UNIX AND WINDOWS PLATFORM. HOW TO GET IT? THANK UI am not sure this is the correct way to do it, but I tried it out a bit and found that the following will work (that is, I test [More]
Hi Folks It would be great if someone can help me resolve this error. Basically i am trying to upgrade my ATG10.1.2 to ATG10.2. I have executed all the DB scripts successfully, but while doing a data migration for viewmapping changes thats described [More]
Hi everyone, I have just created 3 captivate movies & a menu for a client & I have just been aske if it would be possible to use there own icon rather than the standard captivate image that is used when the exe file is created. I did not notice an [More]
I have a dual mainframe VXI system and at random times (always during the initialization phase), the green light will stay lit on the 1394 controller in the first mainframe and all communication stops.  I'm using VB.Net with NI-VISA. After a lock up, [More]
Dear all, In customize program, im using OOP Method CL_GUI_ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY to output the result in ALV list. Result display in ALV list successfully, then i click on on "Print Preview" button. System will lead me to anot [More]
I noticed that if I use the "New Activity -> Email" function from the CRM toolbar in Outlook, it appends the subject line with a CRM:XXXXXXX unique tracking number.  I'm not sure that my customers would react very well to knowing that I am tr [More]
Hi Fiori experts, I have done the steps necessary to configure the "My Inbox" app. 1) Assign the service to the Backend 2) Activate the app in sicf 3) Assign the role catalog 4) Create the group and add the My Inbox app But the thing is that I a [More]