123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- #include "sys-defines.h"
- #include "extern.h"
- bool
- _pl_h_begin_page (S___(Plotter *_plotter))
- {
- int i;
-
-
-
- for (i = 0; i < HPGL2_MAX_NUM_PENS; i++)
- if (_plotter->hpgl_pen_defined[i] == 1)
- _plotter->hpgl_pen_defined[i] = 0;
-
- _plotter->hpgl_pen = 1;
-
- {
- bool undefined_pen_seen = false;
-
- if (_plotter->hpgl_can_assign_colors)
- for (i = 2; i < HPGL2_MAX_NUM_PENS; i++)
- {
- if (_plotter->hpgl_pen_defined[i] == 0)
-
- {
-
- _plotter->hpgl_free_pen = i;
- undefined_pen_seen = true;
- break;
- }
- }
- if (!undefined_pen_seen)
-
- _plotter->hpgl_can_assign_colors = false;
- }
-
-
- _plotter->hpgl_bad_pen = false;
- _plotter->hpgl_pendown = false;
- _plotter->hpgl_pen_width = 0.001;
- _plotter->hpgl_line_type = HPGL_L_SOLID;
- _plotter->hpgl_cap_style = HPGL_CAP_BUTT;
- _plotter->hpgl_join_style = HPGL_JOIN_MITER;
- _plotter->hpgl_miter_limit = 5.0;
- _plotter->hpgl_fill_type = HPGL_FILL_SOLID_BI;
- _plotter->hpgl_fill_option1 = 0.0;
- _plotter->hpgl_fill_option2 = 0.0;
- _plotter->hpgl_symbol_set = PCL_ROMAN_8;
- _plotter->hpgl_spacing = 0;
- _plotter->hpgl_posture = 0;
- _plotter->hpgl_stroke_weight = 0;
- _plotter->hpgl_pcl_typeface = PCL_STICK_TYPEFACE;
- _plotter->hpgl_charset_lower = HPGL_CHARSET_ASCII;
- _plotter->hpgl_charset_upper = HPGL_CHARSET_ASCII;
- _plotter->hpgl_rel_char_height = 0.0;
- _plotter->hpgl_rel_char_width = 0.0;
- _plotter->hpgl_rel_label_rise = 0.0;
- _plotter->hpgl_rel_label_run = 0.0;
- _plotter->hpgl_tan_char_slant = 0.0;
- _plotter->hpgl_position_is_unknown = true;
- _plotter->hpgl_pos.x = 0;
- _plotter->hpgl_pos.y = 0;
-
- _maybe_switch_to_hpgl (S___(_plotter));
-
- if (_plotter->hpgl_version == 2)
- {
- sprintf (_plotter->data->page->point, "BP;IN;");
- _update_buffer (_plotter->data->page);
-
- sprintf (_plotter->data->page->point, "PS%d;",
- IROUND(_plotter->hpgl_plot_length));
- _update_buffer (_plotter->data->page);
- }
- else
- {
- sprintf (_plotter->data->page->point, "IN;");
- _update_buffer (_plotter->data->page);
- }
-
-
- if (_plotter->hpgl_rotation != 0)
- {
- sprintf (_plotter->data->page->point, "RO%d;", _plotter->hpgl_rotation);
- _update_buffer (_plotter->data->page);
- }
-
-
- sprintf (_plotter->data->page->point, "IP%d,%d,%d,%d;",
- IROUND(_plotter->hpgl_p1.x), IROUND(_plotter->hpgl_p1.y),
- IROUND(_plotter->hpgl_p2.x), IROUND(_plotter->hpgl_p2.y));
- _update_buffer (_plotter->data->page);
-
-
- sprintf (_plotter->data->page->point, "SC%d,%d,%d,%d;",
- IROUND (_plotter->data->xmin), IROUND (_plotter->data->xmax),
- IROUND (_plotter->data->ymin), IROUND (_plotter->data->ymax));
- _update_buffer (_plotter->data->page);
-
- if (_plotter->hpgl_version == 2)
- {
-
- if (_plotter->hpgl_can_assign_colors)
- {
- sprintf (_plotter->data->page->point, "NP%d;", HPGL2_MAX_NUM_PENS);
- _update_buffer (_plotter->data->page);
- }
-
- sprintf (_plotter->data->page->point, "WU1;");
- _update_buffer (_plotter->data->page);
- }
-
-
- sprintf (_plotter->data->page->point, "SP1;");
- _update_buffer (_plotter->data->page);
-
-
- if (_plotter->hpgl_version == 2 && _plotter->hpgl_use_opaque_mode)
- {
- sprintf (_plotter->data->page->point, "TR0;");
- _update_buffer (_plotter->data->page);
- }
-
- _freeze_outbuf (_plotter->data->page);
- return true;
- }
- void
- _pl_h_maybe_switch_to_hpgl (S___(Plotter *_plotter))
- {
- }
- void
- _pl_q_maybe_switch_to_hpgl (S___(Plotter *_plotter))
- {
- if (_plotter->data->page_number > 1)
-
- {
- strcpy (_plotter->data->page->point, "\f");
- _update_buffer (_plotter->data->page);
- }
-
- strcpy (_plotter->data->page->point, "\033%0B\n");
- _update_buffer (_plotter->data->page);
- }
|