Support for named paper sizes
GtkPaperSize handles paper sizes. It uses the standard called "PWG 5101.1-2002 PWG: Standard for Media Standardized Names" to name the paper sizes (and to get the data for the page sizes). In addition to standard paper sizes, GtkPaperSize allows to construct custom paper sizes with arbitrary dimensions.
The <gtk-paper-size>
object stores not only the dimensions (width and
height) of a paper size and its name, it also provides default print margins.
Printing support has been added in GTK+ 2.10.
mchars
) ⇒ (ret <gtk-paper-size>
)Creates a new
<gtk-paper-size>
object by parsing a PWG 5101.1-2002 PWG paper name.If name is ‘
#f
’, the default paper size is returned, seegtk-paper-size-get-default
.
- name
- a paper size name, or ‘
#f
’- ret
- a new
<gtk-paper-size>
, usegtk-paper-size-free
to free itSince 2.10
mchars
) (ppd_display_name mchars
) (width double
) (height double
) ⇒ (ret <gtk-paper-size>
)Creates a new
<gtk-paper-size>
object by using PPD information.If ppd-name is not a recognized PPD paper name, ppd-display-name, width and height are used to construct a custom
<gtk-paper-size>
object.
- ppd-name
- a PPD paper name
- ppd-display-name
- the corresponding human-readable name
- width
- the paper width, in points
- height
- the paper height in points
- ret
- a new
<gtk-paper-size>
, usegtk-paper-size-free
to free itSince 2.10
mchars
) (display_name mchars
) (width double
) (height double
) (unit <gtk-unit>
) ⇒ (ret <gtk-paper-size>
)Creates a new
<gtk-paper-size>
object with the given parameters.
- name
- the paper name
- display-name
- the human-readable name
- width
- the paper width, in units of unit
- height
- the paper height, in units of unit
- unit
- the unit for width and height
- ret
- a new
<gtk-paper-size>
object, usegtk-paper-size-free
to free itSince 2.10
<gtk-paper-size>
) (size2 <gtk-paper-size>
) ⇒ (ret bool
)Compares two
<gtk-paper-size>
objects.
- size1
- a
<gtk-paper-size>
object- size2
- another
<gtk-paper-size>
object- ret
- ‘
#t
’, if size1 and size2 represent the same paper sizeSince 2.10
<gtk-paper-size>
) ⇒ (ret mchars
)Gets the name of the
<gtk-paper-size>
.
- size
- a
<gtk-paper-size>
object- ret
- the name of size
Since 2.10
<gtk-paper-size>
) ⇒ (ret mchars
)Gets the human-readable name of the
<gtk-paper-size>
.
- size
- a
<gtk-paper-size>
object- ret
- the human-readable name of size
Since 2.10
<gtk-paper-size>
) ⇒ (ret mchars
)Gets the PPD name of the
<gtk-paper-size>
, which may be ‘#f
’.
- size
- a
<gtk-paper-size>
object- ret
- the PPD name of size
Since 2.10
<gtk-paper-size>
) (unit <gtk-unit>
) ⇒ (ret double
)Gets the paper width of the
<gtk-paper-size>
, in units of unit.
- size
- a
<gtk-paper-size>
object- unit
- the unit for the return value
- ret
- the paper width
Since 2.10
<gtk-paper-size>
) (unit <gtk-unit>
) ⇒ (ret double
)Gets the paper height of the
<gtk-paper-size>
, in units of unit.
- size
- a
<gtk-paper-size>
object- unit
- the unit for the return value
- ret
- the paper height
Since 2.10
<gtk-paper-size>
) ⇒ (ret bool
)Returns ‘
#t
’ if size is not a standard paper size.
- size
- a
<gtk-paper-size>
object- ret
- whether size is a custom paper size.
<gtk-paper-size>
) (width double
) (height double
) (unit <gtk-unit>
)Changes the dimensions of a size to width x height.
- size
- a custom
<gtk-paper-size>
object- width
- the new width in units of unit
- height
- the new height in units of unit
- unit
- the unit for width and height
Since 2.10