Re: [Gnome-print] [PATCH] use "." as fraction separator independentlyof locale settings



On Sat, 10 Mar 2001, Chema Celorio wrote:

 Hi, 

> The patch looks, but why do we want to switch between locales every time
> gnome_print_pdf_write is called. Is there a reason not to switch locales
> at the beginning of the printing and then set it back when we are done 
> (or when an error is encountered) ?

 Hmm, I don't know about gnome-print architecture - if .pdf begins
being generated ONLY when the printer context is closed (i.e. the .pdf is
generated from metafile), then it's OK to switch locale to the required one
right before starting .pdf generation and after it's finished return to the
original locale. But if .pdf content is being generated WHILE context is
opened (i.e. if on each drawing operation corresponding .pdf output is
produced) then the only solution is to set locale before each fprintf and
restore after that fprintf (as implemented in the patch).

 gnome_print_context_fprintf also sets/unsets LC_NUMERIC for each fprintf
inside it - that's why I though it's OK to do the same in pdf generator code.
 
> The real solution to this is to have a set of g_strdup's function
> that will use numeric locale all the time. 

 Sorry, I don't understand what you mean by this..
 
> regards,
> Chema
> 
> Vlad Harchev wrote:
> > 
> >  Hi,
> > 
> >  Here is a patch against 0.25 that forces pdf generator to use "." as fraction
> > seprarator, independant of the locale's settings (e.g., under russian locales
> > fraction separator is comma). Of course, .pdf that use anything but dot as
> > fraction seprator can't be opened by any .pdf reader out there.
> > 
> >  It would be nice if this patch went into gnome-print shipped with
> > gnome-1.4 - what do you think?
> > 
> >  Best regards,
> >   -Vlad
> > 
> >   ------------------------------------------------------------------------
> >                                Name: gnome-print-pdf-i18n-fix
> >    gnome-print-pdf-i18n-fix    Type: Plain Text (TEXT/PLAIN)
> >                            Encoding: BASE64
> 

 Best regards,
  -Vlad





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]