diff options
author | L Peter Deutsch <lpd@ghostscript.com> | 2000-03-20 07:02:12 +0000 |
---|---|---|
committer | L Peter Deutsch <lpd@ghostscript.com> | 2000-03-20 07:02:12 +0000 |
commit | 9085342d6b2466770522156905d7acc316d6765d (patch) | |
tree | 0a1dad99eca1ae617ab6f4921d16495aae0248da /gs/src/gdevpdfw.c | |
parent | 101d8c7307aab2bafc1e30209907076b900508ad (diff) |
Moves font-writing support into a new module (gdevpsf*), changing the source
file names. Adds the ability to write CFF fonts, with either Type 1 or Type
2 CharStrings; unfortunately, Acrobat Reader appears not to accept CFF fonts
with Type 1 CharStrings. Adds the ability to convert Type 1 CharStrings to
Type 2, including optimizing sequences of Type 1 operators into a single
Type 2 operator. Implements writing CIDFontType 0 CFF fonts (CIDFonts) [NOT
TESTED]. Starts (just barely) to remove more unneeded information from
embedded TrueType fonts.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@170 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/gdevpdfw.c')
-rw-r--r-- | gs/src/gdevpdfw.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/gs/src/gdevpdfw.c b/gs/src/gdevpdfw.c index e76ec6347..b1ca247f1 100644 --- a/gs/src/gdevpdfw.c +++ b/gs/src/gdevpdfw.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1999 Aladdin Enterprises. All rights reserved. +/* Copyright (C) 1999, 2000 Aladdin Enterprises. All rights reserved. This file is part of Aladdin Ghostscript. @@ -28,6 +28,7 @@ #include "gxfont.h" #include "gdevpdfx.h" #include "gdevpdff.h" +#include "gdevpsf.h" #include "scommon.h" /* Get the ID of various kinds of resources, with type checking. */ @@ -100,8 +101,8 @@ pdf_embed_font_type1(gx_device_pdf *pdev, gs_font_type1 *font, * the stack. */ #define TYPE1_OPTIONS (WRITE_TYPE1_EEXEC | WRITE_TYPE1_EEXEC_MARK) - code = psdf_write_type1_font(&poss, font, TYPE1_OPTIONS, - subset_glyphs, subset_size, pfname, lengths); + code = psf_write_type1_font(&poss, font, TYPE1_OPTIONS, + subset_glyphs, subset_size, pfname, lengths); if (code < 0) return code; pdf_open_separate(pdev, FontFile_id); @@ -116,9 +117,9 @@ pdf_embed_font_type1(gx_device_pdf *pdev, gs_font_type1 *font, { int check_lengths[3]; - psdf_write_type1_font(writer.strm, font, TYPE1_OPTIONS, - subset_glyphs, subset_size, pfname, - check_lengths); + psf_write_type1_font(writer.strm, font, TYPE1_OPTIONS, + subset_glyphs, subset_size, pfname, + check_lengths); if (writer.strm == pdev->strm && (check_lengths[0] != lengths[0] || check_lengths[1] != lengths[1] || @@ -130,9 +131,9 @@ pdf_embed_font_type1(gx_device_pdf *pdev, gs_font_type1 *font, } } #else - psdf_write_type1_font(writer.strm, font, TYPE1_OPTIONS, - subset_glyphs, subset_size, pfname, - lengths /*ignored*/); + psf_write_type1_font(writer.strm, font, TYPE1_OPTIONS, + subset_glyphs, subset_size, pfname, + lengths /*ignored*/); #endif #undef TYPE1_OPTIONS psdf_end_binary(&writer); @@ -158,8 +159,8 @@ pdf_embed_font_type42(gx_device_pdf *pdev, gs_font_type42 *font, WRITE_TRUETYPE_NO_TRIMMED_TABLE : 0); swrite_position_only(&poss); - code = psdf_write_truetype_font(&poss, font, options, - subset_glyphs, subset_size, pfname); + code = psf_write_truetype_font(&poss, font, options, + subset_glyphs, subset_size, pfname); if (code < 0) return code; length = stell(&poss); @@ -170,8 +171,8 @@ pdf_embed_font_type42(gx_device_pdf *pdev, gs_font_type42 *font, code = psdf_begin_binary((gx_device_psdf *)pdev, &writer); if (code < 0) return code; - psdf_write_truetype_font(writer.strm, font, options, - subset_glyphs, subset_size, pfname); + psf_write_truetype_font(writer.strm, font, options, + subset_glyphs, subset_size, pfname); psdf_end_binary(&writer); pdf_end_fontfile(pdev, start, length_id); return 0; @@ -318,8 +319,8 @@ pdf_write_FontDescriptor(gx_device_pdf *pdev, if (pdf_has_subset_prefix(pfd->FontName.chars, pfd->FontName.size)) { gs_font *font = pfd->base_font; gs_glyph subset_glyphs[256]; - uint subset_size = psdf_subset_glyphs(subset_glyphs, font, - pfd->chars_used); + uint subset_size = psf_subset_glyphs(subset_glyphs, font, + pfd->chars_used); int i; pputs(s, "/CharSet("); @@ -474,8 +475,8 @@ pdf_write_embedded_font(gx_device_pdf *pdev, pdf_font_descriptor_t *pfd) if ((double)used / total > pdev->params.MaxSubsetPct / 100.0) do_subset = false; else { - subset_size = psdf_subset_glyphs(subset_glyphs, font, - pfd->chars_used); + subset_size = psf_subset_glyphs(subset_glyphs, font, + pfd->chars_used); glyph_subset = subset_glyphs; } } |