diff options
author | L Peter Deutsch <lpd@ghostscript.com> | 2000-03-29 22:10:31 +0000 |
---|---|---|
committer | L Peter Deutsch <lpd@ghostscript.com> | 2000-03-29 22:10:31 +0000 |
commit | e8cd9d9a0f496c0b345cf0725b50e6e98c510941 (patch) | |
tree | bfdff975947dfe9c817ea21245d309c011a5a9c0 | |
parent | 4c7500ca75fd2a89a9dec9cdfe500d76376a7537 (diff) | |
download | ghostpdl-e8cd9d9a0f496c0b345cf0725b50e6e98c510941.tar.gz |
Changes the procs structure of gs_type1_data to an in-line structure rather
than a pointer to a const structure. (Needed for moving CIDFontType 0
support into C.)
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@218 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r-- | gs/doc/News.htm | 2 | ||||
-rw-r--r-- | gs/src/gdevpsf1.c | 10 | ||||
-rw-r--r-- | gs/src/gdevpsf2.c | 4 | ||||
-rw-r--r-- | gs/src/gdevpsfx.c | 2 | ||||
-rw-r--r-- | gs/src/gstype1.c | 6 | ||||
-rw-r--r-- | gs/src/gstype2.c | 4 | ||||
-rw-r--r-- | gs/src/gxfont1.h | 4 | ||||
-rw-r--r-- | gs/src/gxtype1.c | 16 | ||||
-rw-r--r-- | gs/src/zfont1.c | 9 |
9 files changed, 30 insertions, 27 deletions
diff --git a/gs/doc/News.htm b/gs/doc/News.htm index 3cfd42f5e..25f492c83 100644 --- a/gs/doc/News.htm +++ b/gs/doc/News.htm @@ -107,6 +107,8 @@ calling gx_set_identity_transfer. - The get_outline procedure of a Type 42 or Type 11 (CIDFontType 0) font now returns 1 if the string was newly allocated and can be freed by the client. + - The procs member of gs_type1_data is now an in-line structure +rather than a pointer to a const structure. </pre> diff --git a/gs/src/gdevpsf1.c b/gs/src/gdevpsf1.c index 8c02e9cee..230b085aa 100644 --- a/gs/src/gdevpsf1.c +++ b/gs/src/gdevpsf1.c @@ -43,7 +43,7 @@ psf_type1_glyph_data(gs_font_base *pbfont, gs_glyph glyph, gs_font_type1 *const pfont = (gs_font_type1 *)pbfont; *ppfont = pfont; - return pfont->data.procs->glyph_data(pfont, glyph, pstr); + return pfont->data.procs.glyph_data(pfont, glyph, pstr); } int psf_get_type1_glyphs(psf_outline_glyphs_t *pglyphs, gs_font_type1 *pfont, @@ -240,13 +240,13 @@ write_Private(stream *s, gs_font_type1 *pfont, gs_const_string str; for (n = 0; - (*pdata->procs->subr_data)(pfont, n, false, &str) != + (*pdata->procs.subr_data)(pfont, n, false, &str) != gs_error_rangecheck; ) ++n; pprintd1(s, "/Subrs %d array\n", n); for (i = 0; i < n; ++i) - if ((*pdata->procs->subr_data)(pfont, i, false, &str) >= 0) { + if ((*pdata->procs.subr_data)(pfont, i, false, &str) >= 0) { char buf[50]; sprintf(buf, "dup %d %u -| ", i, str.size); @@ -274,14 +274,14 @@ write_Private(stream *s, gs_font_type1 *pfont, for (glyph = gs_no_glyph; (code = psf_enumerate_glyphs_next(&genum, &glyph)) != 1; ) - if (code == 0 && (*pdata->procs->glyph_data)(pfont, glyph, &gdata) >= 0) + if (code == 0 && (*pdata->procs.glyph_data)(pfont, glyph, &gdata) >= 0) ++num_chars; pprintd1(s, "2 index /CharStrings %d dict dup begin\n", num_chars); psf_enumerate_glyphs_reset(&genum); for (glyph = gs_no_glyph; (code = psf_enumerate_glyphs_next(&genum, &glyph)) != 1; ) - if (code == 0 && (*pdata->procs->glyph_data)(pfont, glyph, &gdata) >= 0) { + if (code == 0 && (*pdata->procs.glyph_data)(pfont, glyph, &gdata) >= 0) { uint gssize; const char *gstr = (*pfont->procs.callbacks.glyph_name)(glyph, &gssize); diff --git a/gs/src/gdevpsf2.c b/gs/src/gdevpsf2.c index 3dac08f08..9262b4bf1 100644 --- a/gs/src/gdevpsf2.c +++ b/gs/src/gdevpsf2.c @@ -818,7 +818,7 @@ cff_write_Subrs_offsets(cff_writer_t *pcw, uint *pcount, gs_font_type1 *pfont) gs_const_string str; for (j = 0, offset = 1; - (code = (*pfont->data.procs->subr_data)(pfont, j, false, &str)) != + (code = (*pfont->data.procs.subr_data)(pfont, j, false, &str)) != gs_error_rangecheck; ++j) { if (code >= 0 && str.size >= extra_lenIV) @@ -840,7 +840,7 @@ cff_write_Subrs(cff_writer_t *pcw, uint subrs_count, uint subrs_size, cff_put_Index_header(pcw, subrs_count, subrs_size); cff_write_Subrs_offsets(pcw, &ignore_count, pfont); for (j = 0; - (code = (*pfont->data.procs->subr_data)(pfont, j, false, &str)) != + (code = (*pfont->data.procs.subr_data)(pfont, j, false, &str)) != gs_error_rangecheck; ++j) { if (code >= 0) diff --git a/gs/src/gdevpsfx.c b/gs/src/gdevpsfx.c index 3c44925c7..747c79229 100644 --- a/gs/src/gdevpsfx.c +++ b/gs/src/gdevpsfx.c @@ -88,7 +88,7 @@ private int type1_callsubr(gs_type1_state *pcis, int index) { gs_font_type1 *pfont = pcis->pfont; - int code = pfont->data.procs->subr_data(pfont, index, false, + int code = pfont->data.procs.subr_data(pfont, index, false, &pcis->ipstack[pcis->ips_count].char_string); if (code < 0) diff --git a/gs/src/gstype1.c b/gs/src/gstype1.c index 79107004a..4f80379d2 100644 --- a/gs/src/gstype1.c +++ b/gs/src/gstype1.c @@ -188,7 +188,7 @@ gs_type1_interpret(gs_type1_state * pcis, const gs_const_string * str, return_error(gs_error_invalidfont); case c_callsubr: c = fixed2int_var(*csp) + pdata->subroutineNumberBias; - code = (*pdata->procs->subr_data) + code = (*pdata->procs.subr_data) (pfont, c, false, &ipsp[1].char_string); if (code < 0) return_error(code); @@ -534,7 +534,7 @@ rsbw: /* Give the caller the opportunity to intervene. */ ) return_error(gs_error_invalidfont); n = fixed2int_var(csp[-1]); - code = (*pdata->procs->push_values) + code = (*pdata->procs.push_values) (pcis->callback_data, csp - (n + 1), n); if (code < 0) return_error(code); @@ -558,7 +558,7 @@ rsbw: /* Give the caller the opportunity to intervene. */ inext; } ++csp; - code = (*pdata->procs->pop_value) + code = (*pdata->procs.pop_value) (pcis->callback_data, csp); if (code < 0) return_error(code); diff --git a/gs/src/gstype2.c b/gs/src/gstype2.c index 88a2afcc3..e8eefa260 100644 --- a/gs/src/gstype2.c +++ b/gs/src/gstype2.c @@ -224,7 +224,7 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_const_string * str, return_error(gs_error_invalidfont); case c_callsubr: c = fixed2int_var(*csp) + pdata->subroutineNumberBias; - code = (*pdata->procs->subr_data) + code = (*pdata->procs.subr_data) (pfont, c, false, &ipsp[1].char_string); subr:if (code < 0) return_error(code); @@ -513,7 +513,7 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_const_string * str, goto pushed; case c2_callgsubr: c = fixed2int_var(*csp) + pdata->gsubrNumberBias; - code = (*pdata->procs->subr_data) + code = (*pdata->procs.subr_data) (pfont, c, true, &ipsp[1].char_string); goto subr; case cx_escape: diff --git a/gs/src/gxfont1.h b/gs/src/gxfont1.h index cec346ef0..0d517a741 100644 --- a/gs/src/gxfont1.h +++ b/gs/src/gxfont1.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1997, 1998, 1999 Aladdin Enterprises. All rights reserved. +/* Copyright (C) 1994, 2000 Aladdin Enterprises. All rights reserved. This file is part of Aladdin Ghostscript. @@ -99,7 +99,7 @@ typedef struct gs_type1_data_procs_s { */ struct gs_type1_data_s { /*int PaintType; *//* in gs_font_common */ - const gs_type1_data_procs_t *procs; + gs_type1_data_procs_t procs; charstring_interpret_proc((*interpret)); void *proc_data; /* data for procs */ int lenIV; /* -1 means no encryption */ diff --git a/gs/src/gxtype1.c b/gs/src/gxtype1.c index 232027374..fa1ae50f3 100644 --- a/gs/src/gxtype1.c +++ b/gs/src/gxtype1.c @@ -371,7 +371,7 @@ gs_type1_seac(gs_type1_state * pcis, const fixed * cstack, fixed asb, pcis->save_adxy.y = cstack[1]; pcis->os_count = 0; /* clear */ /* Ask the caller to provide the base character's CharString. */ - code = (*pfont->data.procs->seac_data) + code = (*pfont->data.procs.seac_data) (pfont, fixed2int_var(cstack[2]), NULL, &bcstr); if (code != 0) return code; @@ -422,7 +422,7 @@ gs_type1_endchar(gs_type1_state * pcis) /* Remove any base character hints. */ reset_stem_hints(pcis); /* Ask the caller to provide the accent's CharString. */ - code = (*pfont->data.procs->seac_data)(pfont, achar, NULL, &astr); + code = (*pfont->data.procs.seac_data)(pfont, achar, NULL, &astr); if (code < 0) return code; /* Continue with the supplied string. */ @@ -505,7 +505,7 @@ gs_type1_glyph_info(gs_font *font, gs_glyph glyph, const gs_matrix *pmat, info->members = 0; if (default_members != members) { - if ((code = pdata->procs->glyph_data(pfont, glyph, &str)) < 0) + if ((code = pdata->procs.glyph_data(pfont, glyph, &str)) < 0) return code; /* non-existent glyph */ } @@ -569,7 +569,7 @@ gs_type1_glyph_info(gs_font *font, gs_glyph glyph, const gs_matrix *pmat, goto out; case c_callsubr: c = fixed2int_var(*csp); - code = pdata->procs->subr_data + code = pdata->procs.subr_data (pfont, c, false, &ipsp[1].char_string); if (code < 0) return_error(code); @@ -608,11 +608,11 @@ gs_type1_glyph_info(gs_font *font, gs_glyph glyph, const gs_matrix *pmat, gs_char bchar = fixed2int(csp[-1]); gs_char achar = fixed2int(csp[0]); int bcode = - pdata->procs->seac_data(pfont, bchar, - &pieces[0], NULL); + pdata->procs.seac_data(pfont, bchar, + &pieces[0], NULL); int acode = - pdata->procs->seac_data(pfont, achar, - &pieces[1], NULL); + pdata->procs.seac_data(pfont, achar, + &pieces[1], NULL); code = (bcode < 0 ? bcode : acode); } diff --git a/gs/src/zfont1.c b/gs/src/zfont1.c index 83f449536..c6cec2271 100644 --- a/gs/src/zfont1.c +++ b/gs/src/zfont1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995, 1996, 1997, 1998, 1999 Aladdin Enterprises. All rights reserved. +/* Copyright (C) 1991, 2000 Aladdin Enterprises. All rights reserved. This file is part of Aladdin Ghostscript. @@ -18,6 +18,7 @@ /*$Id$ */ /* Type 1 and Type 4 font creation operators */ +#include "memory_.h" #include "ghost.h" #include "oper.h" #include "gxfixed.h" @@ -190,7 +191,7 @@ charstring_font_init(gs_font_type1 *pfont, const charstring_font_refs_t *pfr, ref_assign(&pdata->u.type1.OtherSubrs, pfr->OtherSubrs); ref_assign(&pdata->u.type1.Subrs, pfr->Subrs); ref_assign(&pdata->u.type1.GlobalSubrs, pfr->GlobalSubrs); - pfont->data.procs = &z1_data_procs; + pfont->data.procs = z1_data_procs; pfont->data.proc_data = (char *)pdata; pfont->procs.font_info = z1_font_info; pfont->procs.same_font = z1_same_font; @@ -362,7 +363,7 @@ z1_same_font(const gs_font *font, const gs_font *ofont, int mask) const font_data *const podata = pfont_data(pofont1); if ((check & (FONT_SAME_OUTLINES | FONT_SAME_METRICS)) && - pofont1->data.procs == &z1_data_procs && + !memcmp(&pofont1->data.procs, &z1_data_procs, sizeof(z1_data_procs)) && obj_eq(&pdata->CharStrings, &podata->CharStrings) && /* * We use same_font_dict for convenience: we know that @@ -373,7 +374,7 @@ z1_same_font(const gs_font *font, const gs_font *ofont, int mask) same |= FONT_SAME_OUTLINES; if ((check & FONT_SAME_METRICS) && (same & FONT_SAME_OUTLINES) && - pofont1->data.procs == &z1_data_procs && + !memcmp(&pofont1->data.procs, &z1_data_procs, sizeof(z1_data_procs)) && /* Metrics may be affected by CDevProc, Metrics, Metrics2. */ same_font_dict(pdata, podata, "Metrics") && same_font_dict(pdata, podata, "Metrics2") && |