Re: [Fonts] Re: [ft] Creating an [OT]TF font from BDF font

2005-12-16 Thread Alan Coopersmith

George Williams wrote:

I downloaded fonttosfnt from x.org's cvs repository.

So I suggest the following patch (I have no write access to the cvs tree
myself) 


To get patches into code in X.Org's CVS, please file bug reports at:

   https://bugs.freedesktop.org/enter_bug.cgi?product=xorg

and then use the "Create Attachment" link in the resulting bug report to
attach the patch to it.

--
-Alan Coopersmith-   [EMAIL PROTECTED]
 Sun Microsystems, Inc. - X Window System Engineering
___
Fonts mailing list
Fonts@XFree86.Org
http://XFree86.Org/mailman/listinfo/fonts


[Fonts] Re: [ft] Creating an [OT]TF font from BDF font

2005-12-16 Thread George Williams
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 believe the entrySel field in the table directory of the output sfnt
is off by 1.


*** write.c~	2005-12-16 15:10:29.0 -0800
--- write.c	2005-12-16 15:10:29.0 -0800
***
*** 358,364 
  writeULONG(out, 0x1);   /* version */
  writeUSHORT(out, numTables); /* numTables */
  writeUSHORT(out, 16 * ti);  /* searchRange */
! writeUSHORT(out, i - 1);/* entrySelector */
  writeUSHORT(out, 16 * (numTables - ti)); /* rangeShift */
  
  /* see fixupDir */
--- 358,364 
  writeULONG(out, 0x1);   /* version */
  writeUSHORT(out, numTables); /* numTables */
  writeUSHORT(out, 16 * ti);  /* searchRange */
! writeUSHORT(out, i);/* entrySelector */
  writeUSHORT(out, 16 * (numTables - ti)); /* rangeShift */
  
  /* see fixupDir */


[Fonts] Re: [ft] Creating an [OT]TF font from BDF font

2005-12-16 Thread George Williams
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.0 -0800
--- read.c	2005-12-16 14:07:04.0 -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;