mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Tweak addon text positions
This commit is contained in:
parent
bae63db6b4
commit
955c29fc36
@ -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;
|
||||
}
|
||||
|
16
backend/ps.c
16
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");
|
||||
|
@ -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, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 11.0 * scaler, symbol->fgcolour);
|
||||
fprintf(fsvg, " %s\n", addon);
|
||||
fprintf(fsvg, " </text>\n");
|
||||
break;
|
||||
case 5:
|
||||
textpos = symbol->width + xoffset - 23;
|
||||
textpos = xoffset + 100;
|
||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\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, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 11.0 * scaler, symbol->fgcolour);
|
||||
fprintf(fsvg, " %s\n", addon);
|
||||
fprintf(fsvg, " </text>\n");
|
||||
break;
|
||||
case 5:
|
||||
textpos = symbol->width + xoffset - 23;
|
||||
textpos = xoffset + 128;
|
||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\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, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 11.0 * scaler, symbol->fgcolour);
|
||||
fprintf(fsvg, " %s\n", addon);
|
||||
fprintf(fsvg, " </text>\n");
|
||||
break;
|
||||
case 5:
|
||||
textpos = symbol->width + xoffset - 23;
|
||||
textpos = xoffset + 130;
|
||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\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, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 11.0 * scaler, symbol->fgcolour);
|
||||
fprintf(fsvg, " %s\n", addon);
|
||||
fprintf(fsvg, " </text>\n");
|
||||
break;
|
||||
case 5:
|
||||
textpos = symbol->width + xoffset - 23;
|
||||
textpos = xoffset + 84;
|
||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 11.0 * scaler, symbol->fgcolour);
|
||||
fprintf(fsvg, " %s\n", addon);
|
||||
|
Loading…
Reference in New Issue
Block a user