A Sex, 2004-03-05 às 04:34, Alex Roitman escreveu:
> Hello,
> 
> I have a few questions about gnomeprint. Some of them are not specific to
> python bindings, but in case anybody on this list knows the answer I would 
> greatly appreciate any help.
> 
> 1. How do I set the paper size for a job? I know that it can be later
> selected from the menu, but I would like to set it to the specified
> size before the job is laid out. Right now I have this:
> 
>     job = gnomeprint.Job(gnomeprint.config_default())
>     pc = job.get_context()
> 
> I also read Pier Carteri's mail with the snippet using config.to_string()
> and config.from_string() which would involve using file or on-the-fly
> assembled XML. Is there any other method for setting the page size?
> Something like config.set("PAGE_SIZE","US-Letter") ?

  Close enough.  I think this works, but am not sure:

        config.set(gnomeprint.KEY_PAPER_SIZE, "my-paper-size")


Because KEY_PAPER_SIZE = 'Settings.Output.Media.PhysicalSize'

But I'm not sure about which are the valid paper size strings. Perhaps
"US-Letter" works, or perhaps it's just "letter", I don't know.  But
judging from this,
------
[GPAOptions]                        [GPAKeys]
PhysicalSize=A4,A5,USLetter,USLegal  PhysicalSize = A4
LogicalOrientation=R0,R90,R180,R270  LogicalOrientation = R90 
------
the paper size string should be USLetter.

> 
> 2. How do I find the proper line spacing for the font? I can see
> get_ascender() and get_descender() methods of gnomeprint.Font()
> as well as properties like XHeight and CapHeight. Is there any specific
> property for a correct spacing?

  I think you should use get_size() for this.

> 
> 3. Along the same line, what would be a proper superscript size/elevation
> for a given font? I seem to like size two points smaller than the
> regular text's font and the elevation of 1/4 of the line spacing,
> but I'm sure there are well established standards. What are they?

  AFAIK, there are no such standards. :)

> 
> 4. What font does one use to print non-latin characters? I thought that
> Sans, Serif, and Monospace are the ones that are guaranteed to exist
> on gnome desktop, but none of them can print e.g. cyrillic. I can print
> cyrillic with Times New Roman, but there's no guarantee that each user
> will have this font installed. Any advice on "standard" solution?

  Sorry, but I can't offer much advice on this.  If the user doesn't
have the proper font, there isn't much you can do.  Also take a look at
this comment in example_04.py:
    # Get this font from:
    #   http://bibliofile.mc.duke.edu/gww/fonts/Unicode.html
    # I used the TTF Caslon Roman.


> 
> I apologize if the above questions are too silly, but I just can't find 
> good answers.
> 
> Thanks for any help,
> Alex

  Regards.

-- 
Gustavo João Alves Marques Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
The universe is always one step beyond logic.

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to