Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texttops generates incorrect PostScript #970

Closed
michaelrsweet opened this issue Oct 20, 2004 · 4 comments
Closed

texttops generates incorrect PostScript #970

michaelrsweet opened this issue Oct 20, 2004 · 4 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.1.22rc1
CUPS.org User: twaugh.redhat

Original bug report:

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=136102

echo '*PPD-Adobe: "4.3"' > /tmp/file.ppd
env - LANG=sv_SE.utf8 "PPD=/tmp/file.ppd"
/usr/lib/cups/filter/texttops 120 g issue 1 "" /dev/null 2>&1 |
grep findfont

gives output like this:

/Courier-Bold findfont
/Courier findfont
/FN /cupsNormal findfont [12,000 0 0 11,333 0 0] makefont def
/FB /cupsBold findfont [12,000 0 0 11,333 0 0] makefont def

The decimal separator ',' is used instead of '.'.

This is due to cupsLangGet (from ppdOpen) setting LC_ALL. Arguably it should not set the locale at all. This change seems sufficient though (see attached).

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Please try the attached patch instead, as we shouldn't be setting the full locale in a CUPS function if we don't have to... :)

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in CVS - the anonymous CVS repository will be updated at midnight EST.

@michaelrsweet
Copy link
Collaborator Author

"cups-numeric.patch":

--- cups-1.1.22rc1/cups/ppd.c.numeric 2004-10-20 16:01:36.130273770 +0100
+++ cups-1.1.22rc1/cups/ppd.c 2004-10-20 16:03:36.916432733 +0100
@@ -487,12 +487,18 @@

  • Get the default language for the user...
    */

+#ifdef LC_NUMERIC

  • oldlocale = _cupsSaveLocale(LC_NUMERIC, NULL);
    +#else
  • oldlocale = _cupsSaveLocale(LC_ALL, NULL);
    +#endif /* LC_NUMERIC */

language = cupsLangDefault();

#ifdef LC_NUMERIC

  • oldlocale = _cupsSaveLocale(LC_NUMERIC, "C");
  • _cupsSaveLocale(LC_NUMERIC, "C");
    #else
  • oldlocale = _cupsSaveLocale(LC_ALL, "C");
  • _cupsSaveLocale(LC_ALL, "C");
    #endif /* LC_NUMERIC */

/*

@michaelrsweet
Copy link
Collaborator Author

"str970.patch":

Index: language.c

RCS file: /development/cvs/cups/cups/language.c,v
retrieving revision 1.51
diff -u -r1.51 language.c
--- language.c 19 Aug 2004 13:54:38 -0000 1.51
+++ language.c 20 Oct 2004 15:25:54 -0000
@@ -267,7 +267,14 @@
ptr ? ptr : "(null)"));

 if (!ptr || !strcmp(ptr, "C") || !strcmp(ptr, "POSIX"))

+# ifdef LC_MESSAGES

  • {
  •  ptr = setlocale(LC_MESSAGES, "");
    
  •  setlocale(LC_CTYPE, "");
    
  • }
    +# else
    ptr = setlocale(LC_ALL, "");
    +# endif /* LC_MESSAGES */

if (ptr)
{

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant