Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Type 1 Fonts Support

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Does anybody know how to use type 1 fonts in Java? I tried java.awt.Font, but when I try to create font using Font.createFont(), it doesn't have type 1 support, I tried createFont(Font.PLAIN, inputStream) and createFont(Font.TRUE_TYPE, inputstream), all I got is the message "bad font data"(I'm using .pfm for Type 1 font).
I think I did something wrong, how could Java support True Type but not Type 1? Please help me out.
Tiffany
 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know much about fonts, but I Googled around and found this thread:
http://archives.java.sun.com/cgi-bin/wa?A2=ind9804&L=java2d-interest&D=0&P=17690
And with a little more Googling around, I learned something today--that Type 1 has to do with PostScript fonts, and according to the above post, there is or was no support for that and that dude is working on it, so maybe you should give him a hand if you want it! Here's a PDF doc where it explains Type 1 fonts:
http://partners.adobe.com/asn/developer/pdfs/tn/T1_SPEC.PDF
 
Tiffany Sun
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply. I also did some research and found that I have to use True Type Fonts if I want to use java to process it. I can use FOP with type 1 fonts, but first have to create a matrics and change the userconfig.xml. So I'll ask my user to upload both type 1 font file and true type font file, an ugly solution but it'll work for now.
Tiffany
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, this is not entirely true.
Java 1.5.0 has TYPE 1 support according to the documentation, and you can use the createFont() method to load a font over an inputstream - however, I haven't yet gotten it to work.
FYI, I have a question on this topic in the Sun forum, here:
http://forum.java.sun.com/thread.jsp?forum=57&thread=518768
I'm hoping on getting an answer ..
[ May 03, 2004: Message edited by: Bj�rn B�rresen ]
 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic