diff options
author | Henry Stiles <henry.stiles@artifex.com> | 2000-02-17 05:47:33 +0000 |
---|---|---|
committer | Henry Stiles <henry.stiles@artifex.com> | 2000-02-17 05:47:33 +0000 |
commit | 52c6a487db23342c57f523844983531c523cff00 (patch) | |
tree | ec7b10fde64150e747acdda59ab7b74b57c19f39 /pcl/pglabel.c | |
parent | 4706d60eb433af8c78f06207b731c55000eef854 (diff) |
Changes for language switching, auto sensing, better memory
management, and simpler build system. This code is ALPHA and is
expected to change a bit over the next few weeks.
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@1100 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pcl/pglabel.c')
-rw-r--r-- | pcl/pglabel.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/pcl/pglabel.c b/pcl/pglabel.c index e738ab522..f8d5b97ea 100644 --- a/pcl/pglabel.c +++ b/pcl/pglabel.c @@ -123,7 +123,7 @@ private int hpgl_recompute_font(P1(hpgl_state_t *pgls)); private int hpgl_ensure_font(hpgl_state_t *pgls) { - if ( pgls->g.font == 0 ) + if ( ( pgls->g.font == 0 ) || ( pgls->g.font->pfont == 0 ) ) hpgl_call(hpgl_recompute_font(pgls)); return 0; } @@ -1241,6 +1241,10 @@ hpgl_LB(hpgl_args_t *pargs, hpgl_state_t *pgls) carriage returns and linefeeds will leave "moveto's" in the path */ hpgl_call(hpgl_clear_current_path(pgls)); + /* also clean up stick fonts - they are likely to + become dangling references in the current font + scheme since they don't have a dictionary entry */ + hpgl_free_stick_fonts(pgls); return 0; } /* @@ -1268,6 +1272,23 @@ hpgl_LB(hpgl_args_t *pargs, hpgl_state_t *pgls) return e_NeedData; } + void +hpgl_free_stick_fonts(hpgl_state_t *pgls) +{ + pcl_font_selection_t *pfs = + &pgls->g.font_selection[pgls->g.font_selected]; + pl_font_t *font = &pgls->g.stick_font[pgls->g.font_selected] + [pfs->params.proportional_spacing]; + + /* no stick fonts - nothing to do */ + if ( font->pfont == 0 ) + return; + + gs_free_object(pgls->memory, font->pfont, "stick/arc font"); + font->pfont = 0; + return; +} + int hpgl_print_symbol_mode_char(hpgl_state_t *pgls) { @@ -1306,6 +1327,7 @@ pglabel_do_registration( END_HPGL_COMMANDS return 0; } + const pcl_init_t pglabel_init = { pglabel_do_registration, 0 }; |