123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886 |
- #include "sys-defines.h"
- #include "extern.h"
- #include "g_control.h"
- #include "g_her_metr.h"
- #define SHEAR (2.0/7.0)
- #define SCRIPTSIZE (0.6)
- #define SUBSCRIPT_DX 0.0
- #define SUBSCRIPT_DY (-0.25)
- #define SUPERSCRIPT_DX 0.0
- #define SUPERSCRIPT_DY 0.4
- #define ACCENT_UP_SHIFT 7.0
- #define ACCENT_RIGHT_SHIFT 2.0
- #define SMALL_KANA_SIZE 0.725
- #define OCCIDENTAL 0
- #define ORIENTAL 1
- #define BEGINNING_OF_KANA 4195
- static bool composite_char (unsigned char *composite, unsigned char *character, unsigned char *accent);
- static double label_width_hershey (const unsigned short *label);
- double
- _pl_g_alabel_hershey (R___(Plotter *_plotter) const unsigned char *s, int x_justify, int y_justify)
- {
- unsigned short *codestring;
- char x_justify_c, y_justify_c;
- double label_width, label_height;
- double x_offset, y_offset;
- double x_displacement;
- double postdx, dx, dy;
- double theta;
-
- codestring = _pl_g_controlify (R___(_plotter) s);
-
- label_width = HERSHEY_UNITS_TO_USER_UNITS(label_width_hershey (codestring));
- label_height = HERSHEY_UNITS_TO_USER_UNITS(HERSHEY_HEIGHT);
-
- x_justify_c = (char)x_justify;
- y_justify_c = (char)y_justify;
- switch (x_justify_c)
- {
- case 'l':
- default:
- x_offset = 0.0;
- x_displacement = 1.0;
- break;
- case 'c':
- x_offset = -0.5;
- x_displacement = 0.0;
- break;
- case 'r':
- x_offset = -1.0;
- x_displacement = -1.0;
- break;
- }
- switch (y_justify_c)
- {
- case 'b':
- y_offset = (double)HERSHEY_DESCENT / (double)HERSHEY_HEIGHT;
- break;
- case 'x':
- default:
- y_offset = 0.0;
- break;
- case 'c':
- y_offset = 0.5 * ((double)HERSHEY_DESCENT - (double)HERSHEY_ASCENT)
- / (double)HERSHEY_HEIGHT;
- break;
- case 'C':
- y_offset = - (double)HERSHEY_CAPHEIGHT / (double)HERSHEY_HEIGHT;
- break;
- case 't':
- y_offset = - (double)HERSHEY_ASCENT / (double)HERSHEY_HEIGHT;
- break;
- }
-
- {
- char *old_line_mode, *old_cap_mode, *old_join_mode;
- int old_fill_type;
- double oldposx, oldposy;
- bool old_dash_array_in_effect;
- old_line_mode = (char *)_pl_xmalloc (strlen (_plotter->drawstate->line_mode) + 1);
- old_cap_mode = (char *)_pl_xmalloc (strlen (_plotter->drawstate->cap_mode) + 1);
- old_join_mode = (char *)_pl_xmalloc (strlen (_plotter->drawstate->join_mode) + 1);
- oldposx = _plotter->drawstate->pos.x;
- oldposy = _plotter->drawstate->pos.y;
- strcpy (old_line_mode, _plotter->drawstate->line_mode);
- strcpy (old_cap_mode, _plotter->drawstate->cap_mode);
- strcpy (old_join_mode, _plotter->drawstate->join_mode);
- old_fill_type = _plotter->drawstate->fill_type;
- old_dash_array_in_effect = _plotter->drawstate->dash_array_in_effect;
-
-
- _API_linemod (R___(_plotter) "solid");
- _API_capmod (R___(_plotter) "round");
- _API_joinmod (R___(_plotter) "round");
- _API_filltype (R___(_plotter) 0);
-
-
- {
- double theta, deltax, deltay, dx_just, dy_just;
- theta = M_PI * _plotter->drawstate->text_rotation / 180.0;
-
- deltax = x_offset * label_width;
- deltay = y_offset * label_height;
- dx_just = cos(theta) * deltax - sin(theta) * deltay;
- dy_just = sin(theta) * deltax + cos(theta) * deltay;
-
- _API_fmoverel (R___(_plotter) dx_just, dy_just);
- }
-
-
- _pl_g_draw_hershey_string (R___(_plotter) codestring);
-
-
- _API_linemod (R___(_plotter) old_line_mode);
- _API_capmod (R___(_plotter) old_cap_mode);
- _API_joinmod (R___(_plotter) old_join_mode);
- _API_filltype (R___(_plotter) old_fill_type);
- _plotter->drawstate->dash_array_in_effect = old_dash_array_in_effect;
-
- free (old_line_mode);
- free (old_cap_mode);
- free (old_join_mode);
-
- _API_fmove (R___(_plotter) oldposx, oldposy);
- }
-
- postdx = x_displacement * label_width;
- theta = M_PI * _plotter->drawstate->text_rotation / 180.0;
- dx = cos (theta) * postdx;
- dy = sin (theta) * postdx;
- _API_fmoverel (R___(_plotter) dx, dy);
- free (codestring);
- return label_width;
- }
- double
- _pl_g_flabelwidth_hershey (R___(Plotter *_plotter) const unsigned char *s)
- {
- double label_width;
- unsigned short *codestring;
-
-
- codestring = _pl_g_controlify (R___(_plotter) s);
- label_width = HERSHEY_UNITS_TO_USER_UNITS(label_width_hershey (codestring));
- free (codestring);
-
- return label_width;
- }
- void
- _pl_g_draw_hershey_stroke (R___(Plotter *_plotter) bool pendown, double deltax, double deltay)
- {
- double theta = M_PI * _plotter->drawstate->text_rotation / 180.0;
- double dx, dy;
- deltax = HERSHEY_UNITS_TO_USER_UNITS (deltax);
- deltay = HERSHEY_UNITS_TO_USER_UNITS (deltay);
- dx = cos(theta) * deltax - sin(theta) * deltay;
- dy = sin(theta) * deltax + cos(theta) * deltay;
- if (pendown)
- _API_fcontrel (R___(_plotter) dx, dy);
- else
- _API_fmoverel (R___(_plotter) dx, dy);
- }
- static double
- label_width_hershey (const unsigned short *label)
- {
- const unsigned short *ptr = label;
- unsigned short c;
- double charsize = 1.0;
- double saved_charsize = 1.0;
- double width = 0.0;
- double saved_width = 0.0;
-
-
- while ((c = (*ptr)) != (unsigned short)'\0')
- {
- int glyphnum;
- const unsigned char *glyph;
-
- if (c & RAW_HERSHEY_GLYPH)
-
- {
- glyphnum = c & GLYPH_SPEC;
- glyph = (const unsigned char *)(_pl_g_occidental_hershey_glyphs[glyphnum]);
-
- if (*glyph != '\0')
-
- width += charsize * ((int)glyph[1] - (int)glyph[0]);
- }
- else if (c & RAW_ORIENTAL_HERSHEY_GLYPH)
-
- {
- glyphnum = c & GLYPH_SPEC;
- glyph = (const unsigned char *)_pl_g_oriental_hershey_glyphs[glyphnum];
-
- if (*glyph != '\0')
-
- width += charsize * ((int)glyph[1] - (int)glyph[0]);
- }
- else if (c & CONTROL_CODE)
- {
- switch (c & ~CONTROL_CODE)
- {
- case C_BEGIN_SUBSCRIPT:
- case C_BEGIN_SUPERSCRIPT :
- charsize *= SCRIPTSIZE;
- break;
-
- case C_END_SUBSCRIPT:
- case C_END_SUPERSCRIPT:
- charsize /= SCRIPTSIZE;
- break;
-
- case C_PUSH_LOCATION:
- saved_width = width;
- saved_charsize = charsize;
- break;
-
- case C_POP_LOCATION:
- width = saved_width;
- charsize = saved_charsize;
- break;
-
- case C_RIGHT_ONE_EM:
- width += charsize * HERSHEY_EM;
- break;
-
- case C_RIGHT_HALF_EM:
- width += charsize * HERSHEY_EM / 2.0;
- break;
-
- case C_RIGHT_QUARTER_EM:
- width += charsize * HERSHEY_EM / 4.0;
- break;
-
- case C_RIGHT_SIXTH_EM:
- width += charsize * HERSHEY_EM / 6.0;
- break;
-
- case C_RIGHT_EIGHTH_EM:
- width += charsize * HERSHEY_EM / 8.0;
- break;
-
- case C_RIGHT_TWELFTH_EM:
- width += charsize * HERSHEY_EM / 12.0;
- break;
-
- case C_LEFT_ONE_EM:
- width -= charsize * HERSHEY_EM;
- break;
-
- case C_LEFT_HALF_EM:
- width -= charsize * HERSHEY_EM / 2.0;
- break;
-
- case C_LEFT_QUARTER_EM:
- width -= charsize * HERSHEY_EM / 4.0;
- break;
-
- case C_LEFT_SIXTH_EM:
- width -= charsize * HERSHEY_EM / 6.0;
- break;
-
- case C_LEFT_EIGHTH_EM:
- width -= charsize * HERSHEY_EM / 8.0;
- break;
-
- case C_LEFT_TWELFTH_EM:
- width -= charsize * HERSHEY_EM / 12.0;
- break;
-
-
- default:
- break;
- }
- }
- else
- {
- int raw_fontnum;
-
-
- raw_fontnum = (c >> FONT_SHIFT) & ONE_BYTE;
-
- c &= ~FONT_SPEC;
- glyphnum = (_pl_g_hershey_font_info[raw_fontnum].chars)[c];
-
- if (glyphnum == ACC0 || glyphnum == ACC1 || glyphnum == ACC2)
- {
- unsigned char composite, character, accent;
-
- composite = (unsigned char)c;
- if (composite_char (&composite, &character, &accent))
- glyphnum = (_pl_g_hershey_font_info[raw_fontnum].chars)[character];
- else
- glyphnum = UNDE;
- }
-
- if (glyphnum & KS)
- glyphnum -= KS;
- glyph = (const unsigned char *)(_pl_g_occidental_hershey_glyphs[glyphnum]);
- if (*glyph != '\0')
-
- width += charsize * ((int)glyph[1] - (int)glyph[0]);
- }
-
- ptr++;
- }
- return width;
- }
- void
- _pl_g_draw_hershey_penup_stroke(R___(Plotter *_plotter) double dx, double dy, double charsize, bool oblique)
- {
- double shear;
- shear = oblique ? (SHEAR) : 0.0;
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false,
- charsize * (dx + shear * dy),
- charsize * dy);
- }
- void
- _pl_g_draw_hershey_glyph (R___(Plotter *_plotter) int glyphnum, double charsize, int type, bool oblique)
- {
- double xcurr, ycurr;
- double xfinal, yfinal;
- bool pendown = false;
- const unsigned char *glyph;
- double dx, dy;
- double shear;
-
- shear = oblique ? (SHEAR) : 0.0;
- switch (type)
- {
- case OCCIDENTAL:
- default:
- glyph = (const unsigned char *)(_pl_g_occidental_hershey_glyphs[glyphnum]);
- break;
- case ORIENTAL:
- glyph = (const unsigned char *)(_pl_g_oriental_hershey_glyphs[glyphnum]);
- break;
- }
- if (*glyph != '\0')
- {
- xcurr = charsize * (double)glyph[0];
- xfinal = charsize * (double)glyph[1];
- ycurr = yfinal = 0.0;
- glyph += 2;
- while (*glyph)
- {
- int xnewint;
-
- xnewint = (int)glyph[0];
-
- if (xnewint == (int)' ')
- pendown = false;
- else
- {
- double xnew, ynew;
- xnew = (double)charsize * xnewint;
- ynew = (double)charsize
- * ((int)'R'
- - ((int)glyph[1] + (double)HERSHEY_BASELINE));
- dx = xnew - xcurr;
- dy = ynew - ycurr;
- _pl_g_draw_hershey_stroke (R___(_plotter)
- pendown, dx + shear * dy, dy);
- xcurr = xnew, ycurr = ynew;
- pendown = true;
- }
-
- glyph +=2;
- }
-
-
- dx = xfinal - xcurr;
- dy = yfinal - ycurr;
- _pl_g_draw_hershey_stroke (R___(_plotter) false, dx + shear * dy, dy);
- }
- }
- void
- _pl_g_draw_hershey_string (R___(Plotter *_plotter) const unsigned short *string)
- {
- unsigned short c;
- const unsigned short *ptr = string;
- double charsize = 1.0;
- double saved_charsize = 1.0;
- double saved_position_x = _plotter->drawstate->pos.x;
- double saved_position_y = _plotter->drawstate->pos.y;
- double old_line_width;
- int line_width_type = 0;
-
- old_line_width = _plotter->drawstate->line_width;
- while ((c = (*ptr++)) != '\0')
- {
-
- if (c & RAW_HERSHEY_GLYPH)
- {
- if (line_width_type != 1)
- {
- _API_flinewidth (R___(_plotter)
- HERSHEY_UNITS_TO_USER_UNITS (HERSHEY_STROKE_WIDTH));
- line_width_type = 1;
- }
- _pl_g_draw_hershey_glyph (R___(_plotter)
- c & GLYPH_SPEC, charsize, OCCIDENTAL, false);
- }
- else if (c & RAW_ORIENTAL_HERSHEY_GLYPH)
- {
- if (line_width_type != 2)
- {
- _API_flinewidth (R___(_plotter)
- HERSHEY_UNITS_TO_USER_UNITS (HERSHEY_ORIENTAL_STROKE_WIDTH));
- line_width_type = 2;
- }
- _pl_g_draw_hershey_glyph (R___(_plotter)
- c & GLYPH_SPEC, charsize, ORIENTAL, false);
- }
- else if (c & CONTROL_CODE)
- switch (c & ~CONTROL_CODE)
- {
- case C_BEGIN_SUPERSCRIPT :
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false,
- SUPERSCRIPT_DX * charsize * HERSHEY_EM,
- SUPERSCRIPT_DY * charsize * HERSHEY_EM);
- charsize *= SCRIPTSIZE;
- break;
-
- case C_END_SUPERSCRIPT:
- charsize /= SCRIPTSIZE;
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false,
- - SUPERSCRIPT_DX * charsize * HERSHEY_EM,
- - SUPERSCRIPT_DY * charsize * HERSHEY_EM);
- break;
-
- case C_BEGIN_SUBSCRIPT:
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false,
- SUBSCRIPT_DX * charsize * HERSHEY_EM,
- SUBSCRIPT_DY * charsize * HERSHEY_EM);
- charsize *= SCRIPTSIZE;
- break;
-
- case C_END_SUBSCRIPT:
- charsize /= SCRIPTSIZE;
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false,
- - SUBSCRIPT_DX * charsize * HERSHEY_EM,
- - SUBSCRIPT_DY * charsize * HERSHEY_EM);
- break;
-
- case C_PUSH_LOCATION:
- saved_charsize = charsize;
- saved_position_x = _plotter->drawstate->pos.x;
- saved_position_y = _plotter->drawstate->pos.y;
- break;
-
- case C_POP_LOCATION:
- charsize = saved_charsize;
- _API_fmove (R___(_plotter)
- saved_position_x, saved_position_y);
- break;
-
- case C_RIGHT_ONE_EM:
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false, charsize * HERSHEY_EM, 0.0);
- break;
-
- case C_RIGHT_HALF_EM:
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false, charsize * HERSHEY_EM / 2.0, 0.0);
- break;
-
- case C_RIGHT_QUARTER_EM:
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false, charsize * HERSHEY_EM / 4.0, 0.0);
- break;
-
- case C_RIGHT_SIXTH_EM:
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false, charsize * HERSHEY_EM / 6.0, 0.0);
- break;
-
- case C_RIGHT_EIGHTH_EM:
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false, charsize * HERSHEY_EM / 8.0, 0.0);
- break;
-
- case C_RIGHT_TWELFTH_EM:
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false, charsize * HERSHEY_EM / 12.0, 0.0);
- break;
-
- case C_LEFT_ONE_EM:
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false, - charsize * HERSHEY_EM, 0.0);
- break;
-
- case C_LEFT_HALF_EM:
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false, - charsize * HERSHEY_EM / 2.0, 0.0);
- break;
-
- case C_LEFT_QUARTER_EM:
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false, - charsize * HERSHEY_EM / 4.0, 0.0);
- break;
-
- case C_LEFT_SIXTH_EM:
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false, - charsize * HERSHEY_EM / 6.0, 0.0);
- break;
-
- case C_LEFT_EIGHTH_EM:
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false, - charsize * HERSHEY_EM / 8.0, 0.0);
- break;
- case C_LEFT_TWELFTH_EM:
- _pl_g_draw_hershey_stroke (R___(_plotter)
- false, - charsize * HERSHEY_EM / 12.0, 0.0);
- break;
-
-
- default:
- break;
- }
-
- else
-
- {
- int raw_fontnum;
- int glyphnum;
- int char_glyphnum, accent_glyphnum;
- int char_width, accent_width;
- const unsigned char *char_glyph, *accent_glyph;
- unsigned char composite, character, accent;
- bool oblique, small_kana = false;
-
-
- raw_fontnum = (c >> FONT_SHIFT) & ONE_BYTE;
-
- oblique = _pl_g_hershey_font_info[raw_fontnum].obliquing;
-
- c &= ~FONT_SPEC;
- glyphnum = (_pl_g_hershey_font_info[raw_fontnum].chars)[c];
-
- if (glyphnum & KS)
- {
- glyphnum -= KS;
- small_kana = true;
- }
-
- switch (glyphnum)
- {
-
- case ACC0:
- case ACC1:
- case ACC2:
- composite = (unsigned char)c;
- if (composite_char (&composite, &character, &accent))
- {
- char_glyphnum =
- (_pl_g_hershey_font_info[raw_fontnum].chars)[character];
- accent_glyphnum =
- (_pl_g_hershey_font_info[raw_fontnum].chars)[accent];
- }
- else
- {
- char_glyphnum = UNDE;
- accent_glyphnum = 0;
- }
- char_glyph =
- (const unsigned char *)_pl_g_occidental_hershey_glyphs[char_glyphnum];
- accent_glyph =
- (const unsigned char *)_pl_g_occidental_hershey_glyphs[accent_glyphnum];
-
- if (*char_glyph != '\0')
-
- char_width = (int)char_glyph[1] - (int)char_glyph[0];
- else
- char_width = 0;
- if (*accent_glyph != '\0')
-
- accent_width = (int)accent_glyph[1] - (int)accent_glyph[0];
- else
- accent_width = 0;
-
- if (line_width_type != 1)
- {
- _API_flinewidth (R___(_plotter)
- HERSHEY_UNITS_TO_USER_UNITS (HERSHEY_STROKE_WIDTH));
- line_width_type = 1;
- }
- _pl_g_draw_hershey_glyph (R___(_plotter)
- char_glyphnum, charsize,
- OCCIDENTAL, oblique);
-
- _pl_g_draw_hershey_penup_stroke (R___(_plotter)
- -0.5 * (double)char_width
- -0.5 * (double)accent_width,
- 0.0, charsize, oblique);
-
- if (glyphnum == ACC1)
- _pl_g_draw_hershey_penup_stroke (R___(_plotter)
- 0.0,
- (double)(ACCENT_UP_SHIFT),
- charsize, oblique);
- else if (glyphnum == ACC2)
- _pl_g_draw_hershey_penup_stroke (R___(_plotter)
- (double)(ACCENT_RIGHT_SHIFT),
- (double)(ACCENT_UP_SHIFT),
- charsize, oblique);
-
- _pl_g_draw_hershey_glyph (R___(_plotter)
- accent_glyphnum, charsize,
- OCCIDENTAL, oblique);
-
- if (glyphnum == ACC1)
- _pl_g_draw_hershey_penup_stroke (R___(_plotter)
- 0.0,
- -(double)(ACCENT_UP_SHIFT),
- charsize, oblique);
- else if (glyphnum == ACC2)
- _pl_g_draw_hershey_penup_stroke (R___(_plotter)
- -(double)(ACCENT_RIGHT_SHIFT),
- -(double)(ACCENT_UP_SHIFT),
- charsize, oblique);
-
- _pl_g_draw_hershey_penup_stroke (R___(_plotter)
- 0.5 * (double)char_width
- -0.5 * (double)accent_width,
- 0.0, charsize, oblique);
- break;
-
- default:
- if (small_kana)
- {
- int kana_width;
- const unsigned char *kana_glyph;
- double shift = 0.5 * (1.0 - (SMALL_KANA_SIZE));
- kana_glyph =
- (const unsigned char *)_pl_g_occidental_hershey_glyphs[glyphnum];
- kana_width = (int)kana_glyph[1] - (int)kana_glyph[0];
-
- _pl_g_draw_hershey_penup_stroke (R___(_plotter)
- shift * (double)kana_width,
- 0.0, charsize, oblique);
- if (line_width_type != 2)
- {
- _API_flinewidth (R___(_plotter)
- HERSHEY_UNITS_TO_USER_UNITS (HERSHEY_ORIENTAL_STROKE_WIDTH));
- line_width_type = 2;
- }
- _pl_g_draw_hershey_glyph (R___(_plotter)
- glyphnum,
- (SMALL_KANA_SIZE) * charsize,
- OCCIDENTAL, oblique);
- _pl_g_draw_hershey_penup_stroke (R___(_plotter)
- shift * (double)kana_width,
- 0.0, charsize, oblique);
- }
- else
-
- {
- if (glyphnum >= BEGINNING_OF_KANA)
- {
- if (line_width_type != 2)
- {
- _API_flinewidth (R___(_plotter)
- HERSHEY_UNITS_TO_USER_UNITS (HERSHEY_ORIENTAL_STROKE_WIDTH));
- line_width_type = 2;
- }
- }
- else
- if (line_width_type != 1)
- {
- _API_flinewidth (R___(_plotter)
- HERSHEY_UNITS_TO_USER_UNITS (HERSHEY_STROKE_WIDTH));
- line_width_type = 1;
- }
- _pl_g_draw_hershey_glyph (R___(_plotter)
- glyphnum, charsize,
- OCCIDENTAL, oblique);
- }
- break;
- }
- }
- }
-
- if (line_width_type != 0)
-
- _API_flinewidth (R___(_plotter) old_line_width);
-
- return;
- }
- static bool
- composite_char (unsigned char *composite, unsigned char *character, unsigned char *accent)
- {
- const struct plHersheyAccentedCharInfoStruct *compchar = _pl_g_hershey_accented_char_info;
- bool found = false;
- unsigned char given = *composite;
-
- while (compchar->composite)
- {
- if (compchar->composite == given)
- {
- found = true;
-
- *character = compchar->character;
- *accent = compchar->accent;
- }
- compchar++;
- }
- return found;
- }
|