Embedding and using external fonts.

I'm using Flash CS4.  I'm trying to load and embed an external font.  The main problem I'm having is that I need to import more than just latin 1.  I need many special characters imported as well.  Because of this, using Flash CS4's create new font from the library is not an option.  I'm using Verdana, so I know the font has all the characters I need.
So what I need to do is create an external swf that holds the font.  Then I need to import and use the font.  Unfortunately, I've found way too many ways online that work but don't fit my needs.
Any help is appreciated.

1. Embedding
a. You can embed font in Flash IDE by creating Font as a library asset and then compile this swf. There are tons of help available on Internet.
b. If you use Flash CS5 or compilers that utilizes Flex SDK, you can create class like below and compile it into a swf:
package 
     import flash.display.Sprite;
     public class FontLibrary extends Sprite
          [Embed(systemFont="Verdana", fontName="_verdana", mimeType="application/x-font", advancedAntiAliasing="true", fontStyle="normal",unicodeRange="U+0020-U+007E")]
          public static var Normal:Class;
          [Embed(systemFont="Verdana", fontName="_verdana", mimeType="application/x-font", advancedAntiAliasing="true", fontStyle="normal", fontWeight="bold",unicodeRange="U+0020-U+007E")]
          public static var Bold:Class;
          [Embed(systemFont="Verdana", fontName="_verdana", mimeType="application/x-font", advancedAntiAliasing="true", fontStyle="italic", fontWeight="normal",unicodeRange="U+0020-U+007E")]
          public static var Italic:Class;
          [Embed(systemFont="Verdana", fontName="_verdana", mimeType="application/x-font", advancedAntiAliasing="true", fontStyle="italic", fontWeight="bold",unicodeRange="U+0020-U+007E")]
          public static var ItalicBold:Class;
No matter what way you choose - you will have font available the external swf.
Try to load external swf into current domain. When you load the swf there is no much to do. Once swf is loaded - fonts should be available throughout application.
To use the font - just pass its name into TextFiled instance's TextFormat. WIth the example above:
myTextFormat.font = "_verdana";
Documentation for TextFormat:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextFormat.html
To see available fonts you can use the following:
var allFonts:Array = Font.enumerateFonts(false);
allFonts.sortOn("fontName", Array.CASEINSENSITIVE);     
for (var i:int = 0; i < allFonts.length; i++)
     trace(allFonts[i].fontName);

Similar Messages

  • Embedding and using external fonts in Flash CS5

    I just upgraded to Flash CS5.  Font embedding is entirely different than it was in CS4.  I've been looking for examples online but none seem to show me a solution that matches what I need.
    In the project I'm working on, code changes the font a text box uses based on region and language.  To keep file size down I created separate swf files with the fonts embedded.  That way I only download the font I need.  The way I did this and the code I used in CS4 doesn't seem to work anymore.  Can someone please point me to a tutorial on this.
    Thanks

    OK, maybe you can help me figure out what I'm doing wrong.  Below is the code I'm using.
    LOADING THE FONT
    Font SWFs:
    I'm trying something new with CS5.  To create a swf with the font I need I'm creating a library symbol of the font with all the characters in it.  Titled it "Verdana".  I've also turned on Export for ActionScript and given the font a unique class name (VerdanaFont).  Then of course publish the swf, name it Verdana.swf, and put it in the correct location.  Does doing it this way automatically register the font?
    The Loader code:
    private function LoadFont()
    var fontPath:String = "assets/fonts/Verdana.swf";
    var fontLoader:Loader = new Loader();
    fontLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, createTextBox);
    fontLoader.load(new URLRequest(fontPath));
    The TextBox code:
    private function createTextBox()
    var tf:TextFormat = new TextFormat;
    tf.font = "Verdana";
    tf.align = "left";
    var textBox:TextField = new TextField;
    textBox.embedFonts = true;
    textBox.selectable = false;
    textBox.htmlText = "This is test text";
    textBox.setTextFormat(tf);
    stage.addChild(textBox);

  • When you create a PostScript file you must rely on system fonts and use document fonts

    I got this error:
    "When you create a PostScript file you must rely on system fonts and use document fonts. Please go to the printer properties, "Adobe PDF Settings" page and turn OFF the option "Rely on system fonts only; do not use document fonts."
    This strikes me as bad practice. I only want to use system fonts and document fonts will muck me up.
    That being said, I could not easily find a way to fix this with Acrobat Pro XI. I opened Control Panel (Windows 8) and found the printer and mucked around in the various ways to get to change the PDF settings (there are several ways, and some of them present the choices as bold and not just regular). I found two separate switches for "Rely on system fonts only; do not use document fonts" and turned both off, BUT that did not work.
    Frustrated, I went back to FrameMaker and clicked File > Print Setup and then for the PDF printer, Printer Properties. There I found a THIRD instance of "Rely on system fonts only; do not use document fonts" that was set differently than the other two. This was the setting the error message meant. Change this one.
    Thanks for the convoluted UI, Adobe. What a pain, but there is the answer for all who follow after....

    > Windows 7 and Frame 7.2.
    This is not a supported configuration and probably does not work, due (I'm guessing) to driver API changes from XP to Win7, which would affect generating PDF and Ps output. This would affect Save-as-PDF and Print-to-Ps+Distill (unless you have a newer version of the full Acrobat product).
    As it happens, I'm going to attempt something similar: FM 7.0 on Win7 64 Pro. However, I'm going to install that old FM in "XP Mode".
    XP Mode is a 32-bit virtual machine running actual Windows XP inside Win7. It is (now maybe "was") available for Windows 7 Enterprise, Professional and Ultimate (but not Basic, Home or not-so-Premium). When XP went off support life earlier this month, Mr.Bill may have taken down the ability  to download XP Mode (or not, since some large enterprises are able to  purchase continued support for XP at some great cost). XP Mode never was supported for Win8. There are other VMs for Windows available.
    If XP Mode is still available, you also need a CPU that has hardware virtualization, which all recent 64-bit AMD processors do, but which is fused-off in many low end 64-bit Intel processors. AMD processors need a separate unobvious hot-fix patch installed before you do anything else about XP Mode.

  • How do I setup and use Hawaiian fonts?

    How do I setup and use Hawaiian fonts in OSX 10.7.4?  The instructions I obtained by Googling no longer seem to work.  See Wahinoho.net
    Message was edited by: fbeckner

    How do I setup and use Hawaiian fonts in OSX 10.7.4?  The instructions I obtained by Googling no longer seem to work.  See Wahinoho.net
    Message was edited by: fbeckner

  • Embedding and securing my font

    Hi to all,
    Its my first post, and need urgent help.
    Iam developing a application in local language and iam using my own font to be used in it. It will be used in as a resource in the application (embedded with app).
    Can anyone help me how to secure my font in the jar file. So that no one can extract it and use it.
    Any kind of help will be appreciated.
    Thankx in advance
    GD

    Can anyone help me how to secure my font in the jar
    file. So that no one can extract it and use it.Can't be done.

  • What is the best way to add and use custom fonts with Eloqua?

    We have a custom font that we'd like to use with Eloqua and were wondering how others might have successfully approached this.

    ~~Disclaimer: This answer refers to email fonts only - landing page font imports are discussed below~~
    Hi Brett,
    I took a look at these two posts: Re: Tips for getting the E10 email editor to change the email font for Outlook & other old-school email clients? and Re: E10 Fonts
    It seems that there are reasons as to why only a few of the fonts are supported. You can drill down into the source code to edit the font type, but I'm not sure that will get you anywhere.
    To drill down:
    To get the desired font & size in various clients (Gmail, Hotmail, Yahoo, Outlook) I found that specifying in the html works best.
    So whether it’s a P or TD, tag I add the style attribute & specify the font along with color & size.
    e.g.:
    <td style="LINE-HEIGHT: 18px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #000000; FONT-SIZE: 12px;">
    Of course if you use the WYSIWYG editor you will have to view the html source & add this.

  • Disable iSight camera and use external USA webcam

    We have a macbook and use a large monitor for managing brochures etc. I would like to mount an external USB webcam on the monitor and use it with Skype. However, whenever I open Skype it turns on the iSight camera (which is facing a wall). Is there any way to have the external webcam be the active camera and disable the iSight camera?
    Thanks

    Frodo 51 wrote:
    We have a macbook and use a large monitor for managing brochures etc. I would like to mount an external USB webcam on the monitor and use it with Skype. However, whenever I open Skype it turns on the iSight camera (which is facing a wall). Is there any way to have the external webcam be the active camera and disable the iSight camera?
    Thanks
    I no longer use Skype, so I cannot test Skype's claims, but http://www.skype.com/go/help should best be able to help you use their product with your system.
    I found this page http://www.skype.com/help/guides/skypeformac/skypefeatures/video.html that seems to address your specific question. The picture on that page shows that you should be able to select among connected cameras from the "Camera:" choices bar in Skype > Preferences > Video:
    Of course, if you have only one compatible camera connected, only the one choice will show.
    Use the latest version of Skype that is compatible with your system. If camera selection works as explained in the Skype Help page, there should be no need to "disable the iSight camera."
    EZ Jim
    Mac Pro Quad Core (Early 2009) 2.93Ghz w/Mac OS X (10.6.2)  MacBook Pro (13 inch, Mid 2009) 2.26GHz (10.6.2)
    LED Cinema Display  G4 PowerBook 1.67GHz (10.4.11)  iBookSE 366MHz (10.3.9)  External iSight

  • How to Use External Fonts

    Hi All,
    How can I use extrnal fonts i.e (Windows\Fonts) in my PDF Reports? I'm using APEX 3.01 to print my reports to PDF files. Arabic Characters Appers like ????.
    Same report Appears OK when I select HTML, Excel, word as my print file.
    Thanks,
    Ribhi

    I have successfully used Russian Fonts in LV 7. There are two ways to go about this. The first way is to use an ini or config file to do the conversion for you. This way you can type russian into the file and read in the proper strings. The second way is to take the integer value of the character and type cast it to a string. You must have the russian font installed first before this will work. My example used the alphabet and converted it to Russian. I used the ER Univers 1251 font and used a for loop that will run 32 times and added the iteration terminal with the value of 192 for lower case and type cased each value into a string from an integer. For upper case letters add the iteration terminal with 224. This will display the Russian Alphabet. Hope this h
    elps.
    BJD1613
    Lead Test Tools Development Engineer
    Philips Respironics
    Certified LV Architect / Instructor

  • Applet loading and using ttf font

    Hello,
    I'd like my applet to load a TTF file from the server (or from a provided jar file) and
    use it to render text, or use it with GUI elements like TextArea.
    Here the significant part of my code:
            URL fontURL=applet2.class.getClassLoader().getResource("my.ttf");
            try { fontStream = fontURL.openStream(); } catch (Exception e) {
                str=str+"Error 1\n";
                e.printStackTrace();
            str=str+"Step 1\n";
    // also tried this way instead, as well as including the ttf in a jar or as separate file on the server
    //      fontStream = getClass().getResourceAsStream("my.ttf");
            try { font = Font.createFont(Font.TRUETYPE_FONT, fontStream); } catch (Exception e) {
                str=str+"Error 2\n";
                e.printStackTrace();
            str=str+"Step 2\n";
            try { fontStream.close();} catch (Exception e) {
                str=str+"Error 3\n";
                e.printStackTrace();
            str=str+"Step 3\n";
            big_font=font.deriveFont(40f);
            text_out_main = new TextArea(str,4,40,TextArea.SCROLLBARS_NONE);
            text_out_main.setFont(big_font);the funny thing is, that this works on several Linux installations I tried (all UTF8/Unicode based ones).
    And I tried several WinXP/Win2k FF/IE/Safari combinations and none of them works! The Windows
    machines all show a standard font but with the size 40f, I cant see any exceptions, the strings "Step 1"
    to "Step 3" are nicely attached to the main string and not a single "Error x" string appears.
    All systems use the latest jre 1.6 plugins.
    Any hints are appreciated.
    Thanks,
    Leander
    Edited by: Leander2000 on Jun 7, 2008 5:55 AM

    Meanwhile I found out that the TextArea (or probably any other awt gui element)
    did not use the font when running on Windows, when drawing to a Graphic or using
    it with a JTextArea everything is ok.
    Regards,
    Leander

  • Anti alias and Use device font not why is that not working?

    I am editing a flash template that I have and I know
    about the anti alias setting and I went through all the text boxes and set them to use device fonts and they all seem to b
    e working except for the sliding text boxes, see attached images that show the sliding box (the gray color) and the text box behind it, when I drill down to the text box it is set to use device fonts already but when I enter my text it does not show all the letters (the W A and V for example are missing) I know that is caused by the Antialias setting but I am unable to find what is set to that in this sliding box, what am I missing? I am a very novice user so please be as detailed as you can in you answer, I can provide any information needed. Thank s in advance.
    I am using CS10

    I had the same issue. They say that because TRC Sri Lanka haven't registered IPad or apple as a safe product. That means the IMEI of apple products will not match with srilankan regulatory specifications. But this issue will be solved in near future. Please contact telecommunications and regulatory bord for details. Dialog axiata can't help.

  • Using external font file in a  pdf document

    Hello,
    I try to create programmatically a pdf file which whould use an external ttf file. Right now my soft generates something like this:
    3 0 obj
    <</Type /Pages/Count 1/Kids[5 0 R ]/Resources<</Font<</F1 7 0 R>>>>>>
    endobj
    7 0 obj
    <</Type /Font/Subtype /Type0/Encoding /Identity-H/BaseFont /TimesNewRomanPSMT/DescendantFonts [8 0 R]>>
    endobj
    8 0 obj
    <</Type /Font/Subtype /CIDFontType2/BaseFont /TimesNewRomanPSMT/CIDToGIDMap /Identity/FontDescriptor 9 0 R/DW 1000/W [1[722]2[610]3[443]4[389]5[277]0[777]]/CIDSystemInfo <</Ordering (Identity)/Registry (Adobe)/Supplement 0>>>>
    endobj
    9 0 obj
    <</Type /FontDescriptor/FontName /TimesNewRomanPSMT/StemV 80/Descent -216/Ascent 891/CapHeight 662/Flags 32/ItalicAngle 0/FontBBox [-568 -306 2000 1007]/FontFile2 10 0 R>>
    endobj
    10 0 obj
    <</Length 13 0 R/Length1 13 0 R/Filter /FlateDecode /F times.ttf>>stream
    endstream
    endobj
    13 0 obj
    836380
    endobj
    The times.ttf is in the same folder as a pdf. The document opens without error though the rendered text is completely different from that it suppose to be. I didn't find a good exemple in PDF spec and probably I intrepret it in a wrong way. I would be very thankful for any clue what is wrong in my code or a sample how could it be done correctly.
    thanks in advance

    From the snippet you posted, it appears that you didn't properly write out the value of the /F key in the stream. 
    However, that's just one of the reasons this won't work as you are expecting.  Even after you fix that, you should know that Adobe Acrobat & Reader have their support for external streams turned OFF by default (for security reasons) and that other viewers don't even support it at all.
    Is there a reason you don't wish to embed the font?  Or use standard referencing?

  • A zillion questions about setting up and using external hard drive

    Hello. I recently purchased a Cavalry 440GB CACE USB/FW800 7200 RPM 3.5 in Mac Formatted hard drive. My Mac is a Power PC G4 using OS X 10.2.8.
    After much back and forth with the Cavalry support desk, I was able to connect it to my Mac. (The USB cable included was not compatible--fortunately, my printer cable was.)
    Through Disk Utility I see that my Mac is detecting the hard drive, but there's no icon on my desktop. My questions are as follows:
    1. How do I get the icon on my desktop?
    2. It was suggested on this board to partition the hard drive. What exactly is partitioning, and is it necessary?
    3. If I do partition the hard drive, into how many partitions should I make it?
    4. Once the number of partitions is set, can that number be changed? In other words, can it be repartioned without erasing anything?
    5. My main purpose for getting the external hard drive is to move all my movies off my Mac. I'm sure I will want to back up other files as well. Should I create one partition for all the movies, and one for photos, one for files, etc.?
    6. Once I get the icon on my desktop, is transferring files as simple as dragging the files onto the icon?
    7. Once I move files to the hard drive, is it simple to move them back to the Mac if I need to use them again?
    OK, that's all for now. I appreciate your patience in dealing with all my questions! Thanks.

    Hello, 
    I'll try my best on the first seven. The remaining zillion minus seven questions will have to wait!
    1. If the drive really is Mac-formatted it should just appear. Firstly check that hard disks are set to appear on the desktop. In the Finder go to Finder > Preferences... >General tab and ensure that the box to show hard disks on the desktop is checked. If that doesn't work go to Macintosh HD > Applications > Utilities >Disk Utility. Select the drive in the left hand pane and then click on the "Erase" tab. Erase the disk and ensure the format is "Mac OS Extended (with Journalling)".
    2. Partitioning is splitting the physically drive into two or more volumes. This will allow you to compartmentalise your data. You will have two or more icons appear on the desktop if you do partition. Although they are on the same physical disk you will be limited on each of the volumes to the size you set at the time of partitioning. If you do partition the drive be sure to use the "Apple Partition Map" not "GUID Partition Map". The latter is for Intel Macs.
    3. Whatever you want. My experience is that too many partitions and you loose flexibility in your storage space. Personally on my external drive I have a partition that is exactly the same size as my internal hard drive. I then use that to do a regular clone backup. I then have a second partition for general use. This means I can put files on the external but still guarantee I have enough spare to backup fully.
    4. No. Not without third party tools.
    5. As I said above, in my opinion the best use is to create a partition for backup and a partition for all other use.
    6. Yes absolutely. However if you plan on moving libraries like iTunes or iPhoto then you'll need to show the applications where the libraries are again.
    7. Yes.
    Some extra pointers:
    A. Use Carbon Copy Cloner to backup your internal drive to the external. Clones are fantastic backups as even if the internal drive bursts into flames you will have an identical copy of all user data and settings: http://www.bombich.com/software/ccc.html (scroll to the very bottom for the version suitable for 10.2.8).
    B. Don't use USB to connect the hard drive it's not very fast. Firewire 400 is significantly faster and will allow the iMac to be booted from the external drive in an emergency (USB will not boot a G4 Mac).
    Hope that helps a little.
    mrtotes

  • Switching screen off on Tecra and using external monitor/LCD TV

    I recently bought an LCD TV and was looking forward to using it as the monitor for my Toshiba Tecra M2V. I have run into problems.
    I seem unable to "turn off" the laptop screen and ONLY use the LCD TV screen to cary out work, play games etc. Rather I seem only to beable to COMBINE the LCD screen with my LCD, effectively creating a "two screen monitor". I have followed all the online help and still I am unable to have only one screen.
    I just want the LCD TV as my screen!
    Any ideas on how to do this? It is really a pain!!
    TIA

    Hello
    Usually you should be able to do it using FN+F5 key combination. As far as I know if the unit is connected to the TV you have three possibilities (maybe depends on notebook model) LCD only, LCD and external device and just TV.
    You can also try to switch it using GeForce properties:
    Display properties > Settings > Advanced > GeForce tab > Device Settings > Select output device.

  • Clearing Memory and using External HD as iTunes Location

    Hi all
    I am having a little trouble with clearing space on my MacBook Pro (4GB Memory running Mac OS X 10.7.5). It is running slowly and often comes up with a warning message saying there's insufficinet space on the start up disk and that there is little memory left. I have copied all pictures and music on to an External HD (2TB Seagate connected by Wifi) but all the music is still in the iTunes library too.
    I would still like to use iTunes as my music library but need to delete the music from my laptop so that it has more space on it. How do I do this? I have tried it with one song i.e. I have deleted it from the iTunes library on my machine and the song remains on the External HD..... but how can it work so that when I go into iTunes it will still find the songs on the Extrnal HD?
    I will also be buying a Sonos hifi system so I will be using the music stored on the external hard drive as the library but I believe this all goes through iTunes anyway?
    Hopefully this makes sense and apologies for the lack of knowledge around technical jargon...
    Thanks in advance.....

    Our iTunes guru Terence Devlin advises the following:
    1. Quit iTunes
    2. Drag the iTunes folder from your internal hd - located in ~/Music folder - to your external hd (which has to be formatted as HFS Extended (Journaled)). DO NOT delete the original one from your internal hd... yet!
    3. When the transfer is complete, press and hold the Option(alt) key and fire up iTunes.
    4. A "Choose iTunes Library" window will come up. Click on the "Choose Library" button.
    5. Navigate to where the iTunes folder is located in the external hd.
    6. Within the iTunes folder, select the iTunes Library file and click Choose...
    That's it. iTunes will now display all your playlists, songs, movies, podcasts etc. At this point, should you wish, you can delete the iTunes folder from the internal hd to free up space.
    More info:
    http://support.apple.com/kb/HT1751
    Or if you prefer a more complicated explanation:
    http://www.ilounge.com/index.php/articles/comments/moving-your-itunes-library-to -a-new-hard-drive

  • Using external fonts in swing

    Hello, I am a newbie and I am learning java... my question is can we use other than system fonts in swing UI? like i just downloaded a ttf format font http://www.fontpalace.com/font-download/Champignon+Script/ and now i want all my labels/text-fields to be displayed in this style? is it possible.. plss help

    http://www.ritter.biz/en/programming/java/14-wie-verwende-ich-eigene-schriftarten-in-meinen-java-anwendungen
    or
    http://www.java2s.com/Code/Java/2D-Graphics-GUI/Loadfontfromttffile.htm

Maybe you are looking for

  • Can anyone shed some light on this?

    We are having problems running two iPhones.  When a setting is changed on one one it changed the other.

  • ICal Alarms not working in iPod

    Around six months ago iCal alarms stopped working on my iPod. They do not even show up when I view a To Do or Event on my iPod. This happened all of a sudden and I have never changed any settings other than installing standard updates. I cannot recal

  • Io.File and remote files

    Hi. I use the next code so I can get the files inside a Windows-shared folder. I allow write/read when I share the folder in my network. This is the code: File root=new File("//HostName/sharedFolder"); FileFilter fileFilter = new FileFilter() { publi

  • Wireless charging plates not working

    Just received two wrieless charing plates. Despite of the fact that their power adapters are white while they are black (Would be nice if Nokia could match their colors, it isn't so hard and would look much better) none of them seem to be working. Tr

  • Memory leak when exceptions are thrown?

    Hello, I'm doing a simple database connect with the JDBC Oracle 8.1.6 oci8 drivers on Solaris. It seems whenever I try to repeatedly connect to a database, and an exception is thrown, such as database not found, or wrong password, the program size gr