Printer Built-in fonts in java

Hello,
I'm using Imaje 2000 Series Printer, when opening a new microsoft word document I can see some built in fonts specific to that printer like Imaje Arial, Imaje Times New Roman B, etc... I found out when printing with one of these fonts, the printing process is very fast. what happens is that I can see those fonts with name Imaje in MS word with printer icon attached to them, but in java i cant see them, and to check all fonts in java i used the below code :
Font[] f = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
for (int i=0; i<f.length; i++) {
System.out.println(f.getFontName());
if i try to set the font to Imaje Arial, java will neglect that font and print on the default I guess. Is there a way to use the printer built in fonts from within my java application

well, i cant find the font in windows fonts
directory, but when I open MS wrod i can find the
font (for example: Imaje Arial) in the fonts list and
has an icon of printer which means its not a true
type font. and please note that this font Imaje Arial
did not appear in MS word before installing the
printer driver.Well, if it's not installed and you can't find the file, how do you expect Java to do it?

Similar Messages

  • Use Printer Built-in fonts

    Hello,
    I'm using Imaje 2000 Series Printer, when opening new microsoft word document I can see some built in fonts specific to that printer like Imaje Arial, Imaje Times New Roman B, etc... I found out when printing with one of these fonts, the printing process is very fast. Now I need to know how can I use one of these fonts in my JAVA code?

    well, the idea is that I can see those fonts with name Imaje in MS word with printer icon attached to them, but in java i cant see them, and to check all fonts in java i used the below code :
    Font[] f = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
    for (int i=0; i<f.length; i++) {
    System.out.println(f.getFontName());
    if i try to set the font to Imaje Arial, java will neglect that font and print on the default I guess.

  • 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 ?

  • Printing a PDF document using Java 1.4 Printing API

    Hi,
    When I tried to print a PDF document using JAVA 1.4 Printing API, I got the following exception.
    Exception in thread "main" sun.print.PrintJobFlavorException: invalid flavor
    at sun.print.Win32PrintJob.print(Win32PrintJob.java:290)
    at Printing.main(Printing.java:40)
    I am able to print the same PDF document using Acrobat reader.
    Is PDF format not supported in JAVA 1.4 printing API? or is something wrong in my code?
    here is the sample JAVA program that I was using
    import javax.print.*;
    import javax.print.attribute.*;
    import java.io.*;
    public class Printing {
    public static void main(String args[]) throws Exception {
    String filename = args[0];
    PrintRequestAttributeSet pras =
    new HashPrintRequestAttributeSet();
    DocFlavor flavor = DocFlavor.INPUT_STREAM.PDF;
    PrintService defaultService =
    PrintServiceLookup.lookupDefaultPrintService();
    DocPrintJob job = defaultService.createPrintJob();
    FileInputStream fis = new FileInputStream(filename);
    DocAttributeSet das = new HashDocAttributeSet();
    Doc doc = new SimpleDoc(fis, flavor, das);
    job.print(doc, pras);
    Thread.sleep(10000);
    System.exit(0);
    Thank you
    Sumana

    Here's a pure Java solution (that works!):
    http://www.mycgiserver.com/~zhouwu/pdf/readme.html
    The caveats are:
    - prints only to the default printer
    - requires a properties file located in the home directory
    my workaround for the last:
         * Print a PDF file to the default printer (might consume lots of memory!).
         * <p>
         * <b>Required:</b>
         * <ul>
         * <li>a file "acrobat.properties" needs to be in the working directory. The content is:
    <table align="center" bgcolor="#E0E0E0" border=1 cellpadding="10" cellspacing="0"><tr><td><pre style="margin-top:0; margin-bottom:0">
    #com.adobe.acrobat.Viewer Properties
    #Wed Oct 29 20:34:05 PST 2003
    com.adobe.acrobat.AcceptedLicAgreement=true
    com.adobe.acrobat.Fax_Fine_Mode=true
    com.adobe.acrobat.Find\:FindAll=false
    com.adobe.acrobat.Find\:FindBackwards=false
    com.adobe.acrobat.Find\:FindWholeWord=false
    com.adobe.acrobat.Find\:MatchCase=false
    com.adobe.acrobat.Open_Dialog_Directory=C\:\\temp\\
    com.adobe.acrobat.Open_Dialog_File=itext.pdf
    com.adobe.acrobat.Print_Method_Known=true
    com.adobe.acrobat.Shrink_To_Fit=false
    com.adobe.acrobat.SitePreferencesURL=file\://localhost/C\:/pdf/acrobat-site.properties
    com.adobe.acrobat.Use_Print_Server=false
    com.adobe.acrobat.util.fontDirectories=C\:\\Winnt\\Fonts
    com.adobe.acrobat.util.fontIgnoreExtensions=.fon;.pfm;.ini;.lst;.txt;.doc;.ttmap;.z;.enc;.dir;.afm;.f3b;.pfa;.spd;.ps;.bepf;.map;.alias;.scale;.all;.upr
    </pre></td></tr></table>
         * <li>The JAR files PDFPrinter.jar, acrobat.jar and MRJToolkitStubs.zip in the CLASSPATH.
         * </ul>
         * <p>
         * Note: the file "acrobat.properties" is expected to be in the user's home directory. As this is not always feasible,
         * the system property "user.home" is mapped to "user.dir" for the time of execution.
         * @param fileName Name of PDF file to print.
         * @throws Exception on error.
         * @see <a href="http://www.mycgiserver.com/~zhouwu/pdf/readme.html">PDF Server (Silent) Printing</a>
        public void printPDF(String fileName) throws Exception {
            String oldHome = System.getProperty("user.home");
            System.setProperty("user.home", System.getProperty("user.dir"));
            PDFPrinter vi = new PDFPrinter();
            vi.activate();
            vi.setDocumentInputStream(new FileInputStream(fileName));
            vi.printAll();
            System.setProperty("user.home", oldHome);
        }//printPDF()I just need the following additional files in my CLASSPATH: PDFPrinter.jar, acrobat.jar and MRJToolkitStubs.zip. Despite the note at the site above that "printing quality is not very good", i can't agree: the print quality is quite good. Not perfect, but acceptable for most uses.
    (Tested on Windows 2000 SP4, J2SE 1.4.2_03, hp laserjet 2300dn)

  • Forcing printing with a font installed on the Mac

    I need to be able to override the built-in font on a PostScript printer.
    I know this was an option on the LaserWriter 8 driver for Mac OS 9, but it appears to be missing under Mac OS X.
    The main reason for this need, is that the Arial font built into most PostScript devices differs from the Arial supplied with Mac OS X. In particular with regards to punctuation and accent characters.
    Any hints, tips, or pressure on Apple to re-introduce this feature would be appreciated.

    Symbolic fonts really need to be embedded, you can't rely on local display.

  • Fonts in Windows and Fonts in Java

    Hello,
    Say I have in my app:
    String string = "\\u09A1";
    I want to display this in my app. I can call:
    GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
    I can then iterate through these and find out which ones can display this unicode character using,
    font.canDisplayUpTo(string);
    My question is, are these the fonts that Java can display (from charsets.jar) or the ones installed in Windows?
    I would like to be able to get lists for both of these.
    Any ideas?
    Cheers,
    Jim

    Thank you. I did read that. I was not talking about drawing text in 'Hello World' alike applets/programs.
    I should give an example:
    I would like to print 'H' in Tahoma, 72, Bold (Windows format) at (100, 200).
    Font sizes:
    In Windows font size is 72 pixels.
    In Java this is equal to 96 points (72 px * 96 (scr resolution for Toolkit) / 72 (pixels per point).
    Real height in Windows and Java will be 64 px.
    That's fine. For some fonts this does not work.
    Positioning. See example above.
    According to the article you refer to in java we should use y-coordinate 200 + 72 (font size) = 272.
    In fact we have :
    Java text 14 pixels below than expected.
    Similar things happen to other parameters Weight, Styles, etc.
    I do use AttributedString and TextAttribute classes to render text
    Thanks in advance.
    Alex

  • Non printing of Hindi Fonts - HP 3515 e - all in one.

    Product Model:
    CZ279B
    Product Name:
    HP Deskjet Ink Advantage 3515 e-All-in-One Printer
    I ahve purchased subject printer and it is not giving prints for hindi fonts ? How to resolve same.
    I am using windows 8

    Hey,
    Make sure you are using the Hindi font drivers built into the Windows OS and not a 3rd party downloaded Hindi font package.  It is possible that the fonts you are using aren't compatible with the print driver you are using.  As well, it is possible that you need to download the drivers from the India support page for your printer.  I will provide a link below to this page.
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=al-108718-3&cc=in&dlc=en&lc=en...
    What software are you printing from that is not being able to print out Hindi fonts?
    Jason
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------
    I am not an HP employee.

  • Print a file txt in java

    Hi
    I want to print a file txt in java. I use this code, but the printer receive an empty page. Why???
    This is the code: (the fileLocation is right, I've checked this).
    private void printFileTextPlain(String fileLocation){
    // Attribute Set storage
    PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
    // We're looking for PostScript-capable printers
    DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
    // Return list of printers capable of printing PostScript
    PrintService printService[] =
    PrintServiceLookup.lookupPrintServices(flavor, pras);
    // Get the default printer
    PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService();
    // Display the print dialog with default printer selected
    // --->>> CON DEFAULT PRINTER PrintService service = ServiceUI.printDialog(null, 200, 200, printService, defaultService, flavor, pras);
    PrintService service = ServiceUI.printDialog(null, 200, 200, printService, null, flavor, pras);
    // If user selected "OK"...
    try{
    if (service != null) {
    // Create a print job
    DocPrintJob job = service.createPrintJob();
    InputStream is = new BufferedInputStream(new FileInputStream(fileLocation));
    //JarInputStream jis = new java.util.jar.JarInputStream(new FileInputStream(new File(fileLocation)));
    //jis.getNextEntry();
    // Create storage for attributes
    DocAttributeSet das = new HashDocAttributeSet();
    Doc doc = new SimpleDoc(is, flavor, das);
    // Print the job
    job.print(doc, pras);
    // Wait a few seconds for job to spool
    Thread.sleep(10000);
    is.close();
    catch (IOException e) {
    JOptionPane.showMessageDialog(null, "Errore nella generazione del file di stampa","Attenzione", JOptionPane.ERROR_MESSAGE);
    //log error
    log.error("printFile(): "+e.getMessage(),e);
    catch (PrintException pe) {
    JOptionPane.showMessageDialog(null, "Errore nella generazione del file di stampa","Attenzione", JOptionPane.ERROR_MESSAGE);
    //log error
    log.error("printFile(): "+pe.getMessage(),pe);
    catch (InterruptedException ie) {
    JOptionPane.showMessageDialog(null, "Errore nella generazione del file di stampa","Attenzione", JOptionPane.ERROR_MESSAGE);
    //log error
    log.error("printFile(): "+ie.getMessage(),ie);
    }

    There is no speciall handling needed for unicode chars. Problam seems that the viewer that you are using to view the file does not support unicode or the font it is using is not a unicode fond which support chinese chars.
    If you switch to a unicode supported viewer and chinese supported unicode font then you should ge the chars properly

  • Deprecation warning for getFontMetrics(java.awt.Font) in java.awt.Toolkit

    Hi all,
    When I use the following code
    JComponent c;
    FontMetrics metrics = getToolkit().getFontMetrics(c.getFont());
    I get this following warning during compilation:-
    warning: getFontMetrics(java.awt.Font) in java.awt.Toolkit has been deprecated
    JDK suggests to use getLineMetrics() of the Font class.
    But there's an issue with that: if I use getLineMetrics(), there is no API method that I can use to get the width of a string as opposed to FontMetrics which provides stringWidth(String str) method for that purpose. In fact all the methods in FontMetrics are not mapped into LineMetrics.
    Could anyone please help or provide me at least some pointers on how to tackle this issue so that I can get rid of the deprecated method along with the existing methods mapped to equivalent APIs? The bottomline is that I should be able to maintain the existing functinality of my application for those part of code that uses getToolkit().getFontMetrics().
    Thank you for your help in advance.
    -Sanjoy Das

    Use Graphics.getFontMetrics(font) instead.
    After creation your frame and calling frame.show();
    You can access it like that
    frame.show();
    frame.getGraphics().getFontMetrics(new Font("Arial",0,10));
    before showing graphics is null.
    Or just create a BufferedImage and ask it for graphics.
    BufferedImage img=new BufferedImage(...);
    img.getGraphics().getFontMetrics(font);
    regards
    Stas

  • How to print a text file using Java

    How can I print a text file using Java without converting the output to an image format. Is there anyway I can send the characters in the text file as it is for a print job? I did get a listing doing this ... but that converted the text to an image format before printing....
    THanks,.

    Hi I had to write a print api from scratch, and I did not convert the output to image. Go and read up on the following code. I know there is a Tutorial on Sun about the differant sections of the snippet.
    private void printReport()
         Frame tempFrame = new Frame(getName());
         PrintJob printerJob = Toolkit.getDefaultToolkit().getPrintJob(tempFrame, "Liesltext", null);
         Graphics g = printerJob.getGraphics();
                    //I wrote the method below for calculations
         printBasics(g);
         g.dispose();
         printerJob.end();
    }This alone wont print it you have to do all the calculations in the printBasics method. And as I said I wrote this from scratch and all I did was research first the tutorial and the white papers
    Ciao

  • Print button on my webdynpro JAVA page

    Hi Experts,
    Is there any way that I can include a print button on my webdynpro JAVA page. ON click of the Print button I have to print the entire Page. User is able to print the page by using the print option of Browser, but in that case if the page is having a vertical or horizontal scroll, print output will contain only the visible part.
    Thanks and Regards,
    Sarath Satheesan

    Hi Sarath,
    Printing Web Dynpro Java (WDJ) applications is one of the missing functionalities that everyone wants to have in their application. you can use third party open source reporting tool, JasperReports, to solve this issue
    Printing in Web Dynpro using JasperReports
    PART 1 - /people/jawed.ali/blog/2009/02/09/part-i-print-web-dynpro-java-applications-using-jasperreports
    PART 2 - /people/jawed.ali/blog/2009/02/09/part-i-print-web-dynpro-java-applications-using-jasperreports
    PART 3 - /people/jawed.ali/blog/2009/10/30/part-iii-print-web-dynpro-java-applications-using-jasperreports
    Hope this will fulfil you requiremnt.
    Thanks
    Arun

  • HP Laserjet 1536dnf MFP printer cancellation of fonts

    I have a technical question.  I developed my own word processing and printing programs starting with the original IBM and epson dot matrix printer and then the HP Laserjet printers.  Students a University of Pennsylvania and Princeton used my programs
    to write their Ph. D. theses.  Now there are plenty of programs do to this but I have  kept my current.  Everything was fine until the printer listed in the title.  My program loads fonts in the printer.  The font # are 7000,7001,7002,7003,7004. 
    I choose these numbers so as not to interfere with other fonts.  My program runs in DosBox and sends data to the printer by writing to the file TRASH789.PCL in the directory C:\SPOOL and the program printfile (downloaded from the internet) spools the
    file to the printer.  When my program begins it sends the esc sequence that selects the fonts.  Also I set the  line feed to be 1/2 a line feed.  (My programs works like a typewriter and subscripts and superscripts are just a 1/2 space
    up or down.)   On all other HP printers for say 20 years everything is fine but with the printer mentioned above my font selection and 1/2 line feed are canceled.  Various sequences of character will cause this to happen.  It is pretty
    random.  One sequence I have isolated is below.
                        a3  a3  a3
    The a's can be upper or lower case.  There can be other characters between then etc.  But if the first few lines that at printed contain these characters the fonts and 1/2 line spacing are canceled.  If you put a paragraph before the a3,a3,a3
    it will not happen.  It the a3's occur at the top of a new page it will happen. 
       I have tried various things to fix the error like repeatedly telling the printer to select my fonts, or loading an empty rasher of graphics a the top of the page but nothing works.   Fortunately for 95% of what I print it is not a
    problem.  I have work around solutions, making a PDF file using GHOSTPCL, or using another program that uses rasher graphics.  (I wrote this some years ago when I bought a DESKJET printer.  Now computers are so fast that the time delay with
    the rasher graphics program is hardly  noticeable. 
          I realize that the number of people with my problems can be counted on one hand so there is no great motivation for fixing this problem but given the other problems with this printer (I have seen mentioned on the web) it seems
    to me there may be a connection.  (I only bought this printer, scanner, fax, etc)  because I had a grant that was expiring and I wanted to spend the money.  My guess is that will all the functions of this printer, probably set up by different
    groups of people, the printer has glitches.  As someone who has spent years on my own programs I know it can take months to figure them out.  My only hope is that maybe this might help someone.
       Thanks for your attention.

    Hi treborpowers,
    According to your description, you developped a program which runs in DosBox. When this program running, it sends request to DosBox, then DosBox sends request to Windows to call  Microsoft font 7000,7001,7002,7003, 7004, then Windows responds
    this request, however, the program could not print the font in DosBox correctly. Right?
    Since it is difficult to narrow down the issue is cause by Windows, in order to resolve this issue effectively, please get help from the professional forum about the programming language.
    Thanks for your understanding!
    Regards,
    Lany Zhang

  • When I send an email in Thunderbird it looks fine, but when the recipient tries to print it, the font is unreadablly small. Is there a setting I need to fix?

    I have Thunderbird version 24.3.0 downloaded to my Windows 7 computer.
    When I send an email in Thunderbird it looks fine and when the recipient receives it, it looks fine on the screen, but when she tries to print it, the font is unreadably small. This happens on every email I send her, but not other people's emails she receives. It has happened on some of the emails I receive back from her that contain the information I sent her.
    Is there a setting I need to fix or something I can do on my end to address this so this doesn't happen. She is receiving email through AOL online. I believe she is viewing it through either IE or Chrome.

    I recently tried sending myself an email through Thunderbird to another email account to see if that was the case, but the email came in with a font so tiny that it was unreadable. I had chosen a font type and size (arial 10) and just coming into my outlook inbox was virtually unreadable.
    And referring to the person I work with, she doesn't have problems getting anyone else's emails, just ones I send from Thunderbird.

  • Fonts in java apps for win and linux

    Hi everyone.
    i need to build an application mult-plataform, to run in windows and linux...
    but i don�t know waht font i must use...the default font that java takes doesn�t exist in linux (dialog)...
    waht font should i use in my app??
    thanx

    For going multi-platform it is easiest to stick to the logical fonts: Fonts named "Serif", "SansSerif", "Monospaced", "Dialog", and "DialogInput".
    These fonts are guaranteed to exist on any platform, although their implementations may be different. If you use others then you'll have to figure out how to deal with cross platform issues.
    Jeff

  • Form Builder 6.0.5.35.3 and the print built-in

    Our users have an option to allow them to print screen (form) images.
    We use the print built in to help provide this functionality.
    However, for each print request, the user is prompted to confirm the printer details, and them a message box appears saying 'Print capture beginning. Don't move or occlude window until done.' followed by another message that says 'print capture complete'.
    Is there any way that the printer confirmation box could be disabled? And if the 'Print capture/complete' messages could be disabled then that would be great too!
    Many thanks,
    Mohan

    You can't get rid of the dialogs directly, but you can reduce it to just a printer selection dialog with none of the other ones. You do this by using the browser to print rather than Forms.
    Note this will only work using JInitiator 1.3 with Forms 6i or 9i
    The code you need is
    web.show_document('javascript:print()','_self');

Maybe you are looking for

  • How to close a topic and reply who give us the right answer ?

    Hi How can i close a solved topic ? Just marking the Answer with the checkboxes (with calification 10)   (But does expert who give the answer receives a message ?) or  doing a reply to expert's answer that give the solution ? Thanks

  • Safari 5.17 printing double sided

    Why doesn't Safari 5.17 accept my preferences for printing double sided? Older version of Safari  keeps my preferences but the newer versions default to single sided printing.

  • How to convert a dedicated running oracle server to a shared server

    i need help as to how to convert a dedicated running oracle server to a shared server.(step by step plz i am fairly a fresh person) there are presently 10 users but have to configure for 125 users accessing from 5 locations. also need how to implemen

  • Microphoto Freezes and Shuts Down During File trans

    I just bought my Creative Zen Microphoto a week ago and was pumped when I got. It worked fine for a couple of days, I didn't have a problem transfering the music through windows media player 0. everything worked fine and i was really happy with it. h

  • Urgent Correction

    Hi, Is it required that in urgent correction the maintenance cycle should be in a particular phase. Do we change phases as in case of the normal correction? Regards, Kriti Bhalla.