summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/type1.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvipdfm-x/type1.c')
-rw-r--r--Build/source/texk/dvipdfm-x/type1.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/Build/source/texk/dvipdfm-x/type1.c b/Build/source/texk/dvipdfm-x/type1.c
index 008c97d4ee1..b74030c986f 100644
--- a/Build/source/texk/dvipdfm-x/type1.c
+++ b/Build/source/texk/dvipdfm-x/type1.c
@@ -324,28 +324,14 @@ add_metrics (pdf_font *font, cff_font *cffont, char **enc_vec, double *widths, i
pdf_release_obj(tmp_array);
return;
}
- /* PLEASE FIX THIS
- * It's wrong to use TFM width here... We should warn if TFM width
- * and actual glyph width are different.
- */
tfm_id = tfm_open(pdf_font_get_mapname(font), 0);
for (code = firstchar; code <= lastchar; code++) {
if (usedchars[code]) {
double width;
if (tfm_id < 0) /* tfm is not found */
width = scaling * widths[cff_glyph_lookup(cffont, enc_vec[code])];
- else {
- double diff;
+ else
width = 1000. * tfm_get_width(tfm_id, code);
- diff = width -
- scaling * widths[cff_glyph_lookup(cffont, enc_vec[code])];
- if (fabs(diff) > 1.) {
- WARN("Glyph width mismatch for TFM and font (%s)",
- pdf_font_get_mapname(font));
- WARN("TFM: %g vs. Type1 font: %g",
- width, widths[cff_glyph_lookup(cffont, enc_vec[code])]);
- }
- }
pdf_add_array(tmp_array,
pdf_new_number(ROUND(width, 0.1)));
} else {
@@ -370,7 +356,7 @@ add_metrics (pdf_font *font, cff_font *cffont, char **enc_vec, double *widths, i
static int
-write_fontfile (pdf_font *font, cff_font *cffont, pdf_obj *pdfcharset)
+write_fontfile (pdf_font *font, cff_font *cffont)
{
pdf_obj *descriptor;
pdf_obj *fontfile, *stream_dict;
@@ -481,10 +467,7 @@ write_fontfile (pdf_font *font, cff_font *cffont, pdf_obj *pdfcharset)
pdf_new_name("Subtype"), pdf_new_name("Type1C"));
pdf_add_stream (fontfile, (void *) stream_data_ptr, offset);
pdf_release_obj(fontfile);
- pdf_add_dict(descriptor,
- pdf_new_name("CharSet"),
- pdf_new_string(pdf_stream_dataptr(pdfcharset),
- pdf_stream_length(pdfcharset)));
+
RELEASE(stream_data_ptr);
return offset;
@@ -495,7 +478,6 @@ int
pdf_font_load_type1 (pdf_font *font)
{
pdf_obj *fontdict;
- pdf_obj *pdfcharset; /* Actually string object */
int encoding_id;
char *usedchars, *ident;
char *fontname, *uniqueTag;
@@ -598,7 +580,6 @@ pdf_font_load_type1 (pdf_font *font)
/* Create CFF encoding, charset, sort glyphs */
#define MAX_GLYPHS 1024
GIDMap = NEW(MAX_GLYPHS, card16);
- pdfcharset = pdf_new_stream(0);
{
int prev, duplicate;
int gid;
@@ -671,11 +652,7 @@ pdf_font_load_type1 (pdf_font *font)
if (verbose > 2) {
MESG("/%s", glyph);
}
- /* CharSet is actually string object. */
- {
- pdf_add_stream(pdfcharset, "/", 1);
- pdf_add_stream(pdfcharset, glyph, strlen(glyph));
- }
+
}
}
if (cffont->encoding->num_supps > 0) {
@@ -799,12 +776,10 @@ pdf_font_load_type1 (pdf_font *font)
add_metrics(font, cffont, enc_vec, widths, num_glyphs);
- offset = write_fontfile(font, cffont, pdfcharset);
+ offset = write_fontfile(font, cffont);
if (verbose > 1)
MESG("[%u glyphs][%ld bytes]", num_glyphs, offset);
- pdf_release_obj(pdfcharset);
-
cff_close(cffont);
/* Cleanup */