diff --git a/trunk/src/texk/web2c/mpdir/psout.w b/trunk/src/texk/web2c/mpdir/psout.w index 71a9f94e97c99e259c9eee51edae10c84ab25da5..c42ee661f069a322856946d84d9bb2e158aa2f34 100644 --- a/trunk/src/texk/web2c/mpdir/psout.w +++ b/trunk/src/texk/web2c/mpdir/psout.w @@ -3226,6 +3226,8 @@ typedef struct mp_ps_font { cs_entry *cs_ptr; cs_entry *subr_tab; int t1_lenIV; + int slant; + int extend; @<Variables for the charstring parser@> } mp_ps_font; @@ -3260,7 +3262,8 @@ mp_ps_font *mp_ps_font_parse (MP mp, int tex_font) { f->cs_ptr = NULL; f->subr_tab = NULL; f->orig_x = f->orig_y = 0.0; - + f->slant = (int)fm_cur->slant; + f->extend = (int)fm_cur->extend; t1_getline (mp); while (!t1_prefix ("/Encoding")) { t1_scan_param (mp,tex_font, fm_cur); diff --git a/trunk/src/texk/web2c/mpdir/svgout.w b/trunk/src/texk/web2c/mpdir/svgout.w index 9a18da1628a6eb0fbf4ce05c17b6a156ed150053..2f5620d6af7c2b7a4e978b993201af24c1de74d8 100644 --- a/trunk/src/texk/web2c/mpdir/svgout.w +++ b/trunk/src/texk/web2c/mpdir/svgout.w @@ -810,18 +810,34 @@ void mp_svg_print_glyph_defs (MP mp, mp_edge_object *h) { for (k=0;k<(int)mp->font_max;k++) { if (mp_chars[k] != NULL ) { double scale; /* the next gives rounding errors */ - scaled ds=(mp->font_dsize[k]+8) / 16; + scaled ds,dx,sk; + ds =(mp->font_dsize[k]+8) / 16; scale = (1/1000.0) * double_from_scaled(ds); ds = scaled_from_double(scale); + dx = ds; + sk = 0; for (l=0;l<256;l++) { if (mp_chars[k][l] == 1) { + if (f == NULL) { + f = mp_ps_font_parse(mp, k); + if (f->extend != 0) { + dx = scaled_from_double(((double)f->extend / 1000.0) * scale); + } + if (f->slant != 0) { + sk = scaled_from_double(((double)f->slant / 1000.0) * 90); + } + } mp_svg_open_starttag(mp,"g"); - /* todo: apply artificial Extend and Slant */ append_string("scale("); - mp_svg_store_scaled(mp,ds); + mp_svg_store_scaled(mp,dx); append_char(','); mp_svg_store_scaled(mp,ds); append_char(')'); + if (sk!=0) { + append_string(" skewX("); + mp_svg_store_scaled(mp,-sk); + append_char(')'); + } mp_svg_attribute(mp, "transform", mp->svg->buf); mp_svg_reset_buf(mp); @@ -832,9 +848,6 @@ void mp_svg_print_glyph_defs (MP mp, mp_edge_object *h) { mp_svg_attribute(mp, "id", mp->svg->buf); mp_svg_reset_buf(mp); mp_svg_close_starttag(mp); - if (f == NULL) { - f = mp_ps_font_parse(mp, k); - } if (f != NULL) { ch = mp_ps_font_charstring(mp,f,l); if (ch != NULL) {