Re: Ideas about PDFGraphics2D font handling for True Type to Type 1

2001-08-20 Thread Keiron Liddle

Randall,

Maybe we need to have something similar to this class in batik:
org.apache.batik.gvt.font.FontFamilyResolver

Going a bit further we could make it an option to be able to use any font
that java can load (ie. reading the font metrics).



On Sun, 19 Aug 2001 23:09:12 Randall Parker wrote:
 
 Here's the problem in a nutshell: Java's Font class knows about the True
 Type fonts that it loaded from jre\lib
 \fonts and it also seems to know about TrueType fonts that are in the
 operating system's directory of fonts (on
 my NT4 box they are in winnt\fonts). But those font names are not going
 match the Type 1 font names that
 FOP's FontInfo.java and FontSetup.java know about. It appears that
 FontSetup.java does provide a mechanism
 for mapping TT fonts to Type 1 PDF core fonts. What I'm arguing here is
 that more calls to
 FontInfo.addFontProperties need to be added to FontSetup in order to
 support mapping of more TT fonts to
 Type 1 fonts.
 
 Elsewhere I've been told that the TrueType fonts Courier New and Times
 New Roman are supposed to have the
 same font metrics as the Type 1 fonts Courier and Times Roman. This same
 person also claimed that Arial
 has the same font metrics as Helvetica. If this is really true (anyone
 know a good way to find out?) then it
 makes sense to me for FontInfo to map those TrueType fonts to their
 corresponding Type 1 metric
 equivalalents.
 
 So True Type fonts available in Java should be mapped to Type 1 fonts in
 PDF as follows:
Arial  -- Helvetica
   Times New Roman  --  Times-Roman
   Courier New--  Courier
  and when they have bold and italic they should be mapped appropriately
 as well.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Ideas about PDFGraphics2D font handling for True Type to Type 1

2001-08-20 Thread Randall Parker

On Mon, 20 Aug 2001 10:31:35 +0200 (CEST), Tore Engvig wrote:

I'm not sure that you always can assume that java fonts are the same as
your system fonts, and I don't think you should map Arial to Helvetica. If
I remember correctly, Helvetica is a nice font, but Arial looks more
like... ugly. 

I am not generating visible documents with Arial. I'm generating PDF. So what Arial 
looks like does not matter as long as it has the same font metrics as Helvetica.

Also Arial exists in dozens of different versions, that goes
for other fonts to.

But the problem is that I need a TrueType font that I can instantiate. I can't 
instantiate a font that doesn't exist. Then I can call 
PDFDocumentGraphics2D.setFont(Font) with it. 

Windows machines have TrueType fonts. They rarely have Type 1 fonts. I want to use 
these ubiquitous fonts since I can count on being able to instantiate them. 

I guess that the simplest solution to your problem is to create
fontmetrics for your java fonts (those found in jre/lib) and add those to
fop with the same name as their java name.

How does that help? I want to specify the 3 font families that are built into Acrobat 
Reader (Helvetica, Times Roman, Courier). But in order to do that one has to be able 
to call 
PDFDocumentGraphics2D (or PDFGraphics2D) with setFont calls to specify them. Well, 
those are Type 1 fonts. I don't believe that Java can load Type 1 fonts from 
jre\lib\fonts on Win32 and 
it probably can't load Type 1 fonts from jre/lib/fonts on Linux or Unix either. But it 
can load TT fonts from jre/lib/fonts. 

Some TT fonts have the same font metrics as those 3 Type 1 fonts. So, since I need a 
way to tell the PDF document generation classes to use fonts that match those Type 1 
font metrics 
the TrueType fonts that are roughly equivalent to them and which have the same font 
metrics seem like the ones to use. 

 You don't have to embed them
in your document (just don't use embed file in your userconfig.xml).

I am not creating a document using XSL FO. I'm calling the PDFDocumentGraphics2D. 

(I'm going to be using XSL FO eventually though I don't see that that affects the 
problem anyhow)

As for sansserif and sans-serif, I don't think it's controversial to add a
mapping for both sansserif and sans-serif in FontSetup



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]