Load OTF font from file

I've read in several places, that java 6+ supports OTF fonts, yet I can not find, how one can load an OpenType font frm a file.
There are numerous examples of how to load TTF fonts, by calling
Font.createFont(Font.TRUETYPE_FONT, fontFile);but none seems to notice the glaringly obvious problem, that the OPENTYPE_FONT font type constant does not exist.
So... is it possible? How is it possible?

As it turns out, the OTF fonts load just fine with Font.TRUETYPE_FONT set as the font type.

Similar Messages

  • Load fonts from file

    In Java I can load fonts from a file or register it:
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
         ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File("A.ttf"));But in JavaFX this code shows the error:
    cannot find symbol
    symbol  : function registerFont(java.awt.Font)
    location: class java.awt.GraphicsEnvironment
    It is probably because the registerFont method was only added in JDK 1.6
    How can I register a font in JavaFX or load it from a file or create a JavaFX font from the java.awt.Font class?

    I tried this but the text is not shown.
    I guess it is because the font size is zero.
    How can I change the font size in this case?
    The code below shows an error:
    def fxFont = com.sun.javafx.tk.Toolkit.getToolkit().getFontLoader().font(awtFont);
    fxFont.size = 24;Main.fx:19: size has script only (default) write access in javafx.scene.text.Font
    fxFont.size = 24;
    1 error
    My application is:
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.text.Text;
    import java.io.File;
    // http://www.fontfreak.com/charactermaps/a/AajaxSurrealFreak.htm
    def path = "D:/Download/Browser/temp/AAJAX.TTF";
    def awtFont = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT, new File(path));
    def fxFont = com.sun.javafx.tk.Toolkit.getToolkit().getFontLoader().font(awtFont);
    Stage {
        title: "Application title"
        scene: Scene {
            width: 250
            height: 80
            content: Text {
                font: fxFont
                x: 10
                y: 30
                content: "Application content"
    }

  • Can't load thumbnail photo from file 'BBThumbs.dat'

    Hi everybody,
    I'm developing an application on BB to take and view photo. My problem is can't load the thumbnail photos from file 'BBThumbs.dat'. I'm using code as below:
    public byte[] getThumb(String fileName) {
    String DB = fileName.substring(0, fileName.lastIndexOf('/'))
    + "/BBThumbs.dat";
    fileName = fileName.substring(fileName.lastIndexOf('/') + 1, fileName
    .length());
    if (thumbsMap == null) {
    thumbsMap = new Hashtable();
    byte b[] = null;
    FileConnection fc = null;
    InputStream in = null;
    try {
    fc = (FileConnection) Connector.open(DB, Connector.READ);
    if (!fc.exists()) {
    return null;
    byte[] temp=new byte[(int)fc.fileSize()];
    in = fc.openInputStream();
    DataInputStream is=new DataInputStream(in);
    // b = getThumbNail(first, thumbsMap, fileName, in);
    is.readFully(temp);
    b=readThumbs(temp, fileName);
    } catch (Exception e) {
    } finally {
    if (fc != null) {
    try {
    fc.close();
    } catch (Exception e) {
    if (in != null) {
    try {
    in.close();
    } catch (Exception e) {
    return b;
    please give my any idea or suggestions. Thanks 

    Try:
    !Section=Dimensions
    'Name;DimensionClass;DimensionAlias;CustomDimensionID
    SKU;Generic;;
    !Members=SKU
    'Name;DataType
    Brand1;Unspecified
    Brand2;Unspecified
    !Hierarchies=SKU
    'Parent;Child;DataStorage
    #root;Brand1;StoreData
    #root;Brand2;StoreData
    Tho I would add MemberValidForPlan#;Plan#Aggregation, where # is a number of your application which this member is valid for or even has a specific aggregation, as well
    example:
    !Hierarchies=SKU
    'Parent;Child;DataStorage;MemberValidForPlan1;MemberValidForPlan2;MemberValidForPlan3;Plan1Aggregation;Plan2Aggregation;Plan3Aggregation;UDA
    #root;Brand1;StoreData;Y;Y;Y;+;+;+;
    #root;Brand2;StoreData;Y;Y;Y;+;+;+;
    Even more as an idea use pipes, maybe.
    But you will need to say something about Aliases as well if this is a planning application.

  • Loading Instrument settings from file

    Hi there
    I am developing a new app that uses quite a few possible instrument configurations and needs to be able to support multiple instruments models. I have written a little GUI that lets users select a config from various settings on different tables. I now want to save this config to a file and maybe read in the settings when they want to edit it again. Can any body suggest and tried and tested formats for doing this. I was going to use configuration files with a section for each instrument type and then keys for model number and GPIB addr but am open to any other suggestions as I need to do this quickly (whats new eh !) and it needs to be scalable.
    Instrument settings will be loaded from file into Globals by each test sequence so that globals can be re-used etc
    Cheers in advance.
    Chris R

    Chris,
    Option 1 - HDF5
    I have found HDF5 the best method for saving configuration data. You can get low-level HDF5 utilities for LabVIEW by searching for sfpFile or HDF5 on the main NI website, or try this link.
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/cb8a7f8090900f6c86256cc700033816?O...
    HDF5 is a binary, hierarchical file format, with a lot of built-in features such as compression and 64-bit file pointers. As such, it is fast, allows for easy backwards compatibility, and you can put anything into it. It also allows circular references (it is actually a directed graph, not a tree), so, for example, you can reference data from configurations and configurations from data. I maintained the NI-SCOPE Soft Front Panel configuration file with this method through many years and configuration changes.
    Now for the bad news. HDF5 is very low level. Expect to take a week to get comfortable with it. HDF5 is not threadsafe, so you must ensure that you never call the DLL from more than one place at once. The posted code uses version 1.4.4 of HDF5, while the latest version is 1.6.3.
    Option 2 - Configuration file VIs
    If your configurations are fairly simple and have no real hierarchy, consider the configuration file VIs found on the file palette. These store your data in a Windows style INI file, so it is easily human readable. They are not as fast as the HDF5 solution, and have only a single layer of hierarchy, but they are written in pure G, so are very portable.
    Good luck. Let us know how you make out.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Load combobox items from file

    Hi,
    I dont know do I use correct components here, but I have tried to load some dropdown selector's items from file. I have file, which items changed all the time, so I have to load those to user's dropdown selectro every time when program starts. Eny ideas?
    A.A
    Solved!
    Go to Solution.

    Use a property node Strings
    Strings [] Property
    Short Name: Strings[]
    Requires: Base Package
    Class: ComboBox Properties
    Array of the strings from which you can select in the combo box control. Use the Strings And Values [] property to specify custom values for each string.
    If you use this property with a combo box control that has custom values, the number of values for the combo box control determines the number of strings you can set using this property. For example, if the combo box control has the values Free, Discount, and Full, you can set only three strings using this property.
    If the combo box control has more values than the number of strings you wire to this property, LabVIEW creates strings for any values that do not have corresponding strings. For example, if the combo box control has the values Free, Discount, and Full and you wire the strings Voucher and Coupon to this property, LabVIEW sets the last string to <Full>.
    This property is similar to the Edit Items item on the shortcut menu of a combo box control and to the Labels option on the Edit Items page of the Combo Box Properties dialog box.
    Omar

  • 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

  • Load "Selected" in a Property Loader test step from file

    Hi,
    The Import/Export tool stores its selected properties in the file �PLPropertyLoader.ini�. Is it possible to use this file to specify which properties a �Property Loader Test Step� should load? How? Then the information about what to export and load dynamically later is stored in the same location and the risk possibilities is reduced to one place.
    Best regards,
    Morten Pedersen
    CIM Industrial Systems A/S
    Denmark

    Morten -
    By default, the Property Loader step type stores its selected property list in the step's property "Step.PropertyList". The Edit Property Loader dialog box has the "Property List Source" expression control that specifies this as its value.
    If you created a Station Globals array property of type "DatabasePropertyMapping", you could specify that the steps use this property. You might have to set to show hidden properties to find the "DatabasePropertyMapping" type in the insert menu. Note that when you do this when you edit the selected list in a step you are editing the selected list stored in the station global array property.
    Scott Richardson (NI)
    Scott Richardson
    National Instruments

  • How to save/load JTextPane to/from file?

    One of the simplest questions re Swing.
    How to save a JTextField onto a file?
    And, how to read back it onto a newed JTextPane?
    Yes, I have searched, searched and searched on the net, in vain.

    Assuming he's wanting to do the reasonable thing, I'm trying to do it too.
    linuxoid, I suspect he (and I) are looking for a way to save the contents. After all, a control that you can't get the information out of is pretty useless.
    Styled text is often just a BLOB to the rest of the app. It is in my case, and it probably is in his.
    I'm having the same trouble he is.
    I want to make a JTextPane, let the user edit it, then get some reasonably portable representation of it's current contents that I can serialize. A string representation of XML sounds dandy. Incomprehensible binary is acceptable. A representation in some markup language that I can insert in some other document and have it act like I'm inserting text in the editor would make me more than happy.
    Ideally, what I, and probably he, are looking for is something like
    JTextPane myPainIsGreat = new JTextPane();
    ... life goes on...the user writes poetry and turns the words tacky colors...
    String thisICanDealWith = myPainIsGreat.getStyledTextRepresentation();
    knowing better I'd settle for
    myPainIsGreat.writeStyled(someWriter)
    sadly, JTextPane's write just returns unstyled text

  • Problem loading fonts from ID3 to ID CS5...

    Hello,
    My company just upgraded from In Design 3 to In Design CS5 and I have tried to load some fonts from the previous version. I keep getting blocked. I drag and drop the fonts and I get this error message:
    ERROR MOVING FILE OR FOLDER
    CANNOT MOVE (SPECIFIC TEXT) ACCESS IS DENIED.
    MAKE SURE THE DISK IS NOT FULL OR WRITE-PROTECTED
    AND THAT THE FILE IS NOT CURRENTLY IN USE.
    My co-worker has done the same thing and has had no problem. I've sent in a help desk ticket, but that was a while ago so I thought I'd give you a try.
    Thanks in advance
    CS InDesign 5.5
    Microsoft Windows XP
    Professional x64 Edition
    Version 2003
    Service Pack 2
    Intel(R) core(TM)2 Extreme
    CPU Q6850 @ 3.00GHz
    2.99 GHz. 8.00 GB of RAM

    This is not an InDesign issue, it’s a system issue and you should take very serious note that XP64 is completely unsupported.
    Bob

  • Is it possible to load or import 1 journal from file?

    Hi to all,
    We are searching how to load or import from and excel file some journals into the journal table of SAP BPC. As we have seen it is possible to load all the table but not only to add one journal to the table.
    Anybody knows if it is possible to load 1 journal from file into SAP BPC and add it to the table of journals?
    in a standard way or using logic??
    Thanks a lot!!!!

    I don't think that there is a method available to ONLY add 1 Journal record, since the sequence of Journals is an Autogenerated key.  The best way would be to simply add the Journal, so that the appropriate values are logged and tracked accordingly.  The table may be loaded, since the "whole" table has a defined key for the sequence of Journal entered transactions.
    Hope this helps.

  • Regarding getting specific font data from file

    I am developing one application in java(swing) font converter. In which I have to upload .doc file .Then if that file contains marathi,english text then I want to change marathi font to unicode.My converter program is completed.Now problem is that how I get marathi font or any other non unicode font from file whcih I want to unicode?
    Thanks in advance.

    font is to unicode like apples is to oranges
    Unicode assigns a number to a character.
    A charset or encoding is what is used to represent the character as bytes.
    A font is used to draw the character to the screen.
    You are reading in bytes, and you want to assign unicode values to those bytes. You keep using the word 'font' when font really isn't related to converting it to unicode. What encoding are these docs in? UTF8? UTF16? ISCII?
    If this were chinese, you might have a BIG5 charset, but you could have any number of fonts to draw those characters to the screen. You are missing an important step in this conversion.

  • Can I dynamically load html from file, but do not stuck the UI

    I load my html from files.
    Use JEditorPane to setContentType("text/html"),
    use JEditorPane.read method to dynamically load html from file,
    the jeditorpane is add into a jdialog,
    when my application showing the dialog, the dialog was stuck,
    user can not click other UI component, I think it is not look dynamically
    So any other suggestion?
    You are appreciated.
    Thanks in advanced.

       yourDialog.setModal(false);

  • Problems with load DSO from file

    I am working with BI 7.0.
    I am loading data from file to DSO and my problem is that data is not active in my DSO, the data are loaded how New Data and I haven´t the data in query and DSO.
    The settings of my dso are:
    Type: standard
    SIDs Generation upon Activation: X
    Set Quality Status to 'OK' Automatically: X
    Activate Data Automatically: X
    I have created one transformation from datasource to DSO and one DTP that extract from datasource ( No PSA).
    When I execute the DTP there aren´t errors, the status is green and ok but the data is not active.
    If I try activate the data manually the job is launched but the data no active.
    Thanks.

    hai
    Isabel Bautista 
    u r saying the data is not active in dso and also u r loading the data from file directly( no psa).
               i think u know in B.I the data should be in psa then only u can load the data using DTP .so how can u load the data with out data in psa  .i thinks may be because of this u r data is not activating in dso
    if it helps
    assign some points ok

  • Must load packages from file 2x before compl insght works in code editor

    I am used to editing packages from file instead from database, which is good practice I assume.
    When I first load a package from file, completion insight does not work.
    For example i do not get table names or column names after typing select t.<list expected> from <list expected initially> tab1 t
    When I close the file/tab and reopen the file completion insight suddenly works.
    Could you please fix this so that I only have to open the file once.
    Edited by: user10216416 on Nov 2, 2010 3:33 AM

    What version of SQL Developer are you using?
    Sue

  • Loading resource module from private folder.

    Hi,
    I have client(AIR)-server(Java) application working with many locales. Every now and then someone finds a bug in translation and repairs it.  Whenever somebody updates translation (via other tool wchich also creates new xx_XXresourceModule.swf on the server) it's created new resource module. From this reason I want to have resourceModules located on server. Changing resource on server will spread this change on each client during client initialization. Client during starting checks "somehow" whether there is newer resource module on server side and if there is then it should download and loads it.
    The reason why I don't want to just call IResourceManager.loadResourceModule(serverURL+resourceModule.swf) every time client start is quicker  client start up. If there isn't newer localization it uses the one which was dowloaded and stored earlier during former start.
    The problem is that when I download resourceModule.swf I could store it only into File.documentsDirectory where I have WRITE rights. But later on I am not able to load resource module via IResourceManager.loadResourceModule(). It complains "Unable to load resource module from: file:///c:/documents and settings/user/MyDocuments/resourceModule.swf" Do I miss something or is it possible to call loadResourceModule() when the SWF file is located somewhere in myDocument folder?
    Any idea how to solve it?
    //pyso

    AIR had a security restriction that you can only load modules from the app directory (i.e. the same folder the application was installed to). However they added a loadBytes(...) function to allow a module to be loaded that had been downloaded. I don't know if this was added to the resource stuff however.
    You cannot blindly add modules to the app directory either (at least ones that weren't part of the initial install) as the AIR runtime tries to work out from the directory whether it needs to update itself, and adding files in there confuses it (so say Adobe).
    I actually think you might be stuffed unless you create a new version of your AIR application with the new resource bundle, and distribute it as an update.
    Gk.
    Gregor Kiddie
    Senior Developer
    INPS
    Tel:       01382 564343
    Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ
    Registered Number: 1788577
    Registered in the UK
    Visit our Internet Web site at www.inps.co.uk
    The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact [email protected]

Maybe you are looking for

  • My iMac no longer syncs with my iPad, but it thinks it is.

    I have playlists on my iMac that I want to sync to my iPad2.  The iMac lists the selected playlists on the 'On This iPad' tab but the playlists don't change in the iPad.  This is a new development.   Is there a setting that needs to be set to correct

  • XML MAPPING - swf not updating

    When I make a change to the xml file it is not picking up the change in my published swf file.  When I open the project in CX and refresh the mapping updates. So it is connected but when I click on "refresh" on the sxf it is not updating. I have xml

  • CallManager 5.1(2) minimum system requirements

    I need to know the minimum hard drive requirement for a 5.1(2) installation. Can someone point me to the right document? Thanks, -Shikamaru

  • Problem applying changes in CS4

    Hi everyone, I have a problem applying changes in any document. I just can apply changes if I do zoom in or zoom out. Can you help me please?

  • RTGS Payment in SAP

    Dear Expert, Can someone please help me in understanding the process flow of RTGS and how it can be mapped in sap in detail, if possible.... Thank you.