List Info

Thread: minor pcl6 bug




minor pcl6 bug
user name
2006-04-13 18:27:28
Hi -
 
I had a problem with Windows-Encoded OpenType fonts giving an error message: "could not extract font file name from file %s".
 
Specifically, there was a font called "vrinda.ttf" that was causing this message.
 
Problem was in pl/pllfont.c function get_windows_name_from_tt_file(). There was an assumption that the 4th entry in the name table was the one for the NameID. This is not always true, you should search all the entries for the one with ID 0x0004. Once I made this change all was well.
 
I am running Cygwin (with X11) under WinXP.
 
mrengert:vegas[659]% main/obj/pcl6
Usage: main/obj/pcl6 [option* file]+...
Options: -dNOPAUSE -E[#] -h -C -L<PCL|PCLXL> -n -K<maxK> -P<PCL5C|PCL5E|RTL> -Z...
&nbsp; &nbsp; &nbsp;   ; -sDEVICE=&lt;dev> -g<W&gt;x<H>; -r<X>;[x<Y>;] -d{First|Last}Page=&lt;#>
&nbsp; &nbsp;   ; &nbsp; -sOutputFile=<file> (-s<option>=<;string> | -d<option>[=&lt;value>])*
 &nbsp;   ; &nbsp;  -J<PJL commands&gt;Version: 1.41
Build date: Thu Apr 13 09:32:02 2006
Devices: x11 x11alpha x11mono x11cmyk ljet4 djet500 cljet5pr cljet5c
&nbsp;bitcmyk bitrgb bitrgbtags tr_rgb pcxmono pcxgray pcxcmyk pswrite pdfwrite
&nbsp;pxlmono pxlcolor bmpmono bmpsep8 pbmraw pgmraw ppmraw jpeg bmpamono
&nbsp;bmpa16m bbox nullpage
mrengert:vegas[660]%
mrengert:vegas[661]% diff -bw pl/pllfont.c pl/pllfont.c.orig
116d115
<&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   int rec;
118,122c117,120
  ; &nbsp; &nbsp; &nbsp; &nbsp;   ; for ( rec = 0; rec < pl_get_uint16( name_table + 2 ); rec++ ) {
<&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   /* find NameID entry in name table - the complete name */
<&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  if ( pl_get_uint16( name_recs + (12 * rec) + 6 ) == 0x0004 ) {
<&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;  unsigned short length = pl_get_uint16( name_recs + (12 * rec) + 8 );
<&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;  unsigned short offset = pl_get_uint16( name_recs + (12 * rec) + 10 );
---
&gt; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;  {
>&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   /* 4th entry in the name table - the complete name */
>&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  unsigned short length = pl_get_uint16( name_recs + (12 * 4) + 8 );
>&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  unsigned short offset = pl_get_uint16( name_recs + (12 * 4) + 10 );
130,131d127
<&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp;  break;
&lt; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  }
152a149
>
Also of note -- I was able to build under Cygwin with -lpthreads and X11 devices (no CYGWIN=TRUE), the only issue was that there is no libdl for the -ldl option. Once that was removed&nbsp;it built OK.
 
Very cool program by the way - I find it extremely helpful.
 

--
Mark D. Rengert

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )