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 weffen zhang <we...@yahoo.com> on 2001/04/15 09:31:15 UTC

Re: Why cannot generate xml metrics file????? bug?

Hi,

Thanks for Rafal Maczewski!

It works!

Can you tell me why should in.readTTFUShort() instead
of in.readTTFShort()??
What is the defference between the 2 methods?


--- original email ---

Hi,

There is a small bug in the TTFFile.java that prevents
xml metrics file
generation for some fonts. The patch is included
below. I've checked that
this fixes the problem with mingliu.ttf file (I don't
have the mingliu.ttc
collection).

Hope this helps,

Rafal Maczewski


/* -- $Id: TTFFile.java,v 1.3 2001/03/22 18:16:10
fotis Exp $ --


*** src/org/apache/fop/fonts/TTFFile.java.1.3 Thu Mar
22 19:16:10 2001
--- src/org/apache/fop/fonts/TTFFile.java Fri Apr 13
10:04:52 2001
***************
*** 179,185 ****
              int startRangeOffset =
in.getCurrentPos();

              for (int i = 0; i < (cmap_segCountX2 /
2); i++) {
!                 cmap_rangeOffsets[i] =
in.readTTFShort();
              }

              int glyphIdArrayOffset =
in.getCurrentPos();
--- 179,185 ----
              int startRangeOffset =
in.getCurrentPos();

              for (int i = 0; i < (cmap_segCountX2 /
2); i++) {
!                 cmap_rangeOffsets[i] =
in.readTTFUShort();
              }

              int glyphIdArrayOffset =
in.getCurrentPos();


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

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


Re: Why cannot generate xml metrics file????? bug?

Posted by Rafal Maczewski <fo...@pa70.ziebice.sdi.tpnet.pl>.
Hello,

The difference is that readTTFUShort reads unsigned integers, and
readTTFShort reads signed integers. So if the first bit is set, the signed
version of the function will return negative value and the unsigned version
will return positive value above 32767. The difference is important for
large font files where the offsets exceed 32767 bytes.

Rafal


> Hi,
>
> Thanks for Rafal Maczewski!
>
> It works!
>
> Can you tell me why should in.readTTFUShort() instead
> of in.readTTFShort()??
> What is the defference between the 2 methods?
>
>
> --- original email ---
>
> Hi,
>
> There is a small bug in the TTFFile.java that prevents
> xml metrics file
> generation for some fonts. The patch is included
> below. I've checked that
> this fixes the problem with mingliu.ttf file (I don't
> have the mingliu.ttc
> collection).
>
> Hope this helps,
>
> Rafal Maczewski
>
>
> /* -- $Id: TTFFile.java,v 1.3 2001/03/22 18:16:10
> fotis Exp $ --
>
>
> *** src/org/apache/fop/fonts/TTFFile.java.1.3 Thu Mar
> 22 19:16:10 2001
> --- src/org/apache/fop/fonts/TTFFile.java Fri Apr 13
> 10:04:52 2001
> ***************
> *** 179,185 ****
>               int startRangeOffset =
> in.getCurrentPos();
>
>               for (int i = 0; i < (cmap_segCountX2 /
> 2); i++) {
> !                 cmap_rangeOffsets[i] =
> in.readTTFShort();
>               }
>
>               int glyphIdArrayOffset =
> in.getCurrentPos();
> --- 179,185 ----
>               int startRangeOffset =
> in.getCurrentPos();
>
>               for (int i = 0; i < (cmap_segCountX2 /
> 2); i++) {
> !                 cmap_rangeOffsets[i] =
> in.readTTFUShort();
>               }
>
>               int glyphIdArrayOffset =
> in.getCurrentPos();
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org


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