Author Topic: Does Scribus ignore kerning pairs in .afm file?  (Read 1044 times)


  • Newbie
  • *
  • Posts: 6
  • Karma: 0
  • Scribus User
Does Scribus ignore kerning pairs in .afm file?
« on: June 05, 2014, 11:50:14 pm »
Hi, Everybody.

Few months back I asked here for an advice with kerning in Scribus. According to the advice I have installed the FontForge and edited the fonts I use: adjusted the padding on left and right side of characters and stored kerning pairs into font. Then I have generated a postScript font (.pfb) and a metrics file (.pfm) and tested the result in Scribus. It worked!

But that time, I only tested english (non-accented) characters.

Today I have added another kerning pairs, based on the ones already defined in March, just with accented variants of each character, as my current project requires them. Well, some of the added kerning pairs did work, and some did not. After some investigation, I came to conclusion, that the .pfm data format simply cannot store kerning pairs for characters with Unicode codepoint > 255 as there is just exactly one byte for a character in kerning tables in .pfm format. Here is a fragment of a kerning table in .pfm file, showing four kerning pairs: ró -25, ro -25, ré -26, re -26.

72 f3 e7 ff
72 6f e7 ff
72 e9 e6 ff
72 65 e6 ff

First byte is a first character Unicode code, of a kerning pair, second is a second character Unicode code and the following two bytes are the kerning value (signed int16).

While this works well with Scribus, it is simply technically impossible for the .pfm file to hold kerning for pairs like "rě" or "řo" because the Unicode codepoint for ě and ř is 0x011B and 0x0159 and at least two bytes would be necessary for storing each such a char, and this violates the structures available for kerning in .pfm file.

Well, I have tried to switch for metrics (and kerning) storage to .afm file. After generating it and visually inspecting the content, I could see ALL the kerning pairs stored there in a way that characters are named rather than numerically coded. This is a fragment of kerning table as it can be found in an .afm file:

KPX rcaron oacute -25
KPX rcaron o -25

Hoping that this will solve my needs, I have started Scribus v1.4.3 and opened the document with accented characters, but I just found out that the kerning table in .afm file is completely ignored by Scribus :-(

Moreover, the selector now is just roughly half-height, which is a bit odd, because with .pfm file it was normal - full height. The lines are spaced correctly, but the selector simply looks odd. See attachment.

Beside Type 1, I also tried generating every format which FontForge is capable to generate, but Scribus only did follow the kerning pairs from .pfm file.

So my question is: Does truly Scribus completely ignore kerning tables stored in the .afm file, or am I just missing some important point ?


  • Administrator
  • Full Member
  • *****
  • Posts: 218
  • Karma: 2
  • Scribus User
Re: Does Scribus ignore kerning pairs in .afm file?
« Reply #1 on: May 19, 2015, 04:21:53 pm »
Per avox on #scribus IRC:
we use freeetype to handle ps fontmetric files. Afm and pfm files are handled the same and given to freetype for inclusion