summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfmx/src/tt_aux.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvipdfmx/src/tt_aux.c')
-rw-r--r--Build/source/texk/dvipdfmx/src/tt_aux.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/Build/source/texk/dvipdfmx/src/tt_aux.c b/Build/source/texk/dvipdfmx/src/tt_aux.c
index ee7466d08ff..14dc36e01f4 100644
--- a/Build/source/texk/dvipdfmx/src/tt_aux.c
+++ b/Build/source/texk/dvipdfmx/src/tt_aux.c
@@ -1,4 +1,4 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/tt_aux.c,v 1.7 2004/09/11 14:50:29 hirata Exp $
+/* $Header: /home/cvsroot/dvipdfmx/src/tt_aux.c,v 1.9 2008/05/17 04:18:47 chofchof Exp $
This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
@@ -129,11 +129,11 @@ ULONG ttc_read_offset (sfnt *sfont, int ttc_idx)
#define ALLCAP (1 << 16) /* All-cap font */
#define SMALLCAP (1 << 17) /* Small-cap font */
#define FORCEBOLD (1 << 18) /* Force bold at small text sizes */
-pdf_obj *tt_get_fontdesc (sfnt *sfont, int *embed, int type)
+pdf_obj *tt_get_fontdesc (sfnt *sfont, int *embed, int stemv, int type)
{
pdf_obj *descriptor = NULL;
pdf_obj *bbox = NULL;
- int stemv = 0, flag = SYMBOLIC;
+ int flag = SYMBOLIC;
/* TrueType tables */
struct tt_head_table *head;
struct tt_os2__table *os2;
@@ -191,7 +191,8 @@ pdf_obj *tt_get_fontdesc (sfnt *sfont, int *embed, int type)
pdf_add_dict (descriptor,
pdf_new_name ("Descent"),
pdf_new_number (PDFUNIT(os2->sTypoDescender)));
- stemv = (os2->usWeightClass/65)*(os2->usWeightClass/65)+50; /* arbitrary */
+ if (stemv < 0) /* if not given by the option '-v' */
+ stemv = (os2->usWeightClass/65.)*(os2->usWeightClass/65.)+50;
pdf_add_dict (descriptor,
pdf_new_name ("StemV"),
pdf_new_number (stemv));
@@ -212,9 +213,11 @@ pdf_obj *tt_get_fontdesc (sfnt *sfont, int *embed, int type)
);
}
/* optional */
- pdf_add_dict (descriptor,
- pdf_new_name ("AvgWidth"),
- pdf_new_number (PDFUNIT(os2->xAvgCharWidth)));
+ if (os2->xAvgCharWidth != 0) {
+ pdf_add_dict (descriptor,
+ pdf_new_name ("AvgWidth"),
+ pdf_new_number (PDFUNIT(os2->xAvgCharWidth)));
+ }
/* BoundingBox (array) */
bbox = pdf_new_array ();