You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Keiron Liddle <ke...@aftexsw.com> on 2002/09/02 10:52:19 UTC

Re: TTFReader bug

On Sat, 2002-08-31 at 15:35, Jessica P. Hekman wrote:
> I think it's still worth getting TTFReader to read these fonts without 
> having to convert them. Keiron, you said you had a solution; do you have a 
> patch? Do you need any help making one? (I keep offering to help and not 
> actually doing anything; I feel guilty.)

I have committed what I think is the fix (to HEAD) and also added some
logging.
If you could checkout the code and give it a go it would be great.

I also changed it so that it handles fonts without a unicode cmap
better. There is a bug for an error caused by this unsupported format.

Keiron.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: TTFReader bug

Posted by "Jessica P. Hekman" <jp...@arborius.net>.
On 3 Sep 2002, Keiron Liddle wrote:

> As far as I can tell the TRUETYPE or TYPE0 depends on if you put a
> parameter on the command line "-enc ansi".

You are quite right. My bad. Yes, everything now works: from my point of 
view, anyways, that bug is fixed. Thanks!

> The error handling in that code could be improved and an exception may
> be ignored.
>
> Something to do for someone who wants to contribute.

I'll intend to do that and probably never get around to it.

j

-- 
  "Users complain that they receive too much spam, while spammers protest
messages are legal." -InfoWorld
  "You do not have to do everything disagreeable that you have a right to
do." -Judith Martin (Miss Manners)





---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: TTFReader bug

Posted by Keiron Liddle <ke...@aftexsw.com>.
On Mon, 2002-09-02 at 17:58, Jessica P. Hekman wrote:
> Done. TTFReader now generates the XML file with no errors for two fonts
> which previously gave it trouble!
> 
> However, when I tried actually using the generated XML file for one of 
> those fonts, the font didn't show up in the PDF output. (The characters in 
> that font just weren't there.) I took at look at two XML files:
> 
> a) I took a "broken" font, ran it through FontTools (mentioned in this 
> thread earlier), and then ran the old version of TTFReader on that. This 
> is XML file a. This XML file works (the resulting PDF looks as I expect).
> 
> b) XML file b is the new version of TTFReader run on the original, broken 
> font. This XML file does not work (the characters in the embedded font in 
> the PDF are invisible.)
> 
> The beginning of file (a):
> 
> <font-metrics 
> type="TRUETYPE"><font-name>Conga,Normal</font-name><embed/><cap-height>704</cap-height><x-height>589</x-height><ascender>927</ascender><descender>-300</descender><bbox><left>-228</left><bottom>-211</bottom><right>1219</right><top>927</top></bbox><flags>33</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TRUETYPE</subtype><singlebyte-extras><encoding>WinAnsiEncoding</encoding><first-char>0</first-char><last-char>255</last-char><widths><char 
> idx="0" wdt="500"/><char idx="1" wdt="500"/> ...
> 
> The beginning of file (b):
> 
> <font-metrics 
> type="TYPE0"><font-name>Conga,Normal</font-name><embed/><cap-height>704</cap-height><x-height>589</x-height><ascender>927</ascender><descender>-300</descender><bbox><left>-228</left><bottom>-211</bottom><right>1219</right><top>927</top></bbox><flags>33</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf 
> gi="3" ue="32" us="32"/> ...
> 
> Looks like file (b) is not describing a TrueType font, which is clearly 
> wrong.

As far as I can tell the TRUETYPE or TYPE0 depends on if you put a
parameter on the command line "-enc ansi".

I have tried both with that font and they work (the space becomes a box
for the wrong encoding).
The error handling in that code could be improved and an exception may
be ignored.

Something to do for someone who wants to contribute.

Keiron.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: TTFReader bug

Posted by "Jessica P. Hekman" <jp...@arborius.net>.
On 2 Sep 2002, Keiron Liddle wrote:

> I have committed what I think is the fix (to HEAD) and also added some
> logging.
> If you could checkout the code and give it a go it would be great.

Done. TTFReader now generates the XML file with no errors for two fonts
which previously gave it trouble!

However, when I tried actually using the generated XML file for one of 
those fonts, the font didn't show up in the PDF output. (The characters in 
that font just weren't there.) I took at look at two XML files:

a) I took a "broken" font, ran it through FontTools (mentioned in this 
thread earlier), and then ran the old version of TTFReader on that. This 
is XML file a. This XML file works (the resulting PDF looks as I expect).

b) XML file b is the new version of TTFReader run on the original, broken 
font. This XML file does not work (the characters in the embedded font in 
the PDF are invisible.)

The beginning of file (a):

<font-metrics 
type="TRUETYPE"><font-name>Conga,Normal</font-name><embed/><cap-height>704</cap-height><x-height>589</x-height><ascender>927</ascender><descender>-300</descender><bbox><left>-228</left><bottom>-211</bottom><right>1219</right><top>927</top></bbox><flags>33</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TRUETYPE</subtype><singlebyte-extras><encoding>WinAnsiEncoding</encoding><first-char>0</first-char><last-char>255</last-char><widths><char 
idx="0" wdt="500"/><char idx="1" wdt="500"/> ...

The beginning of file (b):

<font-metrics 
type="TYPE0"><font-name>Conga,Normal</font-name><embed/><cap-height>704</cap-height><x-height>589</x-height><ascender>927</ascender><descender>-300</descender><bbox><left>-228</left><bottom>-211</bottom><right>1219</right><top>927</top></bbox><flags>33</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf 
gi="3" ue="32" us="32"/> ...

Looks like file (b) is not describing a TrueType font, which is clearly 
wrong.

j

-- 
  "Users complain that they receive too much spam, while spammers protest
messages are legal." -InfoWorld
  "You do not have to do everything disagreeable that you have a right to
do." -Judith Martin (Miss Manners)



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org