/*
* "$Id: texttops.c 7720 2008-07-11 22:46:21Z mike $"
*
- * Text to PostScript filter for the Common UNIX Printing System (CUPS).
+ * Text to PostScript filter for CUPS.
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2010 by Apple Inc.
* Copyright 1993-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
*/
#include "textcommon.h"
-#include <cups/i18n.h>
+#include <cups/language-private.h>
/*
if (SizeColumns <= 0 || SizeColumns > 32767 ||
SizeLines <= 0 || SizeLines > 32767)
{
- _cupsLangPrintf(stderr, _("ERROR: Unable to print %dx%d text page\n"),
- SizeColumns, SizeLines);
+ _cupsLangPrintFilter(stderr, "ERROR",
+ _("Unable to print %dx%d text page."),
+ SizeColumns, SizeLines);
+ exit(1);
+ }
+
+ if ((Page = calloc(sizeof(lchar_t *), SizeLines)) == NULL)
+ {
+ _cupsLangPrintFilter(stderr, "ERROR",
+ _("Unable to print %dx%d text page."),
+ SizeColumns, SizeLines);
+ exit(1);
+ }
+
+ if ((Page[0] = calloc(sizeof(lchar_t), SizeColumns * SizeLines)) == NULL)
+ {
+ _cupsLangPrintFilter(stderr, "ERROR",
+ _("Unable to print %dx%d text page."),
+ SizeColumns, SizeLines);
exit(1);
}
- Page = calloc(sizeof(lchar_t *), SizeLines);
- Page[0] = calloc(sizeof(lchar_t), SizeColumns * SizeLines);
for (i = 1; i < SizeLines; i ++)
Page[i] = Page[0] + i * SizeColumns;
if (ColumnWidth <= 0)
{
- _cupsLangPrintf(stderr, _("ERROR: Unable to print %d text columns\n"),
- PageColumns);
+ _cupsLangPrintFilter(stderr, "ERROR",
+ _("Unable to print %d text columns."), PageColumns);
exit(1);
}
}
else
{
- fprintf(stderr, _("ERROR: Unable to open \"%s\" - %s\n"), filename,
- strerror(errno));
+ _cupsLangPrintError("ERROR", _("Unable to open psglyphs"));
exit(1);
}
* Can't open charset file!
*/
- fprintf(stderr, _("ERROR: Unable to open %s: %s\n"), filename,
- strerror(errno));
+ _cupsLangPrintError("ERROR", _("Unable to open charset file"));
exit(1);
}
*/
fclose(fp);
- fprintf(stderr, _("ERROR: Bad charset file %s\n"), filename);
+ _cupsLangPrintFilter(stderr, "ERROR", _("Bad charset file \"%s\"."),
+ filename);
exit(1);
}
*/
fclose(fp);
- fprintf(stderr, _("ERROR: Bad charset file %s\n"), filename);
+ _cupsLangPrintFilter(stderr, "ERROR", _("Bad charset file \"%s\"."),
+ filename);
exit(1);
}
* Can't have a font without all required values...
*/
- fprintf(stderr, _("ERROR: Bad font description line: %s\n"), valptr);
+ _cupsLangPrintFilter(stderr, "ERROR",
+ _("Bad font description line: %s"), valptr);
fclose(fp);
exit(1);
}
Directions[NumFonts] = -1;
else
{
- fprintf(stderr, _("ERROR: Bad text direction %s\n"), valptr);
+ _cupsLangPrintFilter(stderr, "ERROR", _("Bad text direction: %s"),
+ valptr);
fclose(fp);
exit(1);
}
* Can't have a font without all required values...
*/
- fprintf(stderr, _("ERROR: Bad font description line: %s\n"), valptr);
+ _cupsLangPrintFilter(stderr, "ERROR",
+ _("Bad font description line: %s"), valptr);
fclose(fp);
exit(1);
}
Widths[NumFonts] = 2;
else
{
- fprintf(stderr, _("ERROR: Bad text width %s\n"), valptr);
+ _cupsLangPrintFilter(stderr, "ERROR",
+ _("Bad text width: %s"), valptr);
fclose(fp);
exit(1);
}
}
else
{
- fprintf(stderr, _("ERROR: Bad charset type %s\n"), lineptr);
+ _cupsLangPrintFilter(stderr, "ERROR", _("Bad charset type: %s"), lineptr);
fclose(fp);
exit(1);
}