True Type Fonts in Java

Hi all
I searched through the forum and found some threads with the same problem but never a solution attached so here is my question:
I'm currently trying to use a True Type Font in Java. I installed the font under windows and it works fine in e.g. Word, but when I try to use it in Java all I can see are "rectangles". I'm not sure if the problem lies in the font itself or if it is a problem of Java. The fonts are named "Fughetta" and "Toccata" and can be found here: http://www.efn.org/~bch/aboutfonts.html. He is a code snippet I'm using to test the font:
public void setFonts(Graphics g)
        if (f != null) {
            return;
        f = new Font("Fughetta", Font.TRUETYPE_FONT, 26);
        System.out.println(f);
    public void paintComponent(Graphics g)
        super.paintComponent(g);
        setFonts(g);
        String s1 = "1234567890��!\"�$%&/(()=?`";
        String s2 = "qwertzuiop�+asdfghjkl��#yxcvbnm,.-<";
        String s3 = "QWERTZUIOP�*ASDFGHJKL��'YXCVBNM;:_>";
        String s4 = "1��{[]\\}@�~�|";
        g.setFont(f);
        g.drawString(s1, 10, 30);
        g.drawString(s2, 10, 70);
        g.drawString(s3, 10, 110);
        g.drawString(s4, 10, 150);
    }All help is appreciated ;)
- marc

Hy, Thanks for your sollution, but now I can't use this kind of approach.
I need to show a Bar Code Font inside a JTable cell, so I created my CellRenderer, in which I tried to change the font to my "Code EAN13" True Type font.
public Component getTableCellRendererComponent(JTable table,
            Object value, boolean isSelected, boolean hasFocus, int row, int column)  {
             Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
             if (column == CollectInfoTableModel.CODBAREPRODUS_INDEX ) {
                     Font barCodeFont = new Font("Arial", Font.BOLD, 36);
                     c.setFont(barCodeFont);                 
}This doesn't work, it just prints some strange characters.
I tried your sollution, but when I make :
Graphics2D g2D= (Graphics)c.getGraphics();i keep getting g2D = null.
What can I do ?
Is there a way to obtai a valid Grapics object on which to draw the glyphVector on ?

Similar Messages

  • Displaying Windows True Type fonts using Java 1.1.x

    Can anyone shed some light on why I cant just use the name of the fon't I want to display? Here is the code I'm using:
    Font font1 = new Font(sFontName, iStyle, iSize);
    this.setFont(font1);
    sFontName is the name of the font, and it works with the font names that are garaunteed by Java (i.e. Dialog, DialogInput, Monospaced, Serif, SansSerif, or Symbol), but if I try to use a true type font name such as "Tahoma" it just loads the default font instead. Is there a different method required to load system dependant fonts?
    Any ideas would be greatly appreciated. Thanks.

    If your font is properly installed (i.e. in the fonts folder and you've performed a restart) then it should work. I have code in the splash screen for an open source project like this:
    subTitleLbl.setFont (new java.awt.Font ("Lucida Blackletter", 0, 18));Which works if the font is properly installed. Otherwise, it simply grabs the system font, as you indicated.
    I've done some searching, and haven't found a way to load a font into java. Java won't do it because it's not platform independent.
    Fortunately, this code works even if the font is not present--it just won't have the font you want.

  • How can i get & use java true type fonts in my applet

    Hi,
    I could get the System fonts in my Applet by making use of Toolkit.getFontList()
    I have used getGraphicsEnvironment to get fonts but my browser doesn't support it.I get ClassNotFoundException.
    How can I get & make use True Type Fonts in my Java Applet.
    Regards
    Siva

    To use getGraphicsEnvironment, you must convert your HTML with the HTMLConverter -- this will tell the browser not to use the native JVM to run your applet but to use a Java plugin to run the applet. If you cannot find HTMLConverter in your system, you may have to download it from Sun's web site.
    V.V.

  • How can get & use java true type fonts in my applets

    Hi
    I could get the System fonts in my Applet by making use of Toolkit.getFontList()
    I have used getGraphicsEnvironment to get fonts but my browser doesn't support it.I get ClassNotFoundException.
    How can I get & make use True Type Fonts in my Java Applet.
    any body knows reply immediate pls
    Siva

    similar problem:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=164516
    sorry, thats all i know.
    tobias

  • How to print true type font in smartform with ECC6

    hi,expert:
    I want to use true type font "Comic Sans MS.ttf".
    I upload this font file by SE73 named ZTT2I.
    In SE73.. select the Radio button "Font Families" And click on the "True type Font Installation" button. click the font attribute ITALIC。
    Our print device is LP01 and driver is CNSAPWIN
    when I create a new style in smartform using the font ZTT, in preview window the font still like other font.
    Our system is IDES ECC6, SAP_BASIS SAPKB70014
    Now when I create smartfrom in language EN adn logon with language EN,it can print correct style of that font.
    But if the smartform is base on language ZH or logon with language ZH, the output is not correct.
    why? How to solve it?
    how can I solve this problem?
    thaks a lot

    Hi,
    Is the problem that uploaded true type font ZTT is not used when language is ZH? Did you update the chinese version of the style associated with the smartform? There is a separate style for each language version. So you need to log on in Chinese language and update the style with new paragraph, character formats. Then you need to activate the style and smartform for ZH langauge also.
    Regards,
    Aidan

  • How to use true type font in smartform with ECC6

    hi,expert:
    I want to use true type font "Comic Sans MS.ttf".
    I upload this font file by SE73 named ZTT2I.
    In SE73.. select the Radio button "Font Families" And click on the "True type Font Installation" button. click the font attribute ITALIC。
    Our print device is LP01 and driver is CNSAPWIN
    when I create a new style in smartform using the font ZTT, in preview window the font still like other font.
    Our system is ECC6, SAP_BASIS 700 level0017 packeg SAPKB70017
    how can I solve this problem?
    thaks a lot

    the ABAP forum administrator take this question to netweaver forum.
    Now when I create smartfrom in language EN,it can output correct style of that font.
    But if the smartform is base on language ZH, the output is not correct.
    why? How to solve it?
    thanks a lot

  • Why Premiere Title don´t see my new True Type fonts?

    I´ve installed several new true type fonts but Premiere´s Title don´s see them. What can I do to fix it?
    Thanks.

    Ann,
    I think that I missed something in your commets. Please help me understand. On my workstation, I've got over 9K Fonts. These are in my C:\Fonts\PS_Fonts, \\TT_Fonts and \\OTF_Fonts folders. The only ones that show up in any program are the ones that are "installed" in my system. I cannot "test drive" any of the non-installed in any program, that I know of, except, of course, Extensis Suitcase.
    What am I missing? Maybe, I'm about to learn something really new and neat?
    Thanks,
    Hunt
    PS to the OP, do you have a list of the Fonts, that are not showing up? I'd be curious to see what they are. I've seen times that some of the Asian Fonts did not show, even when properly installed. There is a "patch" from MS for those, but cannot find the link. I believe that some Arabic Fonts also need a special "patch" from MS. Do any of yours fall into these catagories?

  • Windows True Type font fine in Font Book but not in some apps

    I got a Windows True Type font from a guy having some issues with it when printing website on Windows XP and I thought I'd try the font on Mac OS X 10.4.4.
    It imports fine into Font Book and previews fine. When I opened up TextEdit the font can be seen in the list of fonts, but when one selects it changes to the Monaco font instead of the "real" font seen in Font Book.
    In Word the font don't show up at all but in Photoshop it seems to work fine.
    The font is validated fine according to Font Book.
    How come it behaves like this?

    Thanks for your reply.
    "OCR-A BT" is the name of the font.
    The origin I don't know about. I just got it from a guy I barely know.
    I know there can be various problems with fonts. Just thought it was interesting that Font Book validated and showed it fine, but still it didn't seem to be all healthy since it doesn't work in all app.

  • Junk Characters are coming in the Print Preview of True Type Font

    Hi
    I am facing one issue. Here I have installed on one of the True type font of Gujarati (one of Regional language for India) language.When I see Print preview using LP01 Output device (which has SWIN Device Type) these true type font coming as Junk characters. But when I take print it is coming perfectly Ok. I want to know is there any setting required to maintain for Output device to see Print Preview in Gujarati also ?
    I feel that when System is generating output for Preview it is ignoring true type font..
    If there is any solution kindly let me know
    Regards
    Bhavin Shah

    Hi,
    Try creating the spool using the unicode device type SWINCF(see note #812821) and check the result.
    regards,
    Aidan

  • How to use a non-standard true type font that won't be changed by the native environment on others' computers when they open the document?

    We are using a non-standard true type font (Zurich Ex BT) when creating a .pdf document but when others view it, the font is changed on their computers.  How do we use this font and keep it from being changed when others look at it?

    This is actually good stuff and well written but I hesitate to advise people to use either the "oven trick" or really even the heat gun method as both are notriously short-lived even if they appear effective. Your far better bet is to send the board in to one of the vendors on the internet who are set up to do a proper reball. Even those fixes are good for maybe 12-18 mos. But again, you get a high grade for spelling it out.

  • True type fonts not showing in Motion 2.1.2

    Although I don't want to, my client is insisting I use the VAG Round type face in the video I'm making for them. It's a true type font.
    Although it shows in the drop down font menu, the face displays as Helvetica. The font file is located in Macintosh HD/Library/Fonts/VAG Round.ttf
    For now, I'm going to create .ai files with the copy but would prefer to type directly into Motion.....
    Any suggestions?
    thanks
    Marco

    Make sure the folder names and file names contain no special characters such as accents. This is a bug.

  • CNSONG,CNHEI and CNKAI true type fonts

    Hi Gurus,
    We are having problems displaying chinese chars on PO form converted to PDF. We need to install the CNSONG, CNHEI and CNKAI true type fonts but can't find any. Can somebody help me find the file we needed?
    Any help is greatly appreciated.
    Thanks,
    MM

    hi ,
    u can refer to the following link
    http://help.sap.com/saphelp_erp2004/helpdata/en/36/5b3438fd263402e10000009b38f8cf/frameset.htm
    hope it will help u !!!!!!!
    regards,
    prashanti

  • Can't print True Type fonts

    I have been unable to print certain true type fonts on OS X from my HP laser printer. I had no trouble printing from OS X on my past Powerbook, and then realized that the difference with my current machine and past machines was that this is the first Mac I had that didn't have OS 9 installed. On my past computers, I had installed Adobe Type Manager (ATM), but of course didn't have it on my current Powerbook.
    Is there an ATM for OS X? How can I get my true type fonts to print like they used to on my HP Laserjet?
    Thanks for the help,
    Bill Nealey

    I have been unable to print certain true type fonts
    on OS X from my HP laser printer.
    which ones? where were they stored?
    I had no trouble
    printing from OS X on my past Powerbook, and then
    realized that the difference with my current machine
    and past machines was that this is the first Mac I
    had that didn't have OS 9 installed.
    This should make no difference. You can place OS 9 TrueType fonts in the Library/Fonts folder instead of the System Folder/Fonts folder if you want.
    On my past
    computers, I had installed Adobe Type Manager (ATM),
    but of course didn't have it on my current Powerbook.
    Makes no difference unless you're running Classic.
    Is there an ATM for OS X?
    No. OS X uses PDF for both screen and print display. ATM is required only for Classic/OS 9.
    How can I get my true type
    fonts to print like they used to on my HP Laserjet?
    Put them in a font folder where the OS will see them. Possible font folders:
    1 Library/Fonts
    2 <user>/Library/Fonts
    3 System Folder/Fonts
    Thanks for the help,
    Bill Nealey

  • Not seeing True Type Font: eurofurence light in InDesign 2.0

    I am trying to do some graphic work in InDesign 2.0 and I cannot find the "eurofurence light" which is a True Type Font. 
    My computer is running Windows Vista.
    I have installed the fonts into Windows Fonts at C:\Windows\Fonts
    Microsoft Word has the font avalible in both upper and lower case.
    Photoshop CS2 has the font but it I cannot get it to type a lower case letter.
    How can I get InDesign 2.0 to allow me to use "eurofurence light" True Type Font?
    Thank you,
    John

    In reading other posts I see that there is more information about the font that I can give.
    Font Name: eurofurence light
    Version: 4.0 2000-03-28
    True Type Outlines
    I installed it via Control Panel/Appearance/Fonts.
    I have scrolled all the way to the bottom of the Indesign font list and slowly checked the whole list several times to see if it located in a special place on the list.
    Thank you,
    John

  • Replacement of true type fonts on Linux

    I have developed a report with Reports 6i on a Windows NT client
    using the font "Times New Roman". When I generate the report on
    a Linux (Suse 7.2) to a PDF-file then the font is replaced by
    the font "itc avant garde gothic" although I can select the
    font "Times New Roman" in the "Control Center" of KDE.
    Can someone tell me why Reports is replacing the font ?
    Thanks.

    Aren't the real questions:  What font are you attempting to send to the Zebra printer?  What true type fonts does your model Zebra printer support?
    You should look at Google with "True type Font Zebra"...you would find this reference to Zebra with SmartForms, which is indicative of how you should proceed, probably:
    [SmartForms, True Type Fonts and Zebra printers|http://www.zebra.com/id/zebra/na/en/documentlibrary/misc/sap_smart_forms_faqs.File.tmp/SAP_SmartFormsFAQ.pdf]

Maybe you are looking for

  • WAD generic template

    IN BI 7 I transport a generic template in QUALIT,  in SPRO==> Settings for Reporting and Analysis==>BEx Web==> Set Standard Web Templates I setted the ad hoc analysis with =ZANALYSIS_PARTTERN_XXXX which I created in DEV and transported in QUALIT then

  • How to update time zone setting in Aperture 2

    When you install Aperture 2 you specify a time zone. However, I can't figure out how to change Aperture's time zone setting. I used to live on EST, so most of my photos are in EST. But since then I've moved to HST (Hawaii Standard Time) and purchased

  • WEBI prompts and Filtering

    Hi all, I am new to BO and I am working in BO XI R3. I have to create a WEBI report which will have two prompts. 1.first prompt is based on AMOUNT column in my report eg: Amount(LOV): $55000  2.second prompt is not based on any column in the report o

  • Mighty Mouse Functionality in Bootcamp?

    Hi, I use a Macbook 2.16ghz with Vista in Bootcamp. When I use the side buttons on my wired mighty mouse in Windows Vista, it activates as some sort of back button or "click" for whatever prgram I'm using. Does anyone know how to change the functions

  • Bilder zusammenfügen

    Hallo, bisher habe ich zwar immer etwas bildbearbeitung mit PS betrieben, doch nun stellt sich ein Problem dar: ich bin wissenscahtlich tätig und wir generieren Bilder mit einem konfokalmikroskop, bei denen einmal der rot, der blau und der grün Kanal