• Post Reply Bookmark Topic Watch Topic
  • New Topic

Type 1 Fonts Support  RSS feed

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!