On Thu, 2005-12-08 at 10:29, Juliusz Chroboczek wrote:
> You will find what I believe is the most up-to-date version of
> fonttosfnt in the X.Org CVS tree.  There's also a version in XFree86,
> but I'm not sure it has been kept up to date.
I downloaded fonttosfnt from x.org's cvs repository.

I build my little test case (same one ff generated) using this
fonttosfnt. Neither fontforge nor ftview would read the result.

This turned out to be because the faces have different x_ppem and
y_ppem, while the original bdf fonts have the same x/y resolution.

I believe this problem occurs because the call to makeStrike in read.c
uses face->available_sizes[i].width when it should be using
face->available_sizes[i].x_ppem>>6.

So I suggest the following patch (I have no write access to the cvs tree
myself) -- there are several other uses of
face->available_sizes[i].width which may also need to be changed, but
with this patch I can now produce a font which loads.
*** read.c~	2005-12-16 14:04:44.000000000 -0800
--- read.c	2005-12-16 14:07:04.000000000 -0800
***************
*** 250,257 ****
          }
  
          strike = makeStrike(font, 
!                             face->available_sizes[i].width,
!                             face->available_sizes[i].height);
          if(strike == NULL) {
              fprintf(stderr, "Couldn't allocate strike.\n");
              return -1;
--- 250,257 ----
          }
  
          strike = makeStrike(font, 
!                             face->available_sizes[i].x_ppem>>6,
!                             face->available_sizes[i].y_ppem>>6);
          if(strike == NULL) {
              fprintf(stderr, "Couldn't allocate strike.\n");
              return -1;

Reply via email to