Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lua-oocairo-scaledfont(3) [debian man page]

doc::lua-oocairo-scaledfont(3)				       Lua OO Cairo binding				    doc::lua-oocairo-scaledfont(3)

Name
       lua-oocairo-scaledfont - Scaled font face object

Introduction
       Scaled font objects represent Cairo font faces which have been scaled to a particular point size.  They can be created from a font face
       object with the "scaled_font_create" function in the main module table (see lua-oocairo(3)), or the "get_scaled_font" method on context
       objects (see lua-oocairo-context(3)).

       Scaled font objects can be compared with the "==" operator.  This will compare the identity of the objects, so different Lua objects which
       refer to the same "cairo_font_face_t" will compare as equal.

Methods
       Scaled font objects provide the following methods.

       font:extents ()
	   Returns a table containing metrics information about the font.  The return value is in the same format as that of the "font_extents"
	   method on context objects (see lua-oocairo-context(3)).

       font:get_ctm ()
	   Returns the coordinate transformation matrix (CTM) associated with the font.  This maps user coordinates into device coordinates on the
	   surface with which the font is used.  See lua-oocairo-matrix(3) for details of the return value type.

       font:get_font_face ()
	   Returns an object representing the unscaled font face used to create this font.  See lua-oocairo-fontface(3) for details of its
	   methods.

       font:get_font_matrix ()
	   Returns the matrix representing the scaling of the font into user coordinates.  See lua-oocairo-matrix(3) for details of the return
	   value type.

       cr:get_font_options ()
	   Returns a font options object (see lua-oocairo-fontopt(3)) containing the rendering options that were supplied when creating this font.

       font:get_scale_matrix ()
	   Returns a matrix table representing the scaling of the font to the coordinate space of the surface it is used on.  This is the matrix
	   obtained by multiplying the font matrix by the surface CTM.	See lua-oocairo-matrix(3) for details of the return value type.  Only
	   available with Cairo 1.8 or better.

       font:get_type ()
	   Returns a string indicating which back-end library provides the font face information.  The return value will be one of the same
	   strings returned by the "get_type" method on a font face object (see lua-oocairo-fontface(3)).

       font:glyph_extents (glyphs)
	   Same as "font:text_extents()", but instead of a string, the glyphs value should be table in the format accepted by the "show_glyphs()"
	   method on context objects (see lua-oocairo-context(3)).

       font:text_extents (text)
	   Returns a table containing measurements of the given UTF-8 text as it would be rendered in this font.  The return value is in the same
	   format as that of the "text_extents" method on context objects (see lua-oocairo-context(3)).

       font:text_to_glyphs (x, y, text)
	   Given some UTF-8 text in the string text, and starting coordinates of x and y, this works out which glyphs need to be drawn to
	   represent the text, and which glyphs correspond to the bytes in text.  The method returns two tables, the first an array of glyphs
	   suitable for supplying to methods like "show_glyphs" and "glyph_extents", and the second is a table of text clusters suitable for
	   supplying to the "show_text_glyphs" method on a context object.

	   Only available with Cairo 1.8 or better.

1.4								    2011-05-18					    doc::lua-oocairo-scaledfont(3)

Check Out this Related Man Page

doc::lua-oocairo-fontopt(3)				       Lua OO Cairo binding				       doc::lua-oocairo-fontopt(3)

Name
       lua-oocairo-fontopt - options controlling text rendering

Introduction
       A font options object contains options that tell Cairo how to render text on surfaces.  They can be created with the "font_options_create"
       function in the main oocairo module (see lua-oocairo(3)), and retrieved from scaled fonts or context objects with "get_font_options"
       methods.

       Font options objects can be compared with the "==" operator.  Two different objects with the same options set will be considered equal.

Methods
       The following methods are available on font options objects:

       opt:copy ()
	   Returns a new font options object, with identical options to opt.  The two objects will be completely independent, so you can set them
	   to have different options.

       opt:get_antialias ()
	   Get the current antialiasing mode, which will be one of the strings accepted by the "opt:set_antialias()" method.

       opt:get_hint_metrics ()
	   Returns the current hint metrics option, which will be one of the same strings accepted by the "opt:set_hint_metrics()" method.

       opt:get_hint_style ()
	   Get the kind of font hinting done when rendering text.  Returns one of the strings accepted by the "opt:set_hint_style()" method.

       opt:get_subpixel_order ()
	   Returns the current ordering of colour components in pixels used for subpixel rendering, which will be one of the same strings accepted
	   by the "opt:set_subpixel_order()" method.

       opt:hash ()
	   Return a number which can be used as a hash key identifying the particular options in opt.  That is, if you wanted to cache fonts
	   according to the options set on them, you could store them in a table with this hash value as the key.  Two font options objects with
	   the same options will have the same hash value.

       opt:merge (srcopt)
	   Add any options which are set to a non-default value in srcopt to opt if that still has the default value from them.  The options in
	   srcopt will be unchanged.  Nothing is returned.

       opt:set_antialias (antialiastype)
	   Set the antialiasing mode used for drawing.	The argument must be a string or boolean value accepted by the "set_antialias" method on
	   context objects (see lua-oocairo-context(3)).

       opt:set_hint_metrics (hintmetrics)
	   Set the kind of hinting to be applied to the metrics, as opposed to outlines, of the glyphs in a font.  The hintmetrics value must be
	   one of the following strings:

	   default
	   off
	   on
       opt:set_hint_style (hintstyle)
	   Set the kind of font hinting done when rendering text.  The hintstyle value must be one of the following strings:

	   default
	   none
	   slight
	   medium
	   full
       opt:set_subpixel_order (order)
	   Used to inform Cairo of the arrangement of colour components in the pixels of a display device like a monitor.  Only applies if
	   subpixel antialiasing is used.  The order value must be one of the following strings:

	   default
	   rgb
	   bgr
	   vrgb
	   vbgr

	   The last two options refer to vertical arrangements of colours.

1.4								    2011-05-18					       doc::lua-oocairo-fontopt(3)
Man Page