PDFdev is a service provided by PDFzone.com | http://www.pdfzone.com
_____________________________________________________________
Here are the font widths (... most of them anyway). Included in my open
source project called PDFinclude.i built specifically for Progress-based
(www.progress.com) applications.
Ignore the syntax and just pull the info from font_width for the
proportional fonts.
PROCEDURE pdf_LoadBase14:
DEFINE INPUT PARAMETER pdfStream AS CHARACTER NO-UNDO.
/* ---- Beginning of Courier Fonts ---- */
/* ObjectSequence(pdfStream, 5, "Font"). */
/* Create Associated Object */
CREATE TT_pdf_font.
ASSIGN TT_pdf_font.font_name = "Courier"
TT_pdf_font.font_file = "PDFBASE14"
TT_pdf_font.font_afm = ""
TT_pdf_font.font_obj = 5
TT_pdf_font.font_tag = "/F1"
TT_pdf_font.obj_stream = pdfStream
TT_pdf_font.font_type = "FIXED"
TT_pdf_font.font_width = "600".
/* ObjectSequence(pdfStream, pdf_inc_ObjectSequence + 1, "Font"). */
/* Create Associated Object */
CREATE TT_pdf_font.
ASSIGN TT_pdf_font.font_name = "Courier-Oblique"
TT_pdf_font.font_file = "PDFBASE14"
TT_pdf_font.font_afm = ""
TT_pdf_font.font_obj = 6
TT_pdf_font.font_tag = "/F2"
TT_pdf_font.obj_stream = pdfStream
TT_pdf_font.font_type = "FIXED"
TT_pdf_font.font_width = "600".
/* ObjectSequence(pdfStream, pdf_inc_ObjectSequence + 1, "Font"). */
/* Create Associated Object */
CREATE TT_pdf_font.
ASSIGN TT_pdf_font.font_name = "Courier-Bold"
TT_pdf_font.font_file = "PDFBASE14"
TT_pdf_font.font_afm = ""
TT_pdf_font.font_obj = 7
TT_pdf_font.font_tag = "/F3"
TT_pdf_font.obj_stream = pdfStream
TT_pdf_font.font_type = "FIXED"
TT_pdf_font.font_width = "600".
/* ObjectSequence(pdfStream, pdf_inc_ObjectSequence + 1, "Font"). */
/* Create Associated Object */
CREATE TT_pdf_font.
ASSIGN TT_pdf_font.font_name = "Courier-BoldOblique"
TT_pdf_font.font_file = "PDFBASE14"
TT_pdf_font.font_afm = ""
TT_pdf_font.font_obj = 8
TT_pdf_font.font_tag = "/F4"
TT_pdf_font.obj_stream = pdfStream
TT_pdf_font.font_type = "FIXED"
TT_pdf_font.font_width = "600".
/* ---- End of Courier Fonts ---- */
/* ---- Beginning of Helvetica Fonts ---- */
/* ObjectSequence(pdfStream, pdf_inc_ObjectSequence + 1, "Font"). */
/* Create Associated Object */
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 "
+ "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".
/* ObjectSequence(pdfStream, pdf_inc_ObjectSequence + 1, "Font"). */
/* Create Associated Object */
CREATE TT_pdf_font.
ASSIGN TT_pdf_font.font_name = "Helvetica-Oblique"
TT_pdf_font.font_file = "PDFBASE14"
TT_pdf_font.font_afm = ""
TT_pdf_font.font_obj = 10
TT_pdf_font.font_tag = "/F6"
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 "
+ "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".
/* ObjectSequence(pdfStream, pdf_inc_ObjectSequence + 1, "Font"). */
/* Create Associated Object */
CREATE TT_pdf_font.
ASSIGN TT_pdf_font.font_name = "Helvetica-Bold"
TT_pdf_font.font_file = "PDFBASE14"
TT_pdf_font.font_afm = ""
TT_pdf_font.font_obj = 11
TT_pdf_font.font_tag = "/F7"
TT_pdf_font.obj_stream = pdfStream
TT_pdf_font.font_type = "VARIABLE"
TT_pdf_font.font_width = FILL("788 ", 31) + "278 333 474 556 556
889 "
+ "722 278 333 333 389 584 278 333 278 278
556 "
+ "556 556 556 556 556 556 556 556 556 333
333 "
+ "584 584 584 611 975 722 722 722 722 667
611 "
+ "778 722 278 556 722 611 833 722 778 667
778 "
+ "722 667 611 722 667 944 667 667 611 333
278 "
+ "333 584 556 278 556 611 556 611 556 333
611 "
+ "611 278 278 556 278 889 611 611 611 611
389 "
+ "556 333 611 556 778 556 556 500 389 280
389 "
+ "584 333 556 556 167 556 556 556 556 238
500 "
+ "556 333 333 611 611 556 556 556 278 556
350 "
+ "278 500 500 556 1000 1000 611 333 333 333
333 "
+ "333 333 333 333 333 333 333 333 333 1000
"
+ "1000 370 611 778 1000 365 889 278 278 611
"
+ "944 611".
/* ObjectSequence(pdfStream, pdf_inc_ObjectSequence + 1, "Font"). */
/* Create Associated Object */
CREATE TT_pdf_font.
ASSIGN TT_pdf_font.font_name = "Helvetica-BoldOblique"
TT_pdf_font.font_file = "PDFBASE14"
TT_pdf_font.font_afm = ""
TT_pdf_font.font_obj = 12
TT_pdf_font.font_tag = "/F8"
TT_pdf_font.obj_stream = pdfStream
TT_pdf_font.font_type = "VARIABLE"
TT_pdf_font.font_width = FILL("788 ", 31) + "278 333 474 556 556
889 "
+ "722 278 333 333 389 584 278 333 278 278
556 "
+ "556 556 556 556 556 556 556 556 556 333
333 "
+ "584 584 584 611 975 722 722 722 722 667
611 "
+ "778 722 278 556 722 611 833 722 778 667
778 "
+ "722 667 611 722 667 944 667 667 611 333
278 "
+ "333 584 556 278 556 611 556 611 556 333
611 "
+ "611 278 278 556 278 889 611 611 611 611
389 "
+ "556 333 611 556 778 556 556 500 389 280
389 "
+ "584 333 556 556 167 556 556 556 556 238
500 "
+ "556 333 333 611 611 556 556 556 278 556
350 "
+ "278 500 500 556 1000 1000 611 333 333 333
"
+ "333 333 333 333 333 333 333 333 333 333 "
+ "1000 1000 370 611 778 1000 365 889 278
278 "
+ "611 944 611".
/* ---- End of Helvetica Fonts ---- */
/* ---- Beginning of Times Roman Fonts ---- */
/* ObjectSequence(pdfStream, pdf_inc_ObjectSequence + 1, "Font"). */
/* Create Associated Object */
CREATE TT_pdf_font.
ASSIGN TT_pdf_font.font_name = "Times-Roman"
TT_pdf_font.font_file = "PDFBASE14"
TT_pdf_font.font_afm = ""
TT_pdf_font.font_obj = 13
TT_pdf_font.font_tag = "/F9"
TT_pdf_font.obj_stream = pdfStream
TT_pdf_font.font_type = "VARIABLE"
TT_pdf_font.font_width = FILL("788 ", 31) + "250 " + "333 " +
"408 "
+ "500 500 833 778 180 333 333 500 564 250 "
+ "333 250 278 500 500 500 500 500 500 500 "
+ "500 500 500 278 278 564 564 564 444 921 "
+ "722 667 667 722 611 556 722 722 333 389 "
+ "722 611 889 722 722 556 722 667 556 611 "
+ "722 722 944 722 722 611 333 278 333 469 "
+ "500 333 444 500 444 500 444 333 500 500 "
+ "278 278 500 278 778 500 500 500 500 333 "
+ "389 278 500 500 722 500 500 444 480 200 "
+ "480 541 778 500 578 333 500 444 1000 500
"
+ "500 333 1000 556 333 889 667 611 722 444
"
+ "333 333 444 444 350 500 1000 333 980 389
"
+ "333 722 486 444 722 250 333 500 500 500 "
+ "500 200 500 333 760 276 500 564 333 760 "
+ "500 400 549 300 300 333 576 453 250 333 "
+ "300 310 500 750 750 750 444 722 722 722 "
+ "722 722 722 889 667 611 611 611 611 333 "
+ "333 333 333 722 722 722 722 722 722 722 "
+ "564 722 722 722 722 722 722 556 500 444 "
+ "444 444 444 444 444 667 444 444 444 444 "
+ "444 278 278 278 278 500 500 500 500 500 "
+ "500 500 549 500 500 500 500 500 500 500 "
+ "500".
/* ObjectSequence(pdfStream, pdf_inc_ObjectSequence + 1, "Font"). */
/* Create Associated Object */
CREATE TT_pdf_font.
ASSIGN TT_pdf_font.font_name = "Times-Italic"
TT_pdf_font.font_file = "PDFBASE14"
TT_pdf_font.font_afm = ""
TT_pdf_font.font_obj = 14
TT_pdf_font.font_tag = "/F10"
TT_pdf_font.obj_stream = pdfStream
TT_pdf_font.font_type = "VARIABLE"
TT_pdf_font.font_width = FILL("788 ", 31) + "250 333 420 500 500
"
+ "833 778 333 333 333 500 675 250 333 250
278 "
+ "500 500 500 500 500 500 500 500 500 500
333 "
+ "333 675 675 675 500 920 611 611 667 722
611 "
+ "611 722 722 333 444 667 556 833 667 722
611 "
+ "500 559 722 611 833 611 556 556 389 278
389 "
+ "422 500 333 500 500 444 500 444 278 500
500 "
+ "278 278 444 278 722 500 500 500 500 389
389 "
+ "278 500 444 667 444 444 389 400 278 400
541 "
+ "389 500 500 167 500 500 500 500 214 556
500 "
+ "333 333 500 500 500 500 500 250 523 350
333 "
+ "556 556 500 889 1000 500 333 333 333 333
333 "
+ "333 333 333 333 333 333 333 333 889 889
276"
+ "556 722 944 310 667 278 278 500 667 500".
/* ObjectSequence(pdfStream, pdf_inc_ObjectSequence + 1, "Font"). */
/* Create Associated Object */
CREATE TT_pdf_font.
ASSIGN TT_pdf_font.font_name = "Times-Bold"
TT_pdf_font.font_file = "PDFBASE14"
TT_pdf_font.font_afm = ""
TT_pdf_font.font_obj = 15
TT_pdf_font.font_tag = "/F11"
TT_pdf_font.obj_stream = pdfStream
TT_pdf_font.font_type = "VARIABLE"
TT_pdf_font.font_width = FILL("788 ", 31) + "250 333 555 500 500 "
+ "1000 833 333 333 333 500 570 250 333 250
"
+ "278 500 500 500 500 500 500 500 500 500
500 "
+ "333 333 570 570 570 500 930 722 667 722
722 "
+ "667 611 778 778 389 500 778 667 944 722
778 "
+ "611 778 722 556 667 722 722 1000 722 722
667 "
+ "333 278 333 581 500 333 500 556 444 556
444 "
+ "333 500 556 278 333 556 278 833 556 500
556 "
+ "556 444 389 333 556 500 722 500 500 444
394 "
+ "220 394 520 333 500 500 167 500 500 500
500 "
+ "278 500 500 333 333 556 556 500 500 500
250 "
+ "540 350 333 500 500 500 1000 1000 500 333
333 "
+ "333 333 333 333 333 333 333 333 333 333
333 "
+ "1000 1000 300 667 778 1000 330 722 278
278 "
+ "500 722 556".
/* ObjectSequence(pdfStream, pdf_inc_ObjectSequence + 1, "Font"). */
/* Create Associated Object */
CREATE TT_pdf_font.
ASSIGN TT_pdf_font.font_name = "Times-BoldItalic"
TT_pdf_font.font_file = "PDFBASE14"
TT_pdf_font.font_afm = ""
TT_pdf_font.font_obj = 16
TT_pdf_font.font_tag = "/F12"
TT_pdf_font.obj_stream = pdfStream
TT_pdf_font.font_type = "VARIABLE"
TT_pdf_font.font_width = FILL("788 ", 31) + "250 389 555 500 500
833 "
+ "778 333 333 333 500 570 250 333 250 278
500 "
+ "500 500 500 500 500 500 500 500 500 333
333 "
+ "570 570 570 500 832 667 667 667 722 667
667 "
+ "722 778 389 500 667 611 889 722 722 611
722 "
+ "667 556 611 722 667 889 667 611 611 333
278 "
+ "333 570 500 333 500 500 444 500 444 333
500 "
+ "556 278 278 500 278 778 556 500 500 500
389 "
+ "278 556 444 667 500 444 389 348 220 348
570 "
+ "389 500 500 167 500 500 500 500 278 500
500 "
+ "333 333 556 556 500 500 500 250 500 350
333 "
+ "500 500 500 1000 1000 500 333 333 333 333
333 "
+ "333 333 333 333 333 333 333 333 1000 944
266 "
+ "611 722 944 300 722 278 278 500 722 500".
/* ---- End of Times Roman Fonts ---- */
pdf_inc_ObjectSequence = 16.
END. /* pdf_LoadBase14 */
Gordon Campbell
PRO-SYS Consultants Ltd.
(780) 993-0704
www.epro-sys.com
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Mark Storer
Sent: Monday, June 09, 2003 11:09 AM
To: '[EMAIL PROTECTED]'
Subject: [PDFdev] RE: (char widths)
PDFdev is a service provided by PDFzone.com | http://www.pdfzone.com
_____________________________________________________________
> The next stage is to apply some right hand justification
> to some of the columns of text and the only way I think
> I can achieve this is to have a matrix of all the
> character widths for the type 1 fonts, and from this
> calculate the appropriate starting position for the
> string. Could someone tell me where I can get hold of the
> character width tables?
The vast majority of fonts have their widths built into their PDF
descriptions. The only exceptions to this rule are the "base 14" fonts.
You're going from text to PDF, so you can't just extract the existing widths
(right?). You need to be able to read this (and several other things) from
the fonts themselves.
www.freetype.org
FreeType is an excellent font tool. While it's primary goal is to render
fonts, it is also quite capable of extracting all the font attributes you'll
need to provide for PDF.
On the other hand, if you're sticking to those base 14 fonts (makes life
easier in a number of areas), you can hard-code your font widths... and heck
if I can find them. I KNOW they're out there on the internet, but google
has failed me.
SOMEONE here must know. I recall that the widths are built into some project
whose source is available, but I coulnd't tell you which project.
--Mark Storer
Software Engineer
Cardiff Software
#include <disclaimer>
typdef std::disclaimer<Cardiff> Discard;
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfdev.html
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfdev.html