mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Add font size option for SVG and EPS
This commit is contained in:
parent
8bb4d2ce86
commit
78d85bd72e
@ -63,6 +63,7 @@ struct zint_symbol *ZBarcode_Create() {
|
|||||||
symbol->option_2 = 0;
|
symbol->option_2 = 0;
|
||||||
symbol->option_3 = 928; // PDF_MAX
|
symbol->option_3 = 928; // PDF_MAX
|
||||||
symbol->show_hrt = 1; // Show human readable text
|
symbol->show_hrt = 1; // Show human readable text
|
||||||
|
symbol->fontsize = 8;
|
||||||
symbol->input_mode = DATA_MODE;
|
symbol->input_mode = DATA_MODE;
|
||||||
strcpy(symbol->primary, "");
|
strcpy(symbol->primary, "");
|
||||||
memset(&(symbol->encoded_data[0][0]), 0, sizeof (symbol->encoded_data));
|
memset(&(symbol->encoded_data[0][0]), 0, sizeof (symbol->encoded_data));
|
||||||
|
43
backend/ps.c
43
backend/ps.c
@ -55,6 +55,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
float scaler = symbol->scale;
|
float scaler = symbol->scale;
|
||||||
float default_text_posn;
|
float default_text_posn;
|
||||||
const char *locale = NULL;
|
const char *locale = NULL;
|
||||||
|
float fontsize = symbol->fontsize * scaler;
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
unsigned char local_text[ustrlen(symbol->text) + 1];
|
unsigned char local_text[ustrlen(symbol->text) + 1];
|
||||||
#else
|
#else
|
||||||
@ -518,7 +519,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = 17;
|
textpos = 17;
|
||||||
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(feps, " (%s) stringwidth\n", textpart);
|
fprintf(feps, " (%s) stringwidth\n", textpart);
|
||||||
@ -532,7 +533,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[4] = '\0';
|
textpart[4] = '\0';
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = 50;
|
textpos = 50;
|
||||||
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(feps, " (%s) stringwidth\n", textpart);
|
fprintf(feps, " (%s) stringwidth\n", textpart);
|
||||||
@ -545,7 +546,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
case 2:
|
case 2:
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = xoffset + 86;
|
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, " 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, " (%s) stringwidth\n", addon);
|
||||||
@ -557,7 +558,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
case 5:
|
case 5:
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = xoffset + 100;
|
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, " 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, " (%s) stringwidth\n", addon);
|
||||||
@ -595,7 +596,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = -7;
|
textpos = -7;
|
||||||
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(feps, " (%s) stringwidth\n", textpart);
|
fprintf(feps, " (%s) stringwidth\n", textpart);
|
||||||
@ -609,7 +610,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[6] = '\0';
|
textpart[6] = '\0';
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = 24;
|
textpos = 24;
|
||||||
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(feps, " (%s) stringwidth\n", textpart);
|
fprintf(feps, " (%s) stringwidth\n", textpart);
|
||||||
@ -623,7 +624,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[6] = '\0';
|
textpart[6] = '\0';
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = 71;
|
textpos = 71;
|
||||||
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(feps, " (%s) stringwidth\n", textpart);
|
fprintf(feps, " (%s) stringwidth\n", textpart);
|
||||||
@ -636,7 +637,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
case 2:
|
case 2:
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = xoffset + 114;
|
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, " 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, " (%s) stringwidth\n", addon);
|
||||||
@ -648,7 +649,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
case 5:
|
case 5:
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = xoffset + 128;
|
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, " 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, " (%s) stringwidth\n", addon);
|
||||||
@ -719,7 +720,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 8.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", fontsize);
|
||||||
textpos = -5;
|
textpos = -5;
|
||||||
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(feps, " (%s) stringwidth\n", textpart);
|
fprintf(feps, " (%s) stringwidth\n", textpart);
|
||||||
@ -733,7 +734,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[5] = '\0';
|
textpart[5] = '\0';
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = 27;
|
textpos = 27;
|
||||||
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(feps, " (%s) stringwidth\n", textpart);
|
fprintf(feps, " (%s) stringwidth\n", textpart);
|
||||||
@ -747,7 +748,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[6] = '\0';
|
textpart[6] = '\0';
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = 68;
|
textpos = 68;
|
||||||
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(feps, " (%s) stringwidth\n", textpart);
|
fprintf(feps, " (%s) stringwidth\n", textpart);
|
||||||
@ -759,7 +760,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[1] = '\0';
|
textpart[1] = '\0';
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 8.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", fontsize);
|
||||||
textpos = 100;
|
textpos = 100;
|
||||||
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(feps, " (%s) stringwidth\n", textpart);
|
fprintf(feps, " (%s) stringwidth\n", textpart);
|
||||||
@ -772,7 +773,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
case 2:
|
case 2:
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = xoffset + 116;
|
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, " 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, " (%s) stringwidth\n", addon);
|
||||||
@ -784,7 +785,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
case 5:
|
case 5:
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = xoffset + 130;
|
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, " 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, " (%s) stringwidth\n", addon);
|
||||||
@ -817,7 +818,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
fprintf(feps, "%.2f %.2f %.2f setrgbcolor\n", red_ink, green_ink, blue_ink);
|
fprintf(feps, "%.2f %.2f %.2f setrgbcolor\n", red_ink, green_ink, blue_ink);
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 8.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", fontsize);
|
||||||
textpos = -5;
|
textpos = -5;
|
||||||
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(feps, " (%s) stringwidth\n", textpart);
|
fprintf(feps, " (%s) stringwidth\n", textpart);
|
||||||
@ -831,7 +832,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[6] = '\0';
|
textpart[6] = '\0';
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = 24;
|
textpos = 24;
|
||||||
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(feps, " (%s) stringwidth\n", textpart);
|
fprintf(feps, " (%s) stringwidth\n", textpart);
|
||||||
@ -843,7 +844,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[1] = '\0';
|
textpart[1] = '\0';
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 8.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", fontsize);
|
||||||
textpos = 55;
|
textpos = 55;
|
||||||
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(feps, " (%s) stringwidth\n", textpart);
|
fprintf(feps, " (%s) stringwidth\n", textpart);
|
||||||
@ -856,7 +857,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
case 2:
|
case 2:
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = xoffset + 70;
|
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, " 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, " (%s) stringwidth\n", addon);
|
||||||
@ -868,7 +869,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
case 5:
|
case 5:
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", (11.0 / 8.0) * fontsize);
|
||||||
textpos = xoffset + 84;
|
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, " 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, " (%s) stringwidth\n", addon);
|
||||||
@ -947,7 +948,7 @@ int ps_plot(struct zint_symbol *symbol) {
|
|||||||
}
|
}
|
||||||
fprintf(feps, "matrix currentmatrix\n");
|
fprintf(feps, "matrix currentmatrix\n");
|
||||||
fprintf(feps, "/Helvetica findfont\n");
|
fprintf(feps, "/Helvetica findfont\n");
|
||||||
fprintf(feps, "%.2f scalefont setfont\n", 8.0 * scaler);
|
fprintf(feps, "%.2f scalefont setfont\n", fontsize);
|
||||||
textpos = symbol->width / 2.0;
|
textpos = symbol->width / 2.0;
|
||||||
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(feps, " (%s) stringwidth\n", local_text);
|
fprintf(feps, " (%s) stringwidth\n", local_text);
|
||||||
|
@ -55,6 +55,7 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
float scaler = symbol->scale;
|
float scaler = symbol->scale;
|
||||||
float default_text_posn;
|
float default_text_posn;
|
||||||
const char *locale = NULL;
|
const char *locale = NULL;
|
||||||
|
float fontsize = symbol->fontsize * scaler;
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
unsigned char local_text[ustrlen(symbol->text) + 1];
|
unsigned char local_text[ustrlen(symbol->text) + 1];
|
||||||
#else
|
#else
|
||||||
@ -389,7 +390,7 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[4] = '\0';
|
textpart[4] = '\0';
|
||||||
textpos = 17;
|
textpos = 17;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 11.0 * scaler, symbol->fgcolour);
|
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", textpart);
|
fprintf(fsvg, " %s\n", textpart);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
@ -398,7 +399,7 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[4] = '\0';
|
textpart[4] = '\0';
|
||||||
textpos = 50;
|
textpos = 50;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 11.0 * scaler, symbol->fgcolour);
|
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", textpart);
|
fprintf(fsvg, " %s\n", textpart);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
textdone = 1;
|
textdone = 1;
|
||||||
@ -406,14 +407,14 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
case 2:
|
case 2:
|
||||||
textpos = xoffset + 86;
|
textpos = xoffset + 86;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
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, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", addon);
|
fprintf(fsvg, " %s\n", addon);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
textpos = xoffset + 100;
|
textpos = xoffset + 100;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
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, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", addon);
|
fprintf(fsvg, " %s\n", addon);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
break;
|
break;
|
||||||
@ -433,7 +434,7 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[1] = '\0';
|
textpart[1] = '\0';
|
||||||
textpos = -7;
|
textpos = -7;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 11.0 * scaler, symbol->fgcolour);
|
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", textpart);
|
fprintf(fsvg, " %s\n", textpart);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
for (i = 0; i < 6; i++) {
|
for (i = 0; i < 6; i++) {
|
||||||
@ -442,7 +443,7 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[6] = '\0';
|
textpart[6] = '\0';
|
||||||
textpos = 24;
|
textpos = 24;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 11.0 * scaler, symbol->fgcolour);
|
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", textpart);
|
fprintf(fsvg, " %s\n", textpart);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
for (i = 0; i < 6; i++) {
|
for (i = 0; i < 6; i++) {
|
||||||
@ -451,7 +452,7 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[6] = '\0';
|
textpart[6] = '\0';
|
||||||
textpos = 71;
|
textpos = 71;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 11.0 * scaler, symbol->fgcolour);
|
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", textpart);
|
fprintf(fsvg, " %s\n", textpart);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
textdone = 1;
|
textdone = 1;
|
||||||
@ -459,14 +460,14 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
case 2:
|
case 2:
|
||||||
textpos = xoffset + 114;
|
textpos = xoffset + 114;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
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, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", addon);
|
fprintf(fsvg, " %s\n", addon);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
textpos = xoffset + 128;
|
textpos = xoffset + 128;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
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, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", addon);
|
fprintf(fsvg, " %s\n", addon);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
break;
|
break;
|
||||||
@ -519,7 +520,7 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[1] = '\0';
|
textpart[1] = '\0';
|
||||||
textpos = -5;
|
textpos = -5;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 8.0 * scaler, symbol->fgcolour);
|
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", textpart);
|
fprintf(fsvg, " %s\n", textpart);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
for (i = 0; i < 5; i++) {
|
for (i = 0; i < 5; i++) {
|
||||||
@ -528,7 +529,7 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[5] = '\0';
|
textpart[5] = '\0';
|
||||||
textpos = 27;
|
textpos = 27;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 11.0 * scaler, symbol->fgcolour);
|
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", textpart);
|
fprintf(fsvg, " %s\n", textpart);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
for (i = 0; i < 5; i++) {
|
for (i = 0; i < 5; i++) {
|
||||||
@ -537,14 +538,14 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[6] = '\0';
|
textpart[6] = '\0';
|
||||||
textpos = 68;
|
textpos = 68;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 11.0 * scaler, symbol->fgcolour);
|
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", textpart);
|
fprintf(fsvg, " %s\n", textpart);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
textpart[0] = local_text[11];
|
textpart[0] = local_text[11];
|
||||||
textpart[1] = '\0';
|
textpart[1] = '\0';
|
||||||
textpos = 100;
|
textpos = 100;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 8.0 * scaler, symbol->fgcolour);
|
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", textpart);
|
fprintf(fsvg, " %s\n", textpart);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
textdone = 1;
|
textdone = 1;
|
||||||
@ -552,14 +553,14 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
case 2:
|
case 2:
|
||||||
textpos = xoffset + 116;
|
textpos = xoffset + 116;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
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, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", addon);
|
fprintf(fsvg, " %s\n", addon);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
textpos = xoffset + 130;
|
textpos = xoffset + 130;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
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, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", addon);
|
fprintf(fsvg, " %s\n", addon);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
break;
|
break;
|
||||||
@ -578,7 +579,7 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[1] = '\0';
|
textpart[1] = '\0';
|
||||||
textpos = -5;
|
textpos = -5;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 8.0 * scaler, symbol->fgcolour);
|
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", textpart);
|
fprintf(fsvg, " %s\n", textpart);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
for (i = 0; i < 6; i++) {
|
for (i = 0; i < 6; i++) {
|
||||||
@ -587,14 +588,14 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
textpart[6] = '\0';
|
textpart[6] = '\0';
|
||||||
textpos = 24;
|
textpos = 24;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 11.0 * scaler, symbol->fgcolour);
|
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (11.0 / 8.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", textpart);
|
fprintf(fsvg, " %s\n", textpart);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
textpart[0] = local_text[7];
|
textpart[0] = local_text[7];
|
||||||
textpart[1] = '\0';
|
textpart[1] = '\0';
|
||||||
textpos = 55;
|
textpos = 55;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 8.0 * scaler, symbol->fgcolour);
|
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", textpart);
|
fprintf(fsvg, " %s\n", textpart);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
textdone = 1;
|
textdone = 1;
|
||||||
@ -602,14 +603,14 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
case 2:
|
case 2:
|
||||||
textpos = xoffset + 70;
|
textpos = xoffset + 70;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
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, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (8.0 / 11.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", addon);
|
fprintf(fsvg, " %s\n", addon);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
textpos = xoffset + 84;
|
textpos = xoffset + 84;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", textpos * scaler, addon_text_posn * scaler);
|
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, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", (8.0 / 11.0) * fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", addon);
|
fprintf(fsvg, " %s\n", addon);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
break;
|
break;
|
||||||
@ -659,7 +660,7 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||||||
if ((textdone == 0) && ustrlen(local_text)) {
|
if ((textdone == 0) && ustrlen(local_text)) {
|
||||||
textpos = symbol->width / 2.0;
|
textpos = symbol->width / 2.0;
|
||||||
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
fprintf(fsvg, " <text x=\"%.2f\" y=\"%.2f\" text-anchor=\"middle\"\n", (textpos + xoffset) * scaler, default_text_posn);
|
||||||
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", 8.0 * scaler, symbol->fgcolour);
|
fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\" fill=\"#%s\" >\n", fontsize, symbol->fgcolour);
|
||||||
fprintf(fsvg, " %s\n", local_text);
|
fprintf(fsvg, " %s\n", local_text);
|
||||||
fprintf(fsvg, " </text>\n");
|
fprintf(fsvg, " </text>\n");
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,7 @@ extern "C" {
|
|||||||
int option_2;
|
int option_2;
|
||||||
int option_3;
|
int option_3;
|
||||||
int show_hrt;
|
int show_hrt;
|
||||||
|
int fontsize;
|
||||||
int input_mode;
|
int input_mode;
|
||||||
int eci;
|
int eci;
|
||||||
unsigned char text[128];
|
unsigned char text[128];
|
||||||
|
@ -435,6 +435,7 @@ int main(int argc, char **argv) {
|
|||||||
{"eci", 1, 0, 0},
|
{"eci", 1, 0, 0},
|
||||||
{"filetype", 1, 0, 0},
|
{"filetype", 1, 0, 0},
|
||||||
{"esc", 0, 0, 0},
|
{"esc", 0, 0, 0},
|
||||||
|
{"fontsize", 1, 0, 0},
|
||||||
{"verbose", 0, 0, 0}, // Currently undocumented, output some debug info
|
{"verbose", 0, 0, 0}, // Currently undocumented, output some debug info
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
@ -639,6 +640,14 @@ int main(int argc, char **argv) {
|
|||||||
if (!strcmp(long_options[option_index].name, "verbose")) {
|
if (!strcmp(long_options[option_index].name, "verbose")) {
|
||||||
my_symbol->debug = 1;
|
my_symbol->debug = 1;
|
||||||
}
|
}
|
||||||
|
if (!strcmp(long_options[option_index].name, "fontsize")) {
|
||||||
|
if ((atoi(optarg) >= 0) && (atoi(optarg) <= 100)) {
|
||||||
|
my_symbol->fontsize = atoi(optarg);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Warning 125: Invalid font size\n");
|
||||||
|
fflush(stderr);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
|
Loading…
Reference in New Issue
Block a user