Mercurial > hg > octave-lojdl
changeset 10894:89f13bc14494
gl2ps.c: Use upstream version gl2ps-1.3.5-svn-20100816.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Mon, 16 Aug 2010 17:35:48 -0400 |
parents | 61a5ba82cfbb |
children | 4176c5c62138 |
files | src/ChangeLog src/gl2ps.c |
diffstat | 2 files changed, 44 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2010-08-16 Ben Abbott <bpabbott@mac.com> + + * gl2ps.c: Use upstream version gl2ps-1.3.5-svn-20100816. + 2010-08-13 Rik <octave@nomad.inbox5.com> * toplev.c (do_goto_frame_relative): Remove unused variable c.
--- a/src/gl2ps.c +++ b/src/gl2ps.c @@ -3245,8 +3245,11 @@ case GL2PS_TEXT : fprintf(gl2ps->stream, "\\fontsize{%d}{0}\n\\selectfont", prim->data.text->fontsize); - fprintf(gl2ps->stream, "\\put(%g,%g){\\makebox(0,0)", + fprintf(gl2ps->stream, "\\put(%g,%g)", prim->verts[0].xyz[0], prim->verts[0].xyz[1]); + if(prim->data.text->angle) + fprintf(gl2ps->stream, "{\\rotatebox{%g}", prim->data.text->angle); + fprintf(gl2ps->stream, "{\\makebox(0,0)"); switch(prim->data.text->alignment){ case GL2PS_TEXT_C: fprintf(gl2ps->stream, "{"); @@ -3277,8 +3280,6 @@ fprintf(gl2ps->stream, "[bl]{"); break; } - if(prim->data.text->angle) - fprintf(gl2ps->stream, "\\rotatebox{%g}{", prim->data.text->angle); fprintf(gl2ps->stream, "\\textcolor[rgb]{%g,%g,%g}{{%s}}", prim->verts[0].rgba[0], prim->verts[0].rgba[1], prim->verts[0].rgba[2], prim->data.text->str); @@ -5111,6 +5112,42 @@ if(prim->data.text->angle) gl2psPrintf("transform=\"rotate(%g, %g, %g)\" ", -prim->data.text->angle, xyz[0][0], xyz[0][1]); + switch(prim->data.text->alignment){ + case GL2PS_TEXT_C: + gl2psPrintf("text-anchor=\"middle\" baseline-shift=\"%d\" ", + -prim->data.text->fontsize / 2); + break; + case GL2PS_TEXT_CL: + gl2psPrintf("text-anchor=\"start\" baseline-shift=\"%d\" ", + -prim->data.text->fontsize / 2); + break; + case GL2PS_TEXT_CR: + gl2psPrintf("text-anchor=\"end\" baseline-shift=\"%d\" ", + -prim->data.text->fontsize / 2); + break; + case GL2PS_TEXT_B: + gl2psPrintf("text-anchor=\"middle\" baseline-shift=\"0\" "); + break; + case GL2PS_TEXT_BR: + gl2psPrintf("text-anchor=\"end\" baseline-shift=\"0\" "); + break; + case GL2PS_TEXT_T: + gl2psPrintf("text-anchor=\"middle\" baseline-shift=\"%d\" ", + -prim->data.text->fontsize); + break; + case GL2PS_TEXT_TL: + gl2psPrintf("text-anchor=\"start\" baseline-shift=\"%d\" ", + -prim->data.text->fontsize); + break; + case GL2PS_TEXT_TR: + gl2psPrintf("text-anchor=\"end\" baseline-shift=\"%d\" ", + -prim->data.text->fontsize); + break; + case GL2PS_TEXT_BL: + default: /* same as GL2PS_TEXT_BL */ + gl2psPrintf("text-anchor=\"start\" baseline-shift=\"0\" "); + break; + } if(!strcmp(prim->data.text->fontname, "Times-Roman")) gl2psPrintf("font-family=\"Times\">"); else if(!strcmp(prim->data.text->fontname, "Times-Bold"))