From 955c29fc365d4e0efb7ee1e267b4c77c4ec5e586 Mon Sep 17 00:00:00 2001 From: hooper114 Date: Wed, 8 Jul 2009 09:13:19 +0000 Subject: [PATCH] Tweak addon text positions --- backend/png.c | 16 ++++++++-------- backend/ps.c | 16 ++++++++-------- backend/svg.c | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/backend/png.c b/backend/png.c index 294fa3b9..25ada2ee 100644 --- a/backend/png.c +++ b/backend/png.c @@ -675,11 +675,11 @@ int png_plot(struct zint_symbol *symbol, int rotate_angle) textdone = 1; switch(strlen(addon)) { case 2: - textpos = scaler * (symbol->width + xoffset - 10); + textpos = scaler * (xoffset + 86); draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * scaler) - 13, image_width, image_height); break; case 5: - textpos = scaler * (symbol->width + xoffset - 23); + textpos = scaler * (xoffset + 100); draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * scaler) - 13, image_width, image_height); break; } @@ -714,11 +714,11 @@ int png_plot(struct zint_symbol *symbol, int rotate_angle) textdone = 1; switch(strlen(addon)) { case 2: - textpos = scaler * (symbol->width + xoffset - 10); + textpos = scaler * (xoffset + 114); draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * scaler) - 13, image_width, image_height); break; case 5: - textpos = scaler * (symbol->width + xoffset - 23); + textpos = scaler * (xoffset + 128); draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * scaler) - 13, image_width, image_height); break; } @@ -789,11 +789,11 @@ int png_plot(struct zint_symbol *symbol, int rotate_angle) textdone = 1; switch(strlen(addon)) { case 2: - textpos = scaler * (symbol->width + xoffset - 10); + textpos = scaler * (xoffset + 116); draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * scaler) - 13, image_width, image_height); break; case 5: - textpos = scaler * (symbol->width + xoffset - 23); + textpos = scaler * (xoffset + 130); draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * scaler) - 13, image_width, image_height); break; } @@ -825,11 +825,11 @@ int png_plot(struct zint_symbol *symbol, int rotate_angle) textdone = 1; switch(strlen(addon)) { case 2: - textpos = scaler * (symbol->width + xoffset - 10); + textpos = scaler * (xoffset + 70); draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * scaler) - 13, image_width, image_height); break; case 5: - textpos = scaler * (symbol->width + xoffset - 23); + textpos = scaler * (xoffset + 84); draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * scaler) - 13, image_width, image_height); break; } diff --git a/backend/ps.c b/backend/ps.c index 6e9db17c..174a5415 100644 --- a/backend/ps.c +++ b/backend/ps.c @@ -379,7 +379,7 @@ int ps_plot(struct zint_symbol *symbol) fprintf(feps, "matrix currentmatrix\n"); fprintf(feps, "/Helvetica findfont\n"); fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler); - textpos = symbol->width + xoffset - 10; + textpos = xoffset + 86; fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", textpos * scaler, addon_text_posn * scaler); fprintf(feps, " (%s) stringwidth\n", addon); fprintf(feps, "pop\n"); @@ -391,7 +391,7 @@ int ps_plot(struct zint_symbol *symbol) fprintf(feps, "matrix currentmatrix\n"); fprintf(feps, "/Helvetica findfont\n"); fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler); - textpos = symbol->width + xoffset - 23; + textpos = xoffset + 100; fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", textpos * scaler, addon_text_posn * scaler); fprintf(feps, " (%s) stringwidth\n", addon); fprintf(feps, "pop\n"); @@ -462,7 +462,7 @@ int ps_plot(struct zint_symbol *symbol) fprintf(feps, "matrix currentmatrix\n"); fprintf(feps, "/Helvetica findfont\n"); fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler); - textpos = symbol->width + xoffset - 10; + textpos = xoffset + 114; fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", textpos * scaler, addon_text_posn * scaler); fprintf(feps, " (%s) stringwidth\n", addon); fprintf(feps, "pop\n"); @@ -474,7 +474,7 @@ int ps_plot(struct zint_symbol *symbol) fprintf(feps, "matrix currentmatrix\n"); fprintf(feps, "/Helvetica findfont\n"); fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler); - textpos = symbol->width + xoffset - 23; + textpos = xoffset + 128; fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", textpos * scaler, addon_text_posn * scaler); fprintf(feps, " (%s) stringwidth\n", addon); fprintf(feps, "pop\n"); @@ -590,7 +590,7 @@ int ps_plot(struct zint_symbol *symbol) fprintf(feps, "matrix currentmatrix\n"); fprintf(feps, "/Helvetica findfont\n"); fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler); - textpos = symbol->width + xoffset - 10; + textpos = xoffset + 116; fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", textpos * scaler, addon_text_posn * scaler); fprintf(feps, " (%s) stringwidth\n", addon); fprintf(feps, "pop\n"); @@ -602,7 +602,7 @@ int ps_plot(struct zint_symbol *symbol) fprintf(feps, "matrix currentmatrix\n"); fprintf(feps, "/Helvetica findfont\n"); fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler); - textpos = symbol->width + xoffset - 23; + textpos = xoffset + 130; fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", textpos * scaler, addon_text_posn * scaler); fprintf(feps, " (%s) stringwidth\n", addon); fprintf(feps, "pop\n"); @@ -670,7 +670,7 @@ int ps_plot(struct zint_symbol *symbol) fprintf(feps, "matrix currentmatrix\n"); fprintf(feps, "/Helvetica findfont\n"); fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler); - textpos = symbol->width + xoffset - 10; + textpos = xoffset + 70; fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", textpos * scaler, addon_text_posn * scaler); fprintf(feps, " (%s) stringwidth\n", addon); fprintf(feps, "pop\n"); @@ -682,7 +682,7 @@ int ps_plot(struct zint_symbol *symbol) fprintf(feps, "matrix currentmatrix\n"); fprintf(feps, "/Helvetica findfont\n"); fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler); - textpos = symbol->width + xoffset - 23; + textpos = xoffset + 84; fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", textpos * scaler, addon_text_posn * scaler); fprintf(feps, " (%s) stringwidth\n", addon); fprintf(feps, "pop\n"); diff --git a/backend/svg.c b/backend/svg.c index 06ecd029..a17540c3 100644 --- a/backend/svg.c +++ b/backend/svg.c @@ -344,14 +344,14 @@ int svg_plot(struct zint_symbol *symbol) textdone = 1; switch(strlen(addon)) { case 2: - textpos = symbol->width + xoffset - 10; + textpos = xoffset + 86; fprintf(fsvg, " \n", 11.0 * scaler, symbol->fgcolour); fprintf(fsvg, " %s\n", addon); fprintf(fsvg, " \n"); break; case 5: - textpos = symbol->width + xoffset - 23; + textpos = xoffset + 100; fprintf(fsvg, " \n", 11.0 * scaler, symbol->fgcolour); fprintf(fsvg, " %s\n", addon); @@ -397,14 +397,14 @@ int svg_plot(struct zint_symbol *symbol) textdone = 1; switch(strlen(addon)) { case 2: - textpos = symbol->width + xoffset - 10; + textpos = xoffset + 114; fprintf(fsvg, " \n", 11.0 * scaler, symbol->fgcolour); fprintf(fsvg, " %s\n", addon); fprintf(fsvg, " \n"); break; case 5: - textpos = symbol->width + xoffset - 23; + textpos = xoffset + 128; fprintf(fsvg, " \n", 11.0 * scaler, symbol->fgcolour); fprintf(fsvg, " %s\n", addon); @@ -490,14 +490,14 @@ int svg_plot(struct zint_symbol *symbol) textdone = 1; switch(strlen(addon)) { case 2: - textpos = symbol->width + xoffset - 10; + textpos = xoffset + 116; fprintf(fsvg, " \n", 11.0 * scaler, symbol->fgcolour); fprintf(fsvg, " %s\n", addon); fprintf(fsvg, " \n"); break; case 5: - textpos = symbol->width + xoffset - 23; + textpos = xoffset + 130; fprintf(fsvg, " \n", 11.0 * scaler, symbol->fgcolour); fprintf(fsvg, " %s\n", addon); @@ -540,14 +540,14 @@ int svg_plot(struct zint_symbol *symbol) textdone = 1; switch(strlen(addon)) { case 2: - textpos = symbol->width + xoffset - 10; + textpos = xoffset + 70; fprintf(fsvg, " \n", 11.0 * scaler, symbol->fgcolour); fprintf(fsvg, " %s\n", addon); fprintf(fsvg, " \n"); break; case 5: - textpos = symbol->width + xoffset - 23; + textpos = xoffset + 84; fprintf(fsvg, " \n", 11.0 * scaler, symbol->fgcolour); fprintf(fsvg, " %s\n", addon);