-
public Attribute attr_background_new (uint16 red, uint16 green, uint16 blue)
Create a new background color attribute.
-
public Attribute attr_fallback_new (bool enable_fallback)
Create a new font fallback attribute.
-
public Attribute attr_family_new (string family)
Create a new font family attribute.
-
public Attribute attr_foreground_new (uint16 red, uint16 green, uint16 blue)
Create a new foreground color attribute.
-
public Attribute attr_gravity_hint_new (GravityHint hint)
Create a new gravity hint attribute.
-
public Attribute attr_gravity_new (Gravity gravity)
Create a new gravity attribute.
-
public Attribute attr_letter_spacing_new (int letter_spacing)
Create a new letter-spacing attribute.
-
public Attribute attr_rise_new (int rise)
Create a new baseline displacement attribute.
-
public Attribute attr_scale_new (double scale_factor)
Create a new font size scale attribute. The base font for the affected text will have its size
multiplied by scale_factor.
-
public Attribute attr_stretch_new (Stretch stretch)
Create a new font stretch attribute
-
public Attribute attr_strikethrough_color_new (uint16 red, uint16 green, uint16 blue)
Create a new strikethrough color attribute. This attribute modifies the color of strikethrough lines. If
not set, strikethrough lines will use the foreground color.
-
public Attribute attr_strikethrough_new (bool strikethrough)
Create a new strike-through attribute.
-
public Attribute attr_style_new (Style style)
Create a new font slant style attribute.
-
public unowned string attr_type_get_name (AttrType type)
Fetches the attribute type name passed in when registering the type using
attr_type_register.
-
public AttrType attr_type_register (string name)
Allocate a new attribute type ID. The attribute type name can be accessed later by using
attr_type_get_name.
-
public Attribute attr_underline_color_new (uint16 red, uint16 green, uint16 blue)
Create a new underline color attribute. This attribute modifies the color of underlines. If not set,
underlines will use the foreground color.
-
public Attribute attr_underline_new (Underline underline)
Create a new underline-style attribute.
-
public Attribute attr_variant_new (Variant variant)
Create a new font variant attribute (normal or small caps)
-
public Attribute attr_weight_new (Weight weight)
Create a new font weight attribute.
-
public BidiType bidi_type_for_unichar (unichar ch)
Determines the normative bidirectional character type of a character, as specified in the Unicode
Character Database.
-
public void break (string text, int length, Analysis analysis, LogAttr[] attrs, int attrs_len)
Determines possible line, word, and character breaks for a string of Unicode text with a single
analysis. For most purposes you may want to use get_log_attrs.
-
public void extents_to_pixels (ref Rectangle inclusive, ref Rectangle nearest)
Converts extents from Pango units to device units, dividing by the
SCALE factor and performing rounding.
-
public Direction find_base_dir (string text, int length)
Searches a string the first character that has a strong direction, according to the Unicode
bidirectional algorithm.
-
public void find_paragraph_boundary (string text, int length, out int paragraph_delimiter_index, out int next_paragraph_start)
Locates a paragraph boundary in text. A boundary is caused by delimiter characters, such as
a newline, carriage return, carriage return-newline pair, or Unicode paragraph separator character. The index of the run of delimiters
is returned in paragraph_delimiter_index. The index of the start of the paragraph (index after all delimiters) is stored
in next_paragraph_start.
-
public void get_log_attrs (string text, int length, int level, Language language, LogAttr[] log_attrs)
Computes a LogAttr for each character in text
. The log_attrs array must have one LogAttr for each position in
text; if text contains N characters, it has N+1 positions, including the last position at the end of the
text. text should be an entire paragraph; logical attributes can't be computed without context (for example you need to
see spaces on either side of a word to know the word is a word).
-
public Gravity gravity_get_for_matrix (Matrix matrix)
Finds the gravity that best matches the rotation component in a
Matrix.
-
public Gravity gravity_get_for_script (Script script, Gravity base_gravity, GravityHint hint)
Based on the script, base gravity, and hint, returns actual gravity to use in laying out a single
Item.
-
public Gravity gravity_get_for_script_and_width (Script script, bool wide, Gravity base_gravity, GravityHint hint)
-
public double gravity_to_rotation (Gravity gravity)
Converts a Gravity value to its natural rotation in
radians. gravity should not be AUTO.
-
public bool is_zero_width (unichar ch)
Checks ch to see if it is a character that should not be normally rendered on the screen.
This includes all Unicode characters with "ZERO WIDTH" in their name, as well as bidi formatting characters, and a few other
ones. This is totally different from iszerowidth and is at best
misnamed.
-
public unowned List itemize (Context context, string text, int start_index, int length, AttrList attrs, AttrIterator cached_iter)
Breaks a piece of text into segments with consistent directional level and shaping engine. Each byte of
text will be contained in exactly one of the items in the returned list; the generated list of items will be in logical
order (the start offsets of the items are ascending).
-
public unowned List itemize_with_base_dir (Context context, Direction base_dir, string text, int start_index, int length, AttrList attrs, AttrIterator cached_iter)
Like itemize, but the base direction to use when
computing bidirectional levels (see set_base_dir), is specified
explicitly rather than gotten from the Context.
-
public uchar log2vis_get_embedding_levels (string text, int length, Direction pbase_dir)
This will return the bidirectional embedding levels of the input paragraph as defined by the Unicode
Bidirectional Algorithm available at:
-
public bool parse_enum (Type type, string? str, out int value, bool warn, out string possible_values)
Parses an enum type and stores the result in value.
-
public bool parse_markup (string markup_text, int length, unichar accel_marker, out AttrList attr_list, out string text, out unichar accel_char) throws Error
Parses marked-up text (see markup format) to create a plain-text string
and an attribute list.
-
public bool parse_stretch (string str, out Stretch stretch, bool warn)
Parses a font stretch. The allowed values are "ultra_condensed", "extra_condensed", "condensed",
"semi_condensed", "normal", "semi_expanded", "expanded", "extra_expanded" and "ultra_expanded". Case variations are ignored and the
'_' characters may be omitted.
-
public bool parse_style (string str, out Style style, bool warn)
Parses a font style. The allowed values are "normal", "italic" and "oblique", case variations being
ignored.
-
public bool parse_variant (string str, out Variant variant, bool warn)
Parses a font variant. The allowed values are "normal" and "smallcaps" or "small_caps", case variations
being ignored.
-
public bool parse_weight (string str, out Weight weight, bool warn)
Parses a font weight. The allowed values are "heavy", "ultrabold", "bold", "normal", "light",
"ultraleight" and integers. Case variations are ignored.
-
public void quantize_line_geometry (int thickness, int position)
Quantizes the thickness and position of a line, typically an underline or strikethrough, to whole device
pixels, that is integer multiples of SCALE. The purpose of this function is to avoid
such lines looking blurry.
-
public int read_line (FileStream stream, StringBuilder str)
Reads an entire line from a file into a buffer. Lines may be delimited with '\n', '\r', '\n\r', or
'\r\n'. The delimiter is not written into the buffer. Text after a '#' character is treated as a comment and skipped. '\' can be used
to escape a # character. '\' proceeding a line delimiter combines adjacent lines. A '\' proceeding any other character is ignored and
written into the output buffer unmodified.
-
public unowned List reorder_items (List logical_items)
From a list of items in logical order and the associated directional levels, produce a list in visual
order. The original list is unmodified.
-
public bool scan_int (out string pos, int out)
Scans an integer. Leading white space is skipped.
-
public bool scan_string (out string pos, StringBuilder out)
Scans a string into a StringBuilder
buffer. The string may either be a sequence of non-white-space characters, or a quoted string with '"'. Instead a quoted string, '\"'
represents a literal quote. Leading white space outside of quotes is skipped.
-
public bool scan_word (out string pos, StringBuilder out)
Scans a word into a StringBuilder
buffer. A word consists of [A-Za-z_] followed by zero or more [A-Za-z_0-9] Leading white space is skipped.
-
public Script script_for_unichar (unichar ch)
Looks up the Script for a particular character (as defined
by Unicode Standard Annex #24). No check is made for ch being a valid Unicode character; if you pass in invalid
character, the result is undefined.
-
public unowned Language script_get_sample_language (Script script)
Given a script, finds a language tag that is reasonably representative of that script. This will usually
be the most widely spoken or used language written in that script: for instance, the sample language for
CYRILLIC is ru (Russian), the sample language for
ARABIC is ar.
-
public void shape (string text, int length, Analysis analysis, GlyphString glyphs)
Given a segment of text and the corresponding Analysis
structure returned from itemize, convert the characters into glyphs. You may also
pass in only a substring of the item from itemize.
-
public bool skip_space (out string pos)
Skips 0 or more characters of white space.
-
public unowned string split_file_list (string str)
Splits a SEARCHPATH_SEPARATOR
-separated list of files, stripping white space and substituting ~/ with $HOME/.
-
public unowned string trim_string (string str)
Trims leading and trailing whitespace from a string.
-
public Direction unichar_direction (unichar ch)
Determines the inherent direction of a character; either
LTR, RTL, or
NEUTRAL.
-
public int units_from_double (double d)
Converts a floating-point number to Pango units: multiplies it by
SCALE and rounds to nearest integer.
-
public double units_to_double (int i)
Converts a number in Pango units to floating-point: divides it by
SCALE.
-
public int version ()
This is similar to the macro PANGO_VERSION except that it returns the encoded version of
Pango available at run-time, as opposed to the version available at compile-time.
-
public unowned string version_check (int required_major, int required_minor, int required_micro)
Checks that the Pango library in use is compatible with the given version. Generally you would pass in
the constants VERSION_MAJOR,
VERSION_MINOR,
VERSION_MICRO as the three arguments to this function; that produces a check that the library in use at run-time is compatible
with the version of Pango the application or module was compiled against.
-
public unowned string version_string ()
This is similar to the macro VERSION_STRING
except that it returns the version of Pango available at run-time, as opposed to the version available at compile-time.