Menu

#52 pdf_inc.i has bad base14 font-width

V1.1
open
nobody
5
2003-02-28
2003-02-28
Adam Davies
No

The base14 Font "Helvetica" is missing the width of a
character. This means all lookups into the array are
out by one (after about "D" in the ASCII chars). This
causes calls to pdf_text_width to be quite a long way out.

This can be verified using ADOBE's downloadable AFM
files for the font at website:
ftp://ftp.adobe.com/pub/adobe/type/win/all/afmfiles/base17

To fix this issue, change the code within internal
procedure "pdf_LoadBase14" as shown below (old line
commented out):

CREATE TT_pdf_font.
ASSIGN TT_pdf_font.font_name = "Helvetica"
TT_pdf_font.font_file = "PDFBASE14"
TT_pdf_font.font_afm = ""
TT_pdf_font.font_obj = 9
TT_pdf_font.font_tag = "/F5"
TT_pdf_font.obj_stream = pdfStream
TT_pdf_font.font_type = "VARIABLE"
TT_pdf_font.font_width = FILL("788 ", 31)
+ "278 278 355 556 556 889 "
+ "667 222 333 333 389 584 278 333 278 278 556 "
+ "556 556 556 556 556 556 556 556 556 278 278 "

/* Old line:
* + "584 584 584 556 1015 667 667 722 667 611 778 "

* NEW LINE: */
+ "584 584 584 556 1015 667 667 722 722 667 611 778 "

+ "722 278 500 667 556 833 722 778 667 778 722 "
+ "667 611 722 667 944 667 667 611 278 278 278 "
+ "469 556 222 556 556 500 556 556 278 556 556 "
+ "222 222 500 222 833 556 556 556 556 333 500 "
+ "278 556 500 722 500 500 500 334 260 334 584 "
+ "333 556 556 167 556 556 556 556 191 333 556 "
+ "333 333 500 500 556 556 556 278 537 350 222 "
+ "333 333 556 1000 1000 611 333 333 333 333 333 "
+ "333 333 333 333 333 333 333 333 1000 1000 370 "
+ "556 778 1000 365 889 278 222 611 944 611".

Discussion


Log in to post a comment.