/*
- * "$Id: texttops.c 4680 2005-09-21 09:28:39Z mike $"
+ * "$Id: texttops.c 7720 2008-07-11 22:46:21Z mike $"
*
* Text to PostScript filter for the Common UNIX Printing System (CUPS).
*
- * Copyright 1993-2005 by Easy Software Products.
+ * Copyright 2007-2008 by Apple Inc.
+ * Copyright 1993-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
- * property of Easy Software Products and are protected by Federal
- * copyright law. Distribution and use rights are outlined in the file
- * "LICENSE.txt" which should have been included with this file. If this
- * file is missing or damaged please contact Easy Software Products
- * at:
- *
- * Attn: CUPS Licensing Information
- * Easy Software Products
- * 44141 Airport View Drive, Suite 204
- * Hollywood, Maryland 20636 USA
- *
- * Voice: (301) 373-9600
- * EMail: cups-info@cups.org
- * WWW: http://www.cups.org
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file. If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
*/
#include "textcommon.h"
+#include <cups/i18n.h>
/*
printf("%%cupsRotation: %d\n", (Orientation & 3) * 90);
puts("%%Creator: texttops/" CUPS_SVERSION);
printf("%%%%CreationDate: %s\n", curdate);
- printf("%%%%Title: %s\n", title);
- printf("%%%%For: %s\n", user);
+ WriteTextComment("Title", title);
+ WriteTextComment("For", user);
puts("%%Pages: (atend)");
/*
}
else
{
- fprintf(stderr, "ERROR: Unable to open \"%s\" - %s\n", filename,
+ fprintf(stderr, _("ERROR: Unable to open \"%s\" - %s\n"), filename,
strerror(errno));
exit(1);
}
* Can't open charset file!
*/
- fprintf(stderr, "ERROR: Unable to open %s: %s\n", filename,
+ fprintf(stderr, _("ERROR: Unable to open %s: %s\n"), filename,
strerror(errno));
exit(1);
}
*/
fclose(fp);
- fprintf(stderr, "ERROR: Bad/empty charset file %s\n", filename);
+ fprintf(stderr, _("ERROR: Bad charset file %s\n"), filename);
exit(1);
}
*/
fclose(fp);
- fprintf(stderr, "ERROR: Bad charset file %s\n", filename);
+ fprintf(stderr, _("ERROR: Bad charset file %s\n"), filename);
exit(1);
}
* Can't have a font without all required values...
*/
- fprintf(stderr, "ERROR: bad font description line: %s\n", valptr);
+ fprintf(stderr, _("ERROR: Bad font description line: %s\n"), valptr);
fclose(fp);
exit(1);
}
Directions[NumFonts] = -1;
else
{
- fprintf(stderr, "ERROR: Bad text direction %s\n", valptr);
+ fprintf(stderr, _("ERROR: Bad text direction %s\n"), valptr);
fclose(fp);
exit(1);
}
* Can't have a font without all required values...
*/
- fprintf(stderr, "ERROR: bad font description line: %s\n", valptr);
+ fprintf(stderr, _("ERROR: Bad font description line: %s\n"), valptr);
fclose(fp);
exit(1);
}
Widths[NumFonts] = 2;
else
{
- fprintf(stderr, "ERROR: Bad text width %s\n", valptr);
+ fprintf(stderr, _("ERROR: Bad text width %s\n"), valptr);
fclose(fp);
exit(1);
}
* Can't have a font without all required values...
*/
- fprintf(stderr, "ERROR: bad font description line: %s\n", valptr);
+ fprintf(stderr, _("ERROR: Bad font description line: %s\n"), valptr);
fclose(fp);
exit(1);
}
Directions[NumFonts] = -1;
else
{
- fprintf(stderr, "ERROR: Bad text direction %s\n", valptr);
+ fprintf(stderr, _("ERROR: Bad text direction %s\n"), valptr);
fclose(fp);
exit(1);
}
* Can't have a font without all required values...
*/
- fprintf(stderr, "ERROR: bad font description line: %s\n", valptr);
+ fprintf(stderr, _("ERROR: Bad font description line: %s\n"), valptr);
fclose(fp);
exit(1);
}
Widths[NumFonts] = 2;
else
{
- fprintf(stderr, "ERROR: Bad text width %s\n", valptr);
+ fprintf(stderr, _("ERROR: Bad text width %s\n"), valptr);
fclose(fp);
exit(1);
}
}
else
{
- fprintf(stderr, "ERROR: Bad charset type %s\n", lineptr);
+ fprintf(stderr, _("ERROR: Bad charset type %s\n"), lineptr);
fclose(fp);
exit(1);
}
puts("% Reencode base fonts");
- for (i = 1 + PrettyPrint; i >= 0; i --)
+ for (i = PrettyPrint ? 2 : 1; i >= 0; i --)
for (j = 0; j < NumFonts; j ++)
{
printf("/%s findfont\n", Fonts[j][i]);
puts("% Create composite fonts...");
- for (i = 1 + PrettyPrint; i >= 0; i --)
+ for (i = PrettyPrint ? 2 : 1; i >= 0; i --)
{
puts("8 dict begin");
puts("/FontType 0 def/FontMatrix[1.0 0 0 1.0 0 0]def/FMapType 2 def/Encoding[");
lchar_t *start; /* First character in sequence */
- for (col = 0, start = line; col < SizeColumns;)
+ for (col = 0; col < SizeColumns;)
{
while (col < SizeColumns && (line->ch == ' ' || line->ch == 0))
{
/*
- * End of "$Id: texttops.c 4680 2005-09-21 09:28:39Z mike $".
+ * End of "$Id: texttops.c 7720 2008-07-11 22:46:21Z mike $".
*/