Module Cairo_pango
Interaction with Pango, a library for laying out and rendering of text.
module Font_map : sig ... endInteracting with
Pango.font_map.
type cairo_font= [ `pangofont | `cairo ] Gobject.obj
val get_scaled_font : cairo_font -> _ Cairo.Scaled_font.tval set_resolution : Pango.context -> float -> unitSets the resolution for the context. This is a scale factor between points specified in a
Pango.font_descriptionand Cairo units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3).
val get_resolution : Pango.context -> floatGets the resolution for the context.
val set_font_options : Pango.context -> Cairo.Font_options.t -> unitset_font_options cr optionssets the font options used when rendering text withcr. These options override any options thatupdate_contextderives from the target surface.
val get_font_options : Pango.context -> Cairo.Font_options.tRetrieves any font rendering options previously set with
set_font_options. This function does not report options that are derived from the target surface byupdate_context.
val create_context : Cairo.context -> Pango.contextCreates a context object set up to match the current transformation and target surface of the Cairo context. This context can then be used to create a layout using
Pango.Layout.create.
val update_context : Cairo.context -> Pango.context -> unitUpdates a
Pango.contextpreviously created for use with Cairo to match the current transformation and target surface of a Cairo context. If any layouts have been created for the context, it's necessary to callcontext_changedon those layouts.
val create_layout : Cairo.context -> Pango.layoutcreate_layout crcreates a layout object set up to match the current transformation and target surface of the Cairo contextÂcr. This layout can then be used for text measurement with functions likePango.Layout.get_sizeor drawing with functions likeshow_layout. If you change the transformation or target surface forcr, you need to callupdate_layout.
val update_layout : Cairo.context -> Pango.layout -> unitupdate_layout cr layoutupdates the privatePango.contextoflayoutcreated withcreate_layoutto match the current transformation and target surface of a Cairo contextcr.
val show_layout : Cairo.context -> Pango.layout -> unitshow_layout cr layoutdraws alayoutin the specified cairo contextcr. The top-left corner oflayoutwill be drawn at the current point of the cairo context.
val show_error_underline : Cairo.context -> float -> float -> w:float -> h:float -> unitshow_error_underline cr x y w hdraw a squiggly line in the cairo contextcrthat approximately covers the given rectangle in the style of an underline used to indicate a spelling error. (The widthwof the underline is rounded to an integer number of up/down segments and the resulting rectangle is centered in the original rectangle).
val layout_path : Cairo.context -> Pango.layout -> unitlayout_path cr layoutadds the text in alayoutto the current path incr. The top-left corner of thelayoutwill be at the current point of the cairo context.
val error_underline_path : Cairo.context -> float -> float -> w:float -> h:float -> uniterror_underline_path cr x y w hadd a squiggly line to the current path in the cairo contextcrthat approximately covers the given rectangle in the style of an underline used to indicate a spelling error. (The widthwof the underline is rounded to an integer number of up/down segments and the resulting rectangle is centered in the original rectangle).