Loading external fonts in midp apps

hello every body
my question is can i add external fonts to my midp apps? say for example i want to add andulas.ttf font and want my application to show text in to that font?
please provide a sample code if you can on how to do that....

yes i need the font for display purpose. basically i am developing an application that receives an unicode character string upon request and display the content in bengali language. i have installed the Arial Unicode Ms to my machine and edited the .properties file of the default phone from sun wireless toolkit accordingly. Arial Unicode Ms supports my language. i am using StringItem to output my content. but when i am output the content it doesnt change the outcome. it just simpley outputing the unicode string as if it has been passed!!!!
here goes my code..
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class UnicodeTest extends MIDlet
     private Display display = null;
     private Form fm = null;
     private StringItem si = null;
     private Command exit = null;
     public UnicodeTest()
          display = Display.getDisplay(this);
     public void startApp()
          fm = new Form("My form");
          si = new StringItem("in bengali: ","KixeDUw�k gwvlw hwnwk BxZpwo L�g �gxm xb�dk dt");
          fm.append(si);
          display.setCurrent(fm);
     public void pauseApp()
     public void destroyApp(boolean unconditional)
          notifyDestroyed();
}the following goes my properties files font part...
font.default=Arial Unicode MS-plain-10
font.softButton=Arial Unicode MS-plain-11
font.system.plain.small: Arial Unicode MS-plain-9
font.system.plain.medium: Arial Unicode MS-plain-11
font.system.plain.large: Arial Unicode MS-plain-14
font.system.bold.small: Arial Unicode MS-bold-9
font.system.bold.medium: Arial Unicode MS-bold-11
font.system.bold.large: Arial Unicode MS-bold-14
font.system.italic.small: Arial Unicode MS-italic-9
font.system.italic.medium: Arial Unicode MS-italic-11
font.system.italic.large: Arial Unicode MS-italic-14
font.system.bold.italic.small: Arial Unicode MS-bolditalic-9
font.system.bold.italic.medium: Arial Unicode MS-bolditalic-11
font.system.bold.italic.large: Arial Unicode MS-bolditalic-14
font.monospace.plain.small: Arial Unicode MS-plain-9
font.monospace.plain.medium: Arial Unicode MS-plain-11
font.monospace.plain.large: Arial Unicode MS-plain-14
font.monospace.bold.small: Arial Unicode MS-bold-9
font.monospace.bold.medium: Arial Unicode MS-bold-11
font.monospace.bold.large: Arial Unicode MS-bold-14
font.monospace.italic.small: Arial Unicode MS-italic-9
font.monospace.italic.medium: Arial Unicode MS-italic-11
font.monospace.italic.large: Arial Unicode MS-italic-14
font.monospace.bold.italic.small: Arial Unicode MS-bolditalic-9
font.monospace.bold.italic.medium: Arial Unicode MS-bolditalic-11
font.monospace.bold.italic.large: Arial Unicode MS-bolditalic-14

Similar Messages

  • Solution for load external FONT sf file to iOS application

    Hi,
    i follow this instruction to load externalHosted sf files to iOS application.
    http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-swfs-for-air- apps-on-ios/#comments
    I need to load external swf files (Font only) on runtime and embed it runtime.
    But I always got the uncompilled action script error on adhoc or release build.
    how can I solve this problem? The Font is not an asset, and I can't load it on runtime on iOS?
    thanks

    Did you try this doc? Packaging and loading multiple SWFs in AIR apps on iOS

  • Unable to load external image into iOS app with AS3

    Just trying out Flash Builder for iOS app development and have run into a problem right off the bat with loading an external image into an iOS app.  The actionscript is very simple (this was basically my Hello World attempt), and I'm hoping someone here can explain where I'm going wrong.  This code works in Flash Pro, and works when launched on the desktop from Flash Builder, but doesn't work on my iOS devices.
    Here's the code:
                                  var container:MovieClip = new MovieClip();
                                  addChild(container);
                                  var imageLoader:Loader = new Loader();
           imageLoader.load(new URLRequest("http://www.google.ca/intl/en_ALL/images/logos/images_logo_lg.gif"));
                                  imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, startListener);
      function startListener (e:Event):void{
                                                 container.addChild(imageLoader);
    Any thoughts on why this won't work would be greatly appreciated!

    I had the same issue, and modified my domain policy file as specified  in http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security.html#_Configuring_URL_M eta-Policies but the loader is not loading the file. Any ideas on how to fix this issue?

  • Loading external swf into Air App

    Hi All,
    I'm building an Adobe Air App for desktop and am having problems loading an external swf. Every time i try to load i get:
    SecurityError: Error #2070: Security sandbox violation........ cannot access Stage owned by app....blah blah
    The file that is being loaded is in a local directory, but as i understand its in a different 'sandbox' which is a security risk.
    Is there any way around this?!
    Any help would be much appreciated
    Many Thanks
    Matt

    that's why i added those comments about the swf's domain.  for locally loaded swfs, use:
    SFMltd wrote:
    Hi Kglad, Thanks for the Example.
    if i run my class with securityDomain = SecurityDomain.currentDomain; then it throws this error: SecurityError: Error #2142: Security sandbox violation: local SWF files cannot use the LoaderContext.securityDomain property.
    The swf file im trying to load is stored locally so i guess this error makes sense. However if i comment out that line i get the same "cannot access Stage owned by app" error?
    See below for class:
    package  {
      import flash.display.MovieClip;
      import flash.filesystem.File;
      import flash.events.Event;
      import flash.net.FileReference;
      import flash.events.MouseEvent;
      import flash.display.Loader;
      import flash.net.URLRequest;
      import flash.system.LoaderContext;
      import flash.system.ApplicationDomain;
      import flash.system.SecurityDomain;
      public class assetPreview extends MovieClip {
      private var loader:Loader;
      private var mainSWF:MovieClip = new MovieClip();
      public function assetPreview() {
      addEventListener(Event.ADDED_TO_STAGE, initialise);
      public function initialise(e:Event):void
      removeEventListener(Event.ADDED_TO_STAGE, initialise);
      var allowSWF:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain);
    // allowSWF.securityDomain = SecurityDomain.currentDomain;
      loader = new Loader();
      loader.load( new URLRequest(settingsXML.pathToSWF),allowSWF);
      loader.contentLoaderInfo.addEventListener(Event.COMPLETE, viewPreview);
      public function viewPreview(e:Event):void
      addChild(mainSWF);
      mainSWF.addChild(loader);

  • How to load external fonts loading in single file

    I am load multiple swf files in single root swf file. Is it possible multilple fonts  embeding in single file. If it is possible can help any one.

    Heya,
    I believe you can embed the .swf file using flex code in flex builder. I just did a quick google search and came up with a few articles. I don't think there is a way to do this in Catalyst yet, but please correct me if I am wrong.
    I am also building my portfolio in Catalyst as a little project and although there are some bugs I am really enjoying the Beta
    Hope this helps!
    Chris

  • Loading external Font

    Hi,
    I'm working on big site localized in 27 Europeans countries.
    I'm looking a way to dynamically load font(different fonts
    for each country's) at runtime and set then in Textfield.
    Maybe something like set a kind of class "Title_font" as
    Textfield font and then by countries load the appropriate font for
    displaying specific character of this particular country.
    Really appreciate if someone can share his knowledge with me,
    per advance thank you.
    Julien Terraz

    Hm, yes, I remember there being some challenges in this regards, with Modules loading fonts at runtime.
    If you take a look at the section "Using run-time style sheets with modules," they describe the basic approach where everything has to be loaded and registered in the primary application domain.
    I think it should work fine the way you have it, provided you are registering both the font and the loaded SWF in the primary application domain. If not, you may need to push the font registration down into the application domain being used by the loaded SWF.
    Something like this perhaps:
    childApplicatonDomain.getDefinition('flash.text.Font').registerFont(fontClass);
    Where childApplicatonDomain is the application domain of the loaded SWF.

  • Chose and load external sound in ios app

    i want to make a sound player app that user can chose music in their phone and play it with this app. so now i want to know which class can do it?

    I had the same issue, and modified my domain policy file as specified  in http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security.html#_Configuring_URL_M eta-Policies but the loader is not loading the file. Any ideas on how to fix this issue?

  • Loading external fonts

    I'm stuck with this problem:
    I have a specific font installed on my computer.
    I putted the ttf file of that font in the jar of my project and it works fine.
    But logically when I run the jar on another computer it won't load the ttf file
    How do i solve this problem?
    This is the specific code that i use now...
    InputStream in = this.getClass().getResourceAsStream("/Fonts/Digir___.ttf");
    Font font = Font.createFont(Font.TRUETYPE_FONT, in);
    Font font2 = new Font(font.getName(),font.getStyle(),30);Thanks in advance,
    Simon
    Edited by: SimonDS on Apr 20, 2008 6:35 AM

    I have a Swing application reading an inputStream to load a ttf file from the application's jar-file to create a font via createFont().
    It works fine when compiled and run in SDK/JRE "1.6.0_07" and below; runs fine on 1.5.
    I installed SDK/JRE "1.6.0_10-rc"; it fails now, with java.security.AccessController.doPrivileged(Native Method),
    Jars previously compiled with "1.6.0_07" work fine using "1.6.0_10-rc" run-time.
    Please advice; my concern is the long-term compatibility since I distribute the application and needs operation across Windows, Mac and Linux, until now this has not been a problem; please advice; the resolution and/or correct usage to load a ttf-file from a distribution jar-file.
    Thanks;
    java.io.IOException
    at java.awt.Font$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Font.createFont(Unknown Source)
    java -version
    java version "1.6.0_10-rc"
    Java(TM) SE Runtime Environment (build 1.6.0_10-rc-b28)
    Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
    String fontFile = "packagename/afont.ttf";
    InputStream is = ClassLoader.getSystemResourceAsStream(fontFile);
    Font nfont = Font.createFont(Font.TRUETYPE_FONT, is);
    is.close();
    This code works fine in when compiled using SDK/JRE "1.6.0_07"
    java -version
    java version "1.6.0_07"
    Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
    Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

  • Loading external swf fonts created with fontswf, loaded with a Loader, compatible with iOS

    Let me immediately start out by saying that I do in fact have a current working solution for using embedded fonts, generated by fontswf and working in an AIR ActionScript mobile application, and also currently working fine with iOS.
    My current app needs CFF fonts, so I currently use the fontswf tool to pre-generate the .swfs using:
    fontswf -4 -a [SomeAlias] -o [SomeFont.swf] [SomeFont.ttf]
    and then I am currently embedding them in my app source code .as for compilation using:
    [Embed(source="/swf/SomeFont.swf", symbol="SomeAlias")]
    public static var SomeFontClass:Class;
    I then have no problem registering them using Font.registerFont(SomeFontClass) and everything works fine.
    However, I would prefer to take the use of these swf fonts one step further and load them dynamically using a Loader so that I do not have to take the hit of having multiple CFF font swfs embedded in the main compiled SWF and so that I could even load an unknown future set of fonts without having to supply them as part of the app build.
    Now I have seen and read many blogs and tutorials where people have exported font swf from Flash Builder where you add an explicit 'Class' name or even made standalone .as static files compiled into standalone swfs only including the two lines:
    [Embed(source="/swf/SomeFont.swf", symbol="SomeAlias")]
    public static var SomeFontClass:Class;
    so that you also have a 'Class' involved. Then people use some form of appropriate applicationDomain.getDefinition("className") as Class
    to pull out the class for the font registration.
    My question is, how does one perform the same font loading and registration of fonts using a Loader only loading the .swfs produced directly from fontswf?
    It seems only a DefineFont4 is tagged in the swf, there doesn't seem to be a 'Class' per se to call on.
    More importantly, iOS apps cannot load external swfs with code in them, so my understanding is any extra wrapped swf that would contain a custom Class technique would fail the iOS requirement of only having one main SWF with any ActionScript compiled code.
    Is there an alternative to the 'Class' technique by grabbing the DefineFont4 tagged resource from the swf and instantiating a proper working Font class from that? One that would still be compatible with the restrictions placed on AIR mobile apps running on iOS?

    Ironically, just after posting this, Adobe released AIR 3.5 beta onto labs, and added multiple SWF support for iOS.
    While this new support makes it easier to manage your content across multiple SWFs and technically allows you to use the class based separate .swfs for each font if desired, the system still requires that all these SWFs be present at compile time when making the final app .ipa for iOS.
    So this still doesn't solve trying to load fonts after the app is already built. For example, as part of a downloaded in-app purchase mechanism.

  • Will app store approve an app to load external swf containing actionscript code in it?

    Will app store approve an app to load external swf containing actionscript code in it?

    Hi...It is not in the application bundle...it will be hosted on a server and from there it will be loaded in the application. I had created one sample application where it is loading a swf which is hosted on different server. This swf contained some actionscript code on its timeline. This app was working on ipad. I just wanted to know whether App Store will approve this.

  • External Fonts not loading properly in panels & buttons, works fine in labels / edits - help!

    Hey guys,
    I'm new to developing in Flex, so please excuse any
    ignorance.
    I followed the basic tutorial to use Flex to import external
    fonts... here's my CSS code:
    @font-face {
    src: url(components/fonts.swf);
    fontFamily: "Blue Moon";
    global
    color: #000000;
    fontFamily: "Blue Moon";
    fontSize:20px;
    Here's what's happening:
    1) On my development machine, I have the "Blue Moon" font
    installed. Everything works fine here - I see the Blue Moon font on
    everything in my project, from the titles of Panels to Buttons, and
    so on. Everything's great.
    2) On all other machines, which do NOT have the Blue Moon
    font installed, I see the Blue Moon font properly on the labels and
    edit boxes, but NOT on the buttons or on the title areas of panels.
    Here is my site, so you can see what I mean:
    http://thedemenscycle.com/
    Assuming you don't own the Blue Moon font, you should notice
    that the panel titles are a default font, where the "Username" and
    "Password" and edit box fields are the Blue Moon font.
    I am forced to conclude that for whatever reason my code is
    not applying the externally imported font to the panels and buttons
    for whatever reason. But it DOES apply the local font on the
    machine, if availible. I'm really quite confused.
    Any insight / help would be greatly appreciated!
    Thanks,

    I had this same problem, ended up just droping the fonts,
    would be nice to see an official response to this issue.

  • Context: Error loading external library

    Oracle 8.1.5EE, Solaris 8 (x86)
    create index quick_text on quick ( text )
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: ConText error:
    ORA-06520: PL/SQL: Error loading external library
    ORA-06522: ld.so.1: extprocPLSExtProc: fatal: relocation error: file
    /oracle/app/oracle/product/8.1.5/ctx/lib/libctxx8.so: symbol ociepgoe:
    referenced symbol not found
    ORA-06512: at "CTXSYS.DRUE", line 122
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 34
    ORA-06512: at line 1
    whats the problem ?!
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Omar Alonso ([email protected]):
    Make sure that the Net8 listener is running and is configured to invoke external procedures.<HR></BLOCKQUOTE>
    Of cause its running and configured as follows:
    listener.ora:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (PROGRAM=extproc) (ORACLE_HOME=/oracle/app/oracle/product/8.1.5)
    (SID_NAME=PLSExtProc)
    tnsnames.ora:
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    LD_LIBRARY_PATH - ok to lib and lib/ctx
    + /var/ld/ld.conf - correct
    + ENVS=LD_LIBRARY_PATH=... - set
    I dont understand whats the problem ;-(
    services looks like this:
    PHNET3 has 5 service handler(s)
    DEDICATED SERVER established:0 refused:0
    LOCAL SERVER
    DISPATCHER established:94 refused:0 current:13 max:254 state:ready
    D000 <machine: phnet3, pid: 19391>
    (ADDRESS=(PROTOCOL=tcp)(HOST=195.133.235.229)(PORT=34087))
    DISPATCHER established:162 refused:0 current:13 max:254 state:ready
    D001 <machine: phnet3, pid: 19393>
    (ADDRESS=(PROTOCOL=tcp)(HOST=195.133.235.229)(PORT=34088))
    DISPATCHER established:132 refused:0 current:13 max:254 state:ready
    D002 <machine: phnet3, pid: 19395>
    (ADDRESS=(PROTOCOL=tcp)(HOST=195.133.235.229)(PORT=34089))
    DEDICATED SERVER established:0 refused:0
    LOCAL SERVER
    PLSExtProc has 1 service handler(s)
    DEDICATED SERVER established:0 refused:0
    LOCAL SERVER
    null

  • Flash cs4 mac - Error opening URL '/:Users:someting.swf' - Not a "loading external content" problem

    Hello.
    I am having a weird problem when trying to test a movie or publish preview -> flash on mac with Leopard os.
    The result is a blank movie with the usuall "movie not loaded" if u right click on it and the output returns the "Error opening URL 'the path of the swf here'.
    This has nothing to do with loading external files or something like that. It happens even in blank movies and it gives the same error if I try to open a swf from flash ide.
    I can publish the project or export the movie with no problem at all.
    I can preview the movie in html. I can run all the swf files in my hard disk, network, usb stick, dvd etc., but when I try to open any of these files from flash ide I got that stupid error.
    Its not something that stops me from working in flash ide but its slow to export movie any time I want to test it.
    Things that I've tried so far but nothing worked:
    Update the flash cs4 to the latest version
    Update the flash players
    Restored the release flash player as default player (I am using as default the debug player)
    Cleared the preferences
    Move the flash cs4 folder to another location in hd
    Saved the fla document first before testing the movie (in different places with or without spaces in document name or folder)
    Give read & write permissions for everyone for flash.app, players and for fla files when saved first before test movie
    Unistall and install the application 3-4 times.
    Test every as version just in case.
    Also I've checked the folders when testing movie and I can see that it creates an swf file, which I can run it outside flash ide (the one that the flash ide player cannot load) with no problem.
    The mac os has the default set up as it came. Nothing chnaged in permissions or security settings.
    Thanx in advance.

    In this particular example I am using this code to start the
    xml file load:
    // now load the XML file that contains the content strings
    var sXMLFile:String = "xml/home.xml";
    var xmlContent:XML = new XML();
    xmlContent.ignoreWhite = true;
    xmlContent.onLoad = onXMLLoadComplete;
    xmlContent.load( sXMLFile );
    But I don’t think the code is the problem here . This
    happens on every file I load when I am using a relative path to the
    content, regardless of how I load the content (XML object,
    loadMovie, MovieClipLoader, etc…) and the same code executes
    perfectly on every other machine in the office(Mac and PC).
    I’m more concerned with the semi-colons and .swf filename
    that Flash is putting into my relative path on the error message.
    Is that normal?

  • How to register External table into Oracle APPS?

    hi
    can we register the External table in Oracle apps like SQL Loader?
    So if yes, please share the steps.
    Thx

    781261 wrote:
    okk..
    But i mean , we create Executable with Method type SQL Loader, to register in Oracle APPS.
    SO like what would be Executable Method for External Table?
    or can we call the External table in Procedure?
    ThanxI don't know oracle APPS (and this isn't the APPS forum), but an external table is just like another table. It's created once and then used by queries to fetch data. You would reference it in your applications just the same as you would any other table.

  • Load TTF font ???

    hi,
    i'am trying to distribute with my application an external font.it's loading correctly but nothing appear on screen :/
    JLabel label = new JLabel("Hello World");
    FileInputStream stream = new FileInputStream("c:\\LED.ttf");
    Font f = Font.createFont(Font.TRUETYPE_FONT,stream);
    label.setFont(f);
    does it's possible to set a font that is not in normal system path ?
    vincent.

    I once did it like that for a special font used via a label. It works for both file system and jar files:
    public class CSpecialFontLabel extends JLabel {
         private static final String URL_FONT = "appl/gui/font/ariblk.ttf";
         private static Font m_font;
         public CSpecialFontLabel(int style, int size) {
              loadFont();
                  setFont(m_font.deriveFont(style, size));
          * Draws the version info.
         public void paint(Graphics g) {
              Graphics2D g2d = (Graphics2D) g;
              g2d.setRenderingHint(
                   RenderingHints.KEY_ANTIALIASING,
                   RenderingHints.VALUE_ANTIALIAS_ON);
              super.paint(g);
          * Loads the font for the version info
         private void loadFont() {
              if(m_font == null) {
                try {
                        InputStream is = this.getClass().getClassLoader().getResourceAsStream(URL_FONT);
                        m_font = Font.createFont(Font.TRUETYPE_FONT, is);
                        is.close();
                   } catch (Exception e) {
                        // loading font failed -> use std. Font
                          m_font = new Font("Arial", Font.ITALIC | Font.BOLD, 60);
    }

Maybe you are looking for

  • Dynamic target directory with variable substitution

    Hi everyone. I'm trying to save a file in a folder with receiver adapter. This folder is determined in runtime and passed to the adapter with variable substitution. My problem is that in RWB i get a error like this : 'Content of variable XXXXX is not

  • Voice over on an ipad

    I cannot activate voice over on an ipad 1. Is there a tutorial on it? I'm trying to set it up for a visually impaired person.

  • Redeemed  a  card and no money is showing up.

    Okay. I got a gift card IN my hand at the moment. I redeemed it and it asked me to log in. I went to create account and it said my name was already in use so I figured I already had an account so I figured out the password (using lost password)and lo

  • What is MDX on earth? some questions ...

    Hello gurus I am planning to use a 3-party tool to make query to acccess data within SAP BW, which intends to replace Bex tools. I heard that OLE DB/OLAP BAPI/XMLA are three options of interfaces, and all those three interfaces are based on MDX. Afte

  • Satellite C850 shows error message "Your Computer is low on Memory"

    Hi, I recently bought a Satellite C850, windows 8 and with 4G RAM laptop. But I always have the above error message even I just browse the internet. If I ignore this message and keep using, my computer will close the program I am using, for e.g. Exce