Bug 40724 - Kerning does not work for user-specified CID fonts
Summary: Kerning does not work for user-specified CID fonts
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: fonts (show other bugs)
Version: trunk
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks: 40464
  Show dependency tree
 
Reported: 2006-10-11 03:48 UTC by Bertrand Delacretaz
Modified: 2012-04-01 06:56 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bertrand Delacretaz 2006-10-11 03:48:35 UTC
Testing this in revision 462741, I have created a font file with only two glyphs
A and V, and set kerning between them.

The XML metrics file (excerpt below) shows that the indexes in <kerning> are
glyph indexes, but AFAICS the layout code expects unicode indexes. I'll change
that in the TTFFile font decoder class, to have unicode indexes in the <kerning>
section.

       <multibyte-extras>
                <cid-type>CIDFontType2</cid-type>
                <default-width>0</default-width>
                <bfranges>
                        <!-- mapping of glyph indexes to unicode -->
                        <bf gi="0" ue="0" us="0"/>
                        <bf gi="3" ue="65" us="65"/>
                        <bf gi="4" ue="86" us="86"/>
                        <bf gi="0" ue="65535" us="65535"/>
                </bfranges>
                <cid-widths start-index="0">
                        <wx w="684"/>
                        <wx w="1000"/>
                        <wx w="1000"/>
                        <wx w="684"/>
                        <wx w="684"/>
                </cid-widths>
        </multibyte-extras>
        <!-- glyph index 3 is A in my font, 4 is V -->
        <kerning kpx1="3">
                <pair kern="-279" kpx2="4"/>
        </kerning>
Comment 1 Bertrand Delacretaz 2006-10-12 01:20:58 UTC
As discussed on the mailing list, this change makes old metrics files incompatible. 

If implemented, it would be good to add a version number to the metrics file, to
detect the incompatibility in case metrics files generated with older FOP
versions are used.
Comment 2 Bertrand Delacretaz 2006-10-12 02:50:42 UTC
See bug #40739 for the metrics-version attribute used to detect older versions
of the metrics file.
Comment 3 Jeremias Maerki 2006-10-13 00:57:40 UTC
I now have an IOException saying: Unicode index not found for glyph 1778
for DejaVuSerif.ttf when running TTFReader.

DejaVu fonts, see: http://dejavu.sourceforge.net/wiki/index.php/Main_Page
Comment 4 Jeremias Maerki 2006-10-13 01:02:18 UTC
Forget it. I just saw you fixed it already. :-)
Comment 5 Bertrand Delacretaz 2007-04-09 02:20:04 UTC
Fixed, kerning works in the current trunk
Comment 6 Glenn Adams 2012-04-01 06:56:09 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed