From 98da9dfa916510bbb00df85858d3f679f313ab2e Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 17 Oct 2009 19:07:11 +0000 Subject: [PATCH] 1.3.5 --- Graphics/gl2ps.cpp | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/Graphics/gl2ps.cpp b/Graphics/gl2ps.cpp index e63b24d0ba..cb66c91b11 100644 --- a/Graphics/gl2ps.cpp +++ b/Graphics/gl2ps.cpp @@ -3391,23 +3391,39 @@ static int gl2psPrintPDFLineWidth(GLfloat lw) static void gl2psPutPDFText(GL2PSstring *text, int cnt, GLfloat x, GLfloat y) { - gl2ps->streamlength += - gl2psPrintf("BT\n" - "/F%d %d Tf\n" - "%f %f Td\n" - "(%s) Tj\n" - "ET\n", - cnt, text->fontsize, x, y, text->str); + GLfloat rad, crad, srad; + + if(text->angle == 0.0F){ + gl2ps->streamlength += gl2psPrintf + ("BT\n" + "/F%d %d Tf\n" + "%f %f Td\n" + "(%s) Tj\n" + "ET\n", + cnt, text->fontsize, x, y, text->str); + } + else{ + rad = M_PI * text->angle / 180.0F; + srad = (GLfloat)sin(rad); + crad = (GLfloat)cos(rad); + gl2ps->streamlength += gl2psPrintf + ("BT\n" + "/F%d %d Tf\n" + "%f %f %f %f %f %f Tm\n" + "(%s) Tj\n" + "ET\n", + cnt, text->fontsize, crad, srad, -srad, crad, x, y, text->str); + } } static void gl2psPutPDFImage(GL2PSimage *image, int cnt, GLfloat x, GLfloat y) { - gl2ps->streamlength += - gl2psPrintf("q\n" - "%d 0 0 %d %f %f cm\n" - "/Im%d Do\n" - "Q\n", - (int)image->width, (int)image->height, x, y, cnt); + gl2ps->streamlength += gl2psPrintf + ("q\n" + "%d 0 0 %d %f %f cm\n" + "/Im%d Do\n" + "Q\n", + (int)image->width, (int)image->height, x, y, cnt); } static void gl2psPDFstacksInit(void) -- GitLab