local_text[0] = '\0';
}
- textdone = 0;
+ textdone = (symbol->show_hrt != 0) ? 0 : 1;
main_width = symbol->width;
strcpy(addon, "");
comp_offset = 0;
}
}
addon[r] = '\0';
-
- if(tlen) {
+
+ if((symbol->show_hrt != 0) && tlen) {
textoffset = 9;
} else {
textoffset = 0;
yoffset = symbol->border_width;
image_width = 2 * (symbol->width + xoffset + xoffset);
image_height = 2 * (symbol->height + textoffset + yoffset + yoffset);
-
+
if (!(pixelbuf = (char *) malloc(image_width * image_height))) {
printf("Insufficient memory for pixel buffer");
return ERROR_ENCODING_PROBLEM;
*(pixelbuf + i) = '0';
}
}
-
+
if(((symbol->output_options & BARCODE_BOX) != 0) || ((symbol->output_options & BARCODE_BIND) != 0)) {
default_text_posn = image_height - 17;
} else {
draw_bar(pixelbuf, (34 + xoffset) * 2, 1 * 2, (4 + (int)yoffset) * 2, 5 * 2, image_width, image_height);
draw_bar(pixelbuf, (64 + xoffset) * 2, 1 * 2, (4 + (int)yoffset) * 2, 5 * 2, image_width, image_height);
draw_bar(pixelbuf, (66 + xoffset) * 2, 1 * 2, (4 + (int)yoffset) * 2, 5 * 2, image_width, image_height);
- for(i = 0; i < 4; i++) {
- textpart[i] = symbol->text[i];
- }
- textpart[4] = '\0';
- textpos = 2 * (17 + xoffset);
-
- draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
- for(i = 0; i < 4; i++) {
- textpart[i] = symbol->text[i + 4];
- }
- textpart[4] = '\0';
- textpos = 2 * (50 + xoffset);
- draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
- textdone = 1;
- switch(strlen(addon)) {
- case 2:
- textpos = 2 * (xoffset + 86);
- draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
- break;
- case 5:
- textpos = 2 * (xoffset + 100);
- draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
- break;
+
+ if(symbol->show_hrt != 0) {
+ for(i = 0; i < 4; i++) {
+ textpart[i] = symbol->text[i];
+ }
+ textpart[4] = '\0';
+ textpos = 2 * (17 + xoffset);
+
+ draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
+ for(i = 0; i < 4; i++) {
+ textpart[i] = symbol->text[i + 4];
+ }
+ textpart[4] = '\0';
+ textpos = 2 * (50 + xoffset);
+ draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
+ textdone = 1;
+ switch(strlen(addon)) {
+ case 2:
+ textpos = 2 * (xoffset + 86);
+ draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
+ break;
+ case 5:
+ textpos = 2 * (xoffset + 100);
+ draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
+ break;
+ }
}
break;
draw_bar(pixelbuf, (92 + xoffset) * 2, 1 * 2, (4 + (int)yoffset) * 2, 5 * 2, image_width, image_height);
draw_bar(pixelbuf, (94 + xoffset) * 2, 1 * 2, (4 + (int)yoffset) * 2, 5 * 2, image_width, image_height);
- textpart[0] = symbol->text[0];
- textpart[1] = '\0';
- textpos = 2 * (-7 + xoffset);
- draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
- for(i = 0; i < 6; i++) {
- textpart[i] = symbol->text[i + 1];
- }
- textpart[6] = '\0';
- textpos = 2 * (24 + xoffset);
- draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
- for(i = 0; i < 6; i++) {
- textpart[i] = symbol->text[i + 7];
- }
- textpart[6] = '\0';
- textpos = 2 * (71 + xoffset);
- draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
- textdone = 1;
- switch(strlen(addon)) {
- case 2:
- textpos = 2 * (xoffset + 114);
- draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
- break;
- case 5:
- textpos = 2 * (xoffset + 128);
- draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
- break;
+ if (symbol->show_hrt != 0) {
+ textpart[0] = symbol->text[0];
+ textpart[1] = '\0';
+ textpos = 2 * (-7 + xoffset);
+ draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
+ for(i = 0; i < 6; i++) {
+ textpart[i] = symbol->text[i + 1];
+ }
+ textpart[6] = '\0';
+ textpos = 2 * (24 + xoffset);
+ draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
+ for(i = 0; i < 6; i++) {
+ textpart[i] = symbol->text[i + 7];
+ }
+ textpart[6] = '\0';
+ textpos = 2 * (71 + xoffset);
+ draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
+ textdone = 1;
+ switch(strlen(addon)) {
+ case 2:
+ textpos = 2 * (xoffset + 114);
+ draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
+ break;
+ case 5:
+ textpos = 2 * (xoffset + 128);
+ draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
+ break;
+ }
+ break;
}
- break;
}
- }
+ }
if (((symbol->symbology == BARCODE_UPCA) && (symbol->rows == 1)) || (symbol->symbology == BARCODE_UPCA_CC)) {
/* guard bar extensions and text formatting for UPCA */
latch = 1;
-
+
i = 0 + comp_offset;
do {
block_width = 0;
}
i += block_width;
} while (i < 96 + comp_offset);
- textpart[0] = symbol->text[0];
- textpart[1] = '\0';
- textpos = 2 * (-5 + xoffset);
- draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
- for(i = 0; i < 5; i++) {
- textpart[i] = symbol->text[i + 1];
- }
- textpart[5] = '\0';
- textpos = 2 * (27 + xoffset);
- draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
- for(i = 0; i < 5; i++) {
- textpart[i] = symbol->text[i + 6];
- }
- textpart[6] = '\0';
- textpos = 2 * (68 + xoffset);
- draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
- textpart[0] = symbol->text[11];
- textpart[1] = '\0';
- textpos = 2 * (100 + xoffset);
- draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
- textdone = 1;
- switch(strlen(addon)) {
- case 2:
- textpos = 2 * (xoffset + 116);
- draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
- break;
- case 5:
- textpos = 2 * (xoffset + 130);
- draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
- break;
- }
- }
+ if(symbol->show_hrt != 0) {
+ textpart[0] = symbol->text[0];
+ textpart[1] = '\0';
+ textpos = 2 * (-5 + xoffset);
+ draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
+ for(i = 0; i < 5; i++) {
+ textpart[i] = symbol->text[i + 1];
+ }
+ textpart[5] = '\0';
+ textpos = 2 * (27 + xoffset);
+ draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
+ for(i = 0; i < 5; i++) {
+ textpart[i] = symbol->text[i + 6];
+ }
+ textpart[6] = '\0';
+ textpos = 2 * (68 + xoffset);
+ draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
+ textpart[0] = symbol->text[11];
+ textpart[1] = '\0';
+ textpos = 2 * (100 + xoffset);
+ draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
+ textdone = 1;
+ switch(strlen(addon)) {
+ case 2:
+ textpos = 2 * (xoffset + 116);
+ draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
+ break;
+ case 5:
+ textpos = 2 * (xoffset + 130);
+ draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
+ break;
+ }
+ }
+ }
if (((symbol->symbology == BARCODE_UPCE) && (symbol->rows == 1)) || (symbol->symbology == BARCODE_UPCE_CC)) {
/* guard bar extensions and text formatting for UPCE */
draw_bar(pixelbuf, (48 + xoffset) * 2, 1 * 2, (4 + (int)yoffset) * 2, 5 * 2, image_width, image_height);
draw_bar(pixelbuf, (50 + xoffset) * 2, 1 * 2, (4 + (int)yoffset) * 2, 5 * 2, image_width, image_height);
- textpart[0] = symbol->text[0];
- textpart[1] = '\0';
- textpos = 2 * (-5 + xoffset);
- draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
- for(i = 0; i < 6; i++) {
- textpart[i] = symbol->text[i + 1];
- }
- textpart[6] = '\0';
- textpos = 2 * (24 + xoffset);
- draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
- textpart[0] = symbol->text[7];
- textpart[1] = '\0';
- textpos = 2 * (55 + xoffset);
- draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
- textdone = 1;
- switch(strlen(addon)) {
- case 2:
- textpos = 2 * (xoffset + 70);
- draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
- break;
- case 5:
- textpos = 2 * (xoffset + 84);
- draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
- break;
+ if (symbol->show_hrt != 0) {
+ textpart[0] = symbol->text[0];
+ textpart[1] = '\0';
+ textpos = 2 * (-5 + xoffset);
+ draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
+ for(i = 0; i < 6; i++) {
+ textpart[i] = symbol->text[i + 1];
+ }
+ textpart[6] = '\0';
+ textpos = 2 * (24 + xoffset);
+ draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
+ textpart[0] = symbol->text[7];
+ textpart[1] = '\0';
+ textpos = 2 * (55 + xoffset);
+ draw_string(pixelbuf, textpart, textpos, default_text_posn, smalltext, image_width, image_height);
+ textdone = 1;
+ switch(strlen(addon)) {
+ case 2:
+ textpos = 2 * (xoffset + 70);
+ draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
+ break;
+ case 5:
+ textpos = 2 * (xoffset + 84);
+ draw_string(pixelbuf, addon, textpos, image_height - (addon_text_posn * 2) - 13, smalltext, image_width, image_height);
+ break;
+ }
}
}
xoffset -= comp_offset;
-
+
/* Put boundary bars or box around symbol */
if(((symbol->output_options & BARCODE_BOX) != 0) || ((symbol->output_options & BARCODE_BIND) != 0)) {
/* boundary bars */
}
}
addon[r] = '\0';
-
+
if((symbol->show_hrt == 0) || (ustrlen(symbol->text) == 0)) {
plot_text = 0;
+ textdone = 1;
}
if(plot_text) {
textoffset = 9;
}
xoffset = symbol->border_width + symbol->whitespace_width;
yoffset = symbol->border_width;
-
+
/* Start writing the header */
fprintf(feps, "%%!PS-Adobe-3.0 EPSF-3.0\n");
fprintf(feps, "%%%%Creator: Zint %s\n", ZINT_VERSION);
fprintf(feps, "setmatrix\n");
textdone = 1;
switch(strlen(addon)) {
- case 2:
+ case 2:
fprintf(feps, "matrix currentmatrix\n");
fprintf(feps, "/Helvetica findfont\n");
fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
}
i += block_width;
} while (i < 96 + comp_offset);
- textpart[0] = symbol->text[0];
- textpart[1] = '\0';
- fprintf(feps, "TE\n");
- fprintf(feps, "%.2f %.2f %.2f setrgbcolor\n", red_ink, green_ink, blue_ink);
- fprintf(feps, "matrix currentmatrix\n");
- fprintf(feps, "/Helvetica findfont\n");
- fprintf(feps, "%.2f scalefont setfont\n", 8.0 * scaler);
- 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, " (%s) stringwidth\n", textpart);
- fprintf(feps, "pop\n");
- fprintf(feps, "-2 div 0 rmoveto\n");
- fprintf(feps, " (%s) show\n", textpart);
- fprintf(feps, "setmatrix\n");
- for(i = 0; i < 5; i++) {
- textpart[i] = symbol->text[i + 1];
- }
- textpart[5] = '\0';
- fprintf(feps, "matrix currentmatrix\n");
- fprintf(feps, "/Helvetica findfont\n");
- fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
- 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, " (%s) stringwidth\n", textpart);
- fprintf(feps, "pop\n");
- fprintf(feps, "-2 div 0 rmoveto\n");
- fprintf(feps, " (%s) show\n", textpart);
- fprintf(feps, "setmatrix\n");
- for(i = 0; i < 5; i++) {
- textpart[i] = symbol->text[i + 6];
- }
- textpart[6] = '\0';
- fprintf(feps, "matrix currentmatrix\n");
- fprintf(feps, "/Helvetica findfont\n");
- fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
- 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, " (%s) stringwidth\n", textpart);
- fprintf(feps, "pop\n");
- fprintf(feps, "-2 div 0 rmoveto\n");
- fprintf(feps, " (%s) show\n", textpart);
- fprintf(feps, "setmatrix\n");
- textpart[0] = symbol->text[11];
- textpart[1] = '\0';
- fprintf(feps, "matrix currentmatrix\n");
- fprintf(feps, "/Helvetica findfont\n");
- fprintf(feps, "%.2f scalefont setfont\n", 8.0 * scaler);
- 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, " (%s) stringwidth\n", textpart);
- fprintf(feps, "pop\n");
- fprintf(feps, "-2 div 0 rmoveto\n");
- fprintf(feps, " (%s) show\n", textpart);
- fprintf(feps, "setmatrix\n");
- textdone = 1;
- switch(strlen(addon)) {
- case 2:
- fprintf(feps, "matrix currentmatrix\n");
- fprintf(feps, "/Helvetica findfont\n");
- fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
- 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");
- fprintf(feps, "-2 div 0 rmoveto\n");
- fprintf(feps, " (%s) show\n", addon);
- fprintf(feps, "setmatrix\n");
- break;
- case 5:
- fprintf(feps, "matrix currentmatrix\n");
- fprintf(feps, "/Helvetica findfont\n");
- fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
- 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");
- fprintf(feps, "-2 div 0 rmoveto\n");
- fprintf(feps, " (%s) show\n", addon);
- fprintf(feps, "setmatrix\n");
- break;
- }
- }
+ if(plot_text) {
+ textpart[0] = symbol->text[0];
+ textpart[1] = '\0';
+ fprintf(feps, "TE\n");
+ fprintf(feps, "%.2f %.2f %.2f setrgbcolor\n", red_ink, green_ink, blue_ink);
+ fprintf(feps, "matrix currentmatrix\n");
+ fprintf(feps, "/Helvetica findfont\n");
+ fprintf(feps, "%.2f scalefont setfont\n", 8.0 * scaler);
+ 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, " (%s) stringwidth\n", textpart);
+ fprintf(feps, "pop\n");
+ fprintf(feps, "-2 div 0 rmoveto\n");
+ fprintf(feps, " (%s) show\n", textpart);
+ fprintf(feps, "setmatrix\n");
+ for(i = 0; i < 5; i++) {
+ textpart[i] = symbol->text[i + 1];
+ }
+ textpart[5] = '\0';
+ fprintf(feps, "matrix currentmatrix\n");
+ fprintf(feps, "/Helvetica findfont\n");
+ fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
+ 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, " (%s) stringwidth\n", textpart);
+ fprintf(feps, "pop\n");
+ fprintf(feps, "-2 div 0 rmoveto\n");
+ fprintf(feps, " (%s) show\n", textpart);
+ fprintf(feps, "setmatrix\n");
+ for(i = 0; i < 5; i++) {
+ textpart[i] = symbol->text[i + 6];
+ }
+ textpart[6] = '\0';
+ fprintf(feps, "matrix currentmatrix\n");
+ fprintf(feps, "/Helvetica findfont\n");
+ fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
+ 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, " (%s) stringwidth\n", textpart);
+ fprintf(feps, "pop\n");
+ fprintf(feps, "-2 div 0 rmoveto\n");
+ fprintf(feps, " (%s) show\n", textpart);
+ fprintf(feps, "setmatrix\n");
+ textpart[0] = symbol->text[11];
+ textpart[1] = '\0';
+ fprintf(feps, "matrix currentmatrix\n");
+ fprintf(feps, "/Helvetica findfont\n");
+ fprintf(feps, "%.2f scalefont setfont\n", 8.0 * scaler);
+ 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, " (%s) stringwidth\n", textpart);
+ fprintf(feps, "pop\n");
+ fprintf(feps, "-2 div 0 rmoveto\n");
+ fprintf(feps, " (%s) show\n", textpart);
+ fprintf(feps, "setmatrix\n");
+ textdone = 1;
+ switch(strlen(addon)) {
+ case 2:
+ fprintf(feps, "matrix currentmatrix\n");
+ fprintf(feps, "/Helvetica findfont\n");
+ fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
+ 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");
+ fprintf(feps, "-2 div 0 rmoveto\n");
+ fprintf(feps, " (%s) show\n", addon);
+ fprintf(feps, "setmatrix\n");
+ break;
+ case 5:
+ fprintf(feps, "matrix currentmatrix\n");
+ fprintf(feps, "/Helvetica findfont\n");
+ fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
+ 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");
+ fprintf(feps, "-2 div 0 rmoveto\n");
+ fprintf(feps, " (%s) show\n", addon);
+ fprintf(feps, "setmatrix\n");
+ break;
+ }
+ }
+ }
if (((symbol->symbology == BARCODE_UPCE) && (symbol->rows == 1)) || (symbol->symbology == BARCODE_UPCE_CC)) {
/* guard bar extensions and text formatting for UPCE */
fprintf(feps, "TB %.2f %.2f TR\n", (46 + xoffset) * scaler, 1 * scaler);
fprintf(feps, "TB %.2f %.2f TR\n", (48 + xoffset) * scaler, 1 * scaler);
fprintf(feps, "TB %.2f %.2f TR\n", (50 + xoffset) * scaler, 1 * scaler);
- textpart[0] = symbol->text[0];
- textpart[1] = '\0';
- fprintf(feps, "TE\n");
- fprintf(feps, "%.2f %.2f %.2f setrgbcolor\n", red_ink, green_ink, blue_ink);
- fprintf(feps, "matrix currentmatrix\n");
- fprintf(feps, "/Helvetica findfont\n");
- fprintf(feps, "%.2f scalefont setfont\n", 8.0 * scaler);
- 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, " (%s) stringwidth\n", textpart);
- fprintf(feps, "pop\n");
- fprintf(feps, "-2 div 0 rmoveto\n");
- fprintf(feps, " (%s) show\n", textpart);
- fprintf(feps, "setmatrix\n");
- for(i = 0; i < 6; i++) {
- textpart[i] = symbol->text[i + 1];
- }
- textpart[6] = '\0';
- fprintf(feps, "matrix currentmatrix\n");
- fprintf(feps, "/Helvetica findfont\n");
- fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
- 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, " (%s) stringwidth\n", textpart);
- fprintf(feps, "pop\n");
- fprintf(feps, "-2 div 0 rmoveto\n");
- fprintf(feps, " (%s) show\n", textpart);
- fprintf(feps, "setmatrix\n");
- textpart[0] = symbol->text[7];
- textpart[1] = '\0';
- fprintf(feps, "matrix currentmatrix\n");
- fprintf(feps, "/Helvetica findfont\n");
- fprintf(feps, "%.2f scalefont setfont\n", 8.0 * scaler);
- 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, " (%s) stringwidth\n", textpart);
- fprintf(feps, "pop\n");
- fprintf(feps, "-2 div 0 rmoveto\n");
- fprintf(feps, " (%s) show\n", textpart);
- fprintf(feps, "setmatrix\n");
- textdone = 1;
- switch(strlen(addon)) {
- case 2:
- fprintf(feps, "matrix currentmatrix\n");
- fprintf(feps, "/Helvetica findfont\n");
- fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
- 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");
- fprintf(feps, "-2 div 0 rmoveto\n");
- fprintf(feps, " (%s) show\n", addon);
- fprintf(feps, "setmatrix\n");
- break;
- case 5:
- fprintf(feps, "matrix currentmatrix\n");
- fprintf(feps, "/Helvetica findfont\n");
- fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
- 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");
- fprintf(feps, "-2 div 0 rmoveto\n");
- fprintf(feps, " (%s) show\n", addon);
- fprintf(feps, "setmatrix\n");
- break;
+ if(plot_text) {
+ textpart[0] = symbol->text[0];
+ textpart[1] = '\0';
+ fprintf(feps, "TE\n");
+ fprintf(feps, "%.2f %.2f %.2f setrgbcolor\n", red_ink, green_ink, blue_ink);
+ fprintf(feps, "matrix currentmatrix\n");
+ fprintf(feps, "/Helvetica findfont\n");
+ fprintf(feps, "%.2f scalefont setfont\n", 8.0 * scaler);
+ 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, " (%s) stringwidth\n", textpart);
+ fprintf(feps, "pop\n");
+ fprintf(feps, "-2 div 0 rmoveto\n");
+ fprintf(feps, " (%s) show\n", textpart);
+ fprintf(feps, "setmatrix\n");
+ for(i = 0; i < 6; i++) {
+ textpart[i] = symbol->text[i + 1];
+ }
+ textpart[6] = '\0';
+ fprintf(feps, "matrix currentmatrix\n");
+ fprintf(feps, "/Helvetica findfont\n");
+ fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
+ 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, " (%s) stringwidth\n", textpart);
+ fprintf(feps, "pop\n");
+ fprintf(feps, "-2 div 0 rmoveto\n");
+ fprintf(feps, " (%s) show\n", textpart);
+ fprintf(feps, "setmatrix\n");
+ textpart[0] = symbol->text[7];
+ textpart[1] = '\0';
+ fprintf(feps, "matrix currentmatrix\n");
+ fprintf(feps, "/Helvetica findfont\n");
+ fprintf(feps, "%.2f scalefont setfont\n", 8.0 * scaler);
+ 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, " (%s) stringwidth\n", textpart);
+ fprintf(feps, "pop\n");
+ fprintf(feps, "-2 div 0 rmoveto\n");
+ fprintf(feps, " (%s) show\n", textpart);
+ fprintf(feps, "setmatrix\n");
+ textdone = 1;
+ switch(strlen(addon)) {
+ case 2:
+ fprintf(feps, "matrix currentmatrix\n");
+ fprintf(feps, "/Helvetica findfont\n");
+ fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
+ 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");
+ fprintf(feps, "-2 div 0 rmoveto\n");
+ fprintf(feps, " (%s) show\n", addon);
+ fprintf(feps, "setmatrix\n");
+ break;
+ case 5:
+ fprintf(feps, "matrix currentmatrix\n");
+ fprintf(feps, "/Helvetica findfont\n");
+ fprintf(feps, "%.2f scalefont setfont\n", 11.0 * scaler);
+ 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");
+ fprintf(feps, "-2 div 0 rmoveto\n");
+ fprintf(feps, " (%s) show\n", addon);
+ fprintf(feps, "setmatrix\n");
+ break;
+ }
}
}