Create a new allow-breaks attribute.
If breaks are disabled, the range will be kept in a single run, as far as possible.
Passed: a boolean.
#t if we line breaks are allowed
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new background alpha attribute.
Passed: an unsigned 16-bit integer.
the alpha value, between 1 and 65536
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new background color attribute.
Passed: an unsigned 16-bit integer.
the red value (ranging from 0 to 65535)
Passed: an unsigned 16-bit integer.
the green value
Passed: an unsigned 16-bit integer.
the blue value
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new baseline displacement attribute.
The effect of this attribute is to shift the baseline of a run, relative to the run of preceding run.
Passed: a 32-bit integer.
either a <PangoBaselineShift> enumeration
value or an absolute value (> 1024) in Pango units, relative to the
baseline of the previous run. Positive values displace the text
upwards.
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Apply customization from attributes to the breaks in attrs.
The line breaks are assumed to have been produced by
Pango.default_break and Pango.tailor_break.
Passed: a string.
text to break. Must be valid UTF-8
Passed: a 32-bit integer.
length of text in bytes (may be -1 if text is nul-terminated)
Passed: a <PangoAttrList>.
<PangoAttrList> to apply
Passed: a 32-bit integer.
Byte offset of text from the beginning of the paragraph
Passed: a list or vector, each a <PangoLogAttr>.
It is filled in, and returned: a vector, each a
<PangoLogAttr>.
array with one <PangoLogAttr> per character in
text, plus one extra, to be filled in
Not returned: it is the length of attrs.
length of attrs array
Create a new font fallback attribute.
If fallback is disabled, characters will only be used from the closest matching font on the system. No fallback will be done to other fonts on the system that might contain the characters in the text.
Passed: a boolean.
#t if we should fall back on other fonts for characters the
active font is missing
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new font family attribute.
Passed: a string.
the family or comma-separated list of families
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new font description attribute.
This attribute allows setting family, style, weight, variant, stretch, and size simultaneously.
Passed: a <PangoFontDescription>.
the font description
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new font features tag attribute.
You can use this attribute to select OpenType font features like small-caps, alternative glyphs, ligatures, etc. for fonts that support them.
Passed: a string.
a string with OpenType font features, with the syntax of the [CSS
font-feature-settings
property](https://www.w3.org/TR/css-fonts-4/font-rend-desc)
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new font scale attribute.
The effect of this attribute is to change the font size of a run, relative to the size of preceding run.
Passed: a <PangoFontScale>, or one of its
symbols.
a <PangoFontScale> value, which indicates font
size change relative to the size of the previous run.
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new foreground alpha attribute.
Passed: an unsigned 16-bit integer.
the alpha value, between 1 and 65536
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new foreground color attribute.
Passed: an unsigned 16-bit integer.
the red value (ranging from 0 to 65535)
Passed: an unsigned 16-bit integer.
the green value
Passed: an unsigned 16-bit integer.
the blue value
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new gravity hint attribute.
Passed: a <PangoGravityHint>, or one of its
symbols.
the gravity hint value
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new gravity attribute.
Passed: a <PangoGravity>, or one of its symbols.
the gravity value; should not be auto
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new insert-hyphens attribute.
Pango will insert hyphens when breaking lines in the middle of a word. This attribute can be used to suppress the hyphen.
Passed: a boolean.
#t if hyphens should be inserted
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new language tag attribute.
Passed: a <PangoLanguage>.
language tag
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new letter-spacing attribute.
Passed: a 32-bit integer.
amount of extra space to add between graphemes of the text, in Pango units
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Modify the height of logical line extents by a factor.
This affects the values returned by layout-line:get-extents!, layout-line:get-pixel-extents! and
layout-iter:get-line-extents!.
Passed: a real number.
the scaling factor to apply to the logical height
Returned: a <PangoAttribute>.
Override the height of logical line extents to be height.
This affects the values returned by layout-line:get-extents!, layout-line:get-pixel-extents! and
layout-iter:get-line-extents!.
Passed: a 32-bit integer.
the line height, in PANGO_SCALE-ths of a point
Returned: a <PangoAttribute>.
Deserializes a <PangoAttrList> from a string.
This is the counterpart to attr-list:to-string. See that functions for details about
the format.
Passed: a string.
a string
Returned: a <PangoAttrList>, or #f.
a new <PangoAttrList>
Create a new overline color attribute.
This attribute modifies the color of overlines. If not set, overlines will use the foreground color.
Passed: an unsigned 16-bit integer.
the red value (ranging from 0 to 65535)
Passed: an unsigned 16-bit integer.
the green value
Passed: an unsigned 16-bit integer.
the blue value
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new overline-style attribute.
Passed: a <PangoOverline>, or one of its symbols.
the overline style
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new baseline displacement attribute.
Passed: a 32-bit integer.
the amount that the text should be displaced vertically, in Pango units. Positive values displace the text upwards.
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new font size scale attribute.
The base font for the affected text will have its size multiplied by scale-factor.
Passed: a real number.
factor to scale the font
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Marks the range of the attribute as a single sentence.
Note that this may require adjustments to word and sentence classification around the range.
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new shape attribute.
A shape is used to impose a particular ink and logical rectangle on the
result of shaping a particular glyph. This might be used, for instance,
for embedding a picture or a widget inside a
<PangoLayout>.
Passed: a <PangoRectangle>.
ink rectangle to assign to each character
Passed: a <PangoRectangle>.
logical rectangle to assign to each character
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Creates a new shape attribute.
Like Pango.AttrShape.new, but a user data pointer is also
provided; this pointer can be accessed when later rendering the glyph.
Passed: a <PangoRectangle>.
ink rectangle to assign to each character
Passed: a <PangoRectangle>.
logical rectangle to assign to each character
Passed, or left out: a foreign pointer, or a bytevector, or #f.
user data pointer
Passed, or left out: a procedure, or #f.
function to copy data when the attribute is copied. If #f,
data is simply copied as a pointer
See PangoAttrDataCopyFunc for how it is
called.
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Not passed: guile-gi supplies it.
function to free data when the attribute is freed
See GDestroyNotify for how it is
called.
Create a new attribute that influences how invisible characters are rendered.
Passed: a <PangoShowFlags>, or a list of its
symbols, or one of them.
<PangoShowFlags> to apply
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new font-size attribute in fractional points.
Passed: a 32-bit integer.
the font size, in PANGO_SCALE-ths of a point
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new font-size attribute in device units.
Passed: a 32-bit integer.
the font size, in PANGO_SCALE-ths of a device unit
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new font stretch attribute.
Passed: a <PangoStretch>, or one of its symbols.
the stretch
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new strikethrough color attribute.
This attribute modifies the color of strikethrough lines. If not set, strikethrough lines will use the foreground color.
Passed: an unsigned 16-bit integer.
the red value (ranging from 0 to 65535)
Passed: an unsigned 16-bit integer.
the green value
Passed: an unsigned 16-bit integer.
the blue value
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new strike-through attribute.
Passed: a boolean.
#t if the text should be struck-through
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new font slant style attribute.
Passed: a <PangoStyle>, or one of its symbols.
the slant style
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new attribute that influences how characters are transformed during shaping.
Passed: a <PangoTextTransform>, or one of
its symbols.
<PangoTextTransform> to apply
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Fetches the attribute type name.
The attribute type name is the string passed in when registering the
type using attr-type:register.
The returned value is an interned string (see
intern-string for what that means) that
should not be modified or freed.
Passed: a <PangoAttrType>, or one of its symbols.
an attribute type ID to fetch the name for
Returned: a string, or #f.
the type ID name (which may be #f), or #f if type is
a built-in Pango attribute type or invalid.
Allocate a new attribute type ID.
The attribute type name can be accessed later by using
attr-type:get-name.
Passed: a string.
an identifier for the type
Returned: a <PangoAttrType>.
the new type ID.
Create a new underline color attribute.
This attribute modifies the color of underlines. If not set, underlines will use the foreground color.
Passed: an unsigned 16-bit integer.
the red value (ranging from 0 to 65535)
Passed: an unsigned 16-bit integer.
the green value
Passed: an unsigned 16-bit integer.
the blue value
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new underline-style attribute.
Passed: a <PangoUnderline>, or one of its
symbols.
the underline style
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Create a new font variant attribute (normal or small caps).
Passed: a <PangoVariant>, or one of its symbols.
the variant
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy.
Create a new font weight attribute.
Passed: a <PangoWeight>, or one of its symbols.
the weight
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Marks the range of the attribute as a single word.
Note that this may require adjustments to word and sentence classification around the range.
Returned: a <PangoAttribute>.
the newly allocated <PangoAttribute>, which
should be freed with attribute:destroy
Determines the bidirectional type of a character.
The bidirectional type is specified in the Unicode Character Database.
A simplified version of this function is available as
unichar_direction.
Passed: a character.
a Unicode character
Returned: a <PangoBidiType>.
the bidirectional character type, as used in the Unicode bidirectional algorithm.
Converts extents from Pango units to device units.
The conversion is done by dividing by the PANGO_SCALE factor and
performing rounding.
The inclusive rectangle is converted by flooring the x/y coordinates and extending width/height, such that the final rectangle completely includes the original rectangle.
The nearest rectangle is converted by rounding the coordinates of the rectangle to the nearest device unit (pixel).
The rule to which argument to use is: if you want the resulting device-space rectangle to completely contain the original rectangle, pass it in as inclusive. If you want two touching-but-not-overlapping rectangles stay touching-but-not-overlapping after rounding to device units, pass them in as nearest.
Passed, and returned: a <PangoRectangle>.
rectangle to round to pixels inclusively
Passed, and returned: a <PangoRectangle>.
rectangle to round to nearest pixels
Searches a string the first character that has a strong direction, according to the Unicode bidirectional algorithm.
Passed: a string.
the text to process. Must be valid UTF-8
Passed: a 32-bit integer.
length of text in bytes (may be -1 if text is nul-terminated)
Returned: a <PangoDirection>.
The direction corresponding to the first strong character. If no such
character is found, then neutral is returned.
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 next paragraph (index after all delimiters) is stored n next-paragraph-start.
If no delimiters are found, both paragraph-delimiter-index and next-paragraph-start are filled with the length of text (an index one off the end).
Passed: a string.
UTF-8 text
Passed: a 32-bit integer.
length of text in bytes, or -1 if nul-terminated
Returned: a 32-bit integer.
return location for index of delimiter
Returned: a 32-bit integer.
return location for start of next paragraph
Creates a new font description from a string representation.
The string must have the form
[FAMILY-LIST] [STYLE-OPTIONS] [SIZE] [VARIATIONS] [FEATURES]
where FAMILY-LIST is a comma-separated list of families optionally terminated by a comma, STYLE_OPTIONS is a whitespace-separated list of words where each word describes one of style, variant, weight, stretch, or gravity, and SIZE is a decimal number (size in points) or optionally followed by the unit modifier "px" for absolute size.
The following words are understood as styles: "Normal", "Roman", "Oblique", "Italic".
The following words are understood as variants: "Small-Caps", "All-Small-Caps", "Petite-Caps", "All-Petite-Caps", "Unicase", "Title-Caps".
The following words are understood as weights: "Thin", "Ultra-Light", "Extra-Light", "Light", "Semi-Light", "Demi-Light", "Book", "Regular", "Medium", "Semi-Bold", "Demi-Bold", "Bold", "Ultra-Bold", "Extra-Bold", "Heavy", "Black", "Ultra-Black", "Extra-Black".
The following words are understood as stretch values: "Ultra-Condensed", "Extra-Condensed", "Condensed", "Semi-Condensed", "Semi-Expanded", "Expanded", "Extra-Expanded", "Ultra-Expanded".
The following words are understood as gravity values: "Not-Rotated", "South", "Upside-Down", "North", "Rotated-Left", "East", "Rotated-Right", "West".
The following words are understood as color values: "With-Color", "Without-Color".
VARIATIONS is a comma-separated list of font variations of the form @axis1=value,axis2=value,...
FEATURES is a comma-separated list of font features of the form \#feature1=value,feature2=value,... The =value part can be ommitted if the value is 1.
Any one of the options may be absent. If FAMILY-LIST is absent, then
the family_name field of the resulting font description will be
initialized to #f. If STYLE-OPTIONS is missing, then all style
options will be set to the default values. If SIZE is missing, the size
in the resulting font description will be set to 0.
A typical example:
Cantarell Italic Light 15 @wght=200 #tnum=1
Passed: a string.
string representation of a font description.
Returned: a <PangoFontDescription>.
a new <PangoFontDescription>.
Computes a <PangoLogAttr> for each character in
text.
The attrs array must have one <PangoLogAttr>
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).
Passed: a string.
text to process. Must be valid UTF-8
Passed: a 32-bit integer.
length in bytes of text
Passed: a 32-bit integer.
embedding level, or -1 if unknown
Passed: a <PangoLanguage>.
language tag
Passed: a list or vector, each a <PangoLogAttr>.
It is filled in, and returned: a vector, each a
<PangoLogAttr>.
array with one <PangoLogAttr> per character in
text, plus one extra, to be filled in
Not returned: it is the length of attrs.
length of attrs array
Finds the gravity that best matches the rotation component in a
<PangoMatrix>.
Passed, or left out: a <PangoMatrix>, or #f.
Returned: a <PangoGravity>.
the gravity of matrix, which will never be
auto, or south if
matrix is #f
Returns the gravity to use in laying out a
<PangoItem>.
The gravity is determined based on the script, base gravity, and hint.
If base-gravity is auto, it is first
replaced with the preferred gravity of script. To get the
preferred gravity of a script, pass auto and
strong in.
Passed: a <PangoScript>, or one of its symbols.
<PangoScript> to query
Passed: a <PangoGravity>, or one of its symbols.
base gravity of the paragraph
Passed: a <PangoGravityHint>, or one of its
symbols.
orientation hint
Returned: a <PangoGravity>.
resolved gravity suitable to use for a run of text with script
Returns the gravity to use in laying out a single character or
<PangoItem>.
The gravity is determined based on the script, East Asian width, base gravity, and hint,
This function is similar to gravity:get-for-script except that this function makes
a distinction between narrow/half-width and wide/full-width characters
also. Wide/full-width characters always stand upright, that is,
they always take the base gravity, whereas narrow/full-width characters
are always rotated in vertical context.
If base-gravity is auto, it is first
replaced with the preferred gravity of script.
Passed: a <PangoScript>, or one of its symbols.
<PangoScript> to query
Passed: a boolean.
#t for wide characters as returned by
unichar-iswide?
Passed: a <PangoGravity>, or one of its symbols.
base gravity of the paragraph
Passed: a <PangoGravityHint>, or one of its
symbols.
orientation hint
Returned: a <PangoGravity>.
resolved gravity suitable to use for a run of text with script and wide.
Converts a <PangoGravity> value to its natural
rotation in radians.
Note that matrix:rotate takes angle in
degrees, not radians. So, to call [method@Pango.Matrix,rotate] with
the output of this function you should multiply it by (180. / G_PI).
Passed: a <PangoGravity>, or one of its symbols.
gravity to query, should not be auto
Returned: a real number.
the rotation value corresponding to gravity.
Checks if a character that should not be normally rendered.
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
unichar-iszerowidth? and is at
best misnamed.
Passed: a character.
a Unicode character
Returned: a boolean.
#t if ch is a zero-width character, #f otherwise
Breaks a piece of text into segments with consistent directional level and font.
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).
cached-iter should be an iterator over attrs currently positioned at a range before or containing start-index; cached-iter will be advanced to the range covering the position just after start-index + length. (i.e. if itemizing in a loop, just keep passing in the same cached-iter).
Passed: a <PangoContext>.
a structure holding information that affects the itemization process.
Passed: a string.
the text to itemize. Must be valid UTF-8
Passed: a 32-bit integer.
first byte in text to process
Passed: a 32-bit integer.
the number of bytes (not characters) to process after start-index. This must be >= 0.
Passed: a <PangoAttrList>.
the set of attributes that apply to text.
Passed, or left out: a <PangoAttrIterator>,
or #f.
Cached attribute iterator
Returned: a list, each a <PangoItem>.
a GList of <PangoItem> structures. The items
should be freed using item:free in combination
with GLib.List.free_full.
Like itemize, but with an explicitly specified
base direction.
The base direction is used when computing bidirectional levels.
itemize gets the base direction from the
<PangoContext> (see context:set-base-dir).
Passed: a <PangoContext>.
a structure holding information that affects the itemization process.
Passed: a <PangoDirection>, or one of its
symbols.
base direction to use for bidirectional processing
Passed: a string.
the text to itemize.
Passed: a 32-bit integer.
first byte in text to process
Passed: a 32-bit integer.
the number of bytes (not characters) to process after start-index. This must be >= 0.
Passed: a <PangoAttrList>.
the set of attributes that apply to text.
Passed, or left out: a <PangoAttrIterator>,
or #f.
Cached attribute iterator
Returned: a list, each a <PangoItem>.
a GList of <PangoItem> structures. The items
should be freed using item:free probably in
combination with GLib.List.free_full.
Convert a language tag to a <PangoLanguage>.
The language tag must be in a RFC-3066 format.
<PangoLanguage> pointers can be efficiently
copied (copy the pointer) and compared with other language tags (compare
the pointer.)
This function first canonicalizes the string by converting it to lowercase, mapping ’_’ to ’-’, and stripping all characters other than letters and ’-’.
Use language:get-default if you want
to get the <PangoLanguage> for the current locale
of the process.
Passed, or left out: a string, or #f.
a string representing a language tag
Returned: a <PangoLanguage>, or #f.
Returns the <PangoLanguage> for the current
locale of the process.
On Unix systems, this is the return value is derived from
setlocale (LC_CTYPE, NULL), and the user can affect this through
the environment variables LC_ALL, LC_CTYPE or LANG (checked in that
order). The locale string typically is in the form lang_COUNTRY, where
lang is an ISO-639 language code, and COUNTRY is an ISO-3166 country
code. For instance, sv_FI for Swedish as written in Finland or pt_BR
for Portuguese as written in Brazil.
On Windows, the C library does not use any such environment variables,
and setting them won’t affect the behavior of functions like
ctime(). The user sets the locale through the Regional Options
in the Control Panel. The C library (in the setlocale()
function) does not use country and language codes, but country and
language names spelled out in English. However, this function does
check the above environment variables, and does return a Unix-style
locale string based on either said environment variables or the thread’s
current locale.
Your application should call setlocale(LC_ALL, "") for the user
settings to take effect. GTK does this in its initialization functions
automatically (by calling gtk_set_locale()). See the
setlocale() manpage for more details.
Note that the default language can change over the life of an application.
Also note that this function will not do the right thing if you use
per-thread locales with uselocale(). In that case, you should
just call language-from-string
yourself.
Returned: a <PangoLanguage>.
the default language as a <PangoLanguage>
Returns the list of languages that the user prefers.
The list is specified by the PANGO_LANGUAGE or LANGUAGE
environment variables, in order of preference. Note that this list does
not necessarily include the language returned by language:get-default.
When choosing language-specific resources, such as the sample text
returned by language:get-sample-string, you should first try
the default language, followed by the languages returned by this
function.
Returned: a vector, each a <PangoLanguage>, or
#f.
a #f-terminated array of <PangoLanguage>*
Returned: an unsigned 32-bit integer.
Return the bidirectional embedding levels of the input paragraph.
The bidirectional embedding levels are defined by the [Unicode Bidirectional Algorithm](http://www.unicode.org/reports/tr9/).
If the input base direction is a weak direction, the direction of the characters in the text will determine the final resolved direction.
Passed: a string.
the text to itemize.
Passed: a 32-bit integer.
the number of bytes (not characters) to process, or -1 if text is nul-terminated and the length should be calculated.
Passed: a <PangoDirection>, or one of its
symbols. Returned: a <PangoDirection>.
input base direction, and output resolved direction.
Returned: a foreign pointer.
a newly allocated array of embedding levels, one item per character (not
byte), that should be freed using
byte-array:free.
Finishes parsing markup.
After feeding a Pango markup parser some data with
markup-parse-context:parse?,
use this function to get the list of attributes and text out of the
markup. This function will not free context, use
markup-parse-context:free to
do so.
Passed: a <GMarkupParseContext>.
A valid parse context that was returned from markup_parser_new
Returned: a boolean.
#f if error is set, otherwise #t
Returned: a <PangoAttrList>.
address of return location for a <PangoAttrList>
Returned: a string.
address of return location for text with tags stripped
Returned: a character.
address of return location for accelerator char
Incrementally parses marked-up text to create a plain-text string and an attribute list.
See the Pango Markup docs for details about the supported markup.
If accel-marker is nonzero, the given character will mark the
character following it as an accelerator. For example,
accel-marker might be an ampersand or underscore. All characters
marked as an accelerator will receive a low
attribute, and the first character so marked will be returned in
accel-char, when calling markup_parser_finish. Two
accel-marker characters following each other produce a single
literal accel-marker character.
To feed markup to the parser, use markup-parse-context:parse? on the returned
<GMarkupParseContext>. When done
with feeding markup to the parser, use markup_parser_finish to
get the data out of it, and then use markup-parse-context:free to free it.
This function is designed for applications that read Pango markup from
streams. To simply parse a string containing Pango markup, the
parse-markup API is recommended instead.
Passed: a character.
character that precedes an accelerator, or 0 for none
Returned: a <GMarkupParseContext>.
a <GMarkupParseContext> that
should be destroyed with markup-parse-context:free.
Parses marked-up text to create a plain-text string and an attribute list.
See the Pango Markup docs for details about the supported markup.
If accel-marker is nonzero, the given character will mark the
character following it as an accelerator. For example,
accel-marker might be an ampersand or underscore. All characters
marked as an accelerator will receive a low
attribute, and the first character so marked will be returned in
accel-char. Two accel-marker characters following each
other produce a single literal accel-marker character.
To parse a stream of pango markup incrementally, use
markup_parser_new.
If any error happens, none of the output arguments are touched except for error.
Passed: a string.
markup to parse (see the Pango Markup docs)
Passed: a 32-bit integer.
length of markup-text, or -1 if nul-terminated
Passed: a character.
character that precedes an accelerator, or 0 for none
Returned: a boolean.
#f if error is set, otherwise #t
Returned: a <PangoAttrList>.
address of return location for a <PangoAttrList>
Returned: a string.
address of return location for text with tags stripped
Returned: a character.
address of return location for accelerator char
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.
Passed: a string.
a string to parse.
Passed: a boolean.
if #t, issue a g_warning() on bad input.
Returned: a boolean.
#t if str was successfully parsed.
Returned: a <PangoStretch>.
a <PangoStretch> to store the result in.
Parses a font style.
The allowed values are "normal", "italic" and "oblique", case variations being ignored.
Passed: a string.
a string to parse.
Passed: a boolean.
if #t, issue a g_warning() on bad input.
Returned: a boolean.
#t if str was successfully parsed.
Returned: a <PangoStyle>.
a <PangoStyle> to store the result in.
Parses a font variant.
The allowed values are "normal", "small-caps", "all-small-caps", "petite-caps", "all-petite-caps", "unicase" and "title-caps", case variations being ignored.
Passed: a string.
a string to parse.
Passed: a boolean.
if #t, issue a g_warning() on bad input.
Returned: a boolean.
#t if str was successfully parsed.
Returned: a <PangoVariant>.
a <PangoVariant> to store the result in.
Parses a font weight.
The allowed values are "heavy", "ultrabold", "bold", "normal", "light", "ultraleight" and integers. Case variations are ignored.
Passed: a string.
a string to parse.
Passed: a boolean.
if #t, issue a g_warning() on bad input.
Returned: a boolean.
#t if str was successfully parsed.
Returned: a <PangoWeight>.
a <PangoWeight> to store the result in.
Quantizes the thickness and position of a line to whole device pixels.
This is typically used for underline or strikethrough. The purpose of this function is to avoid such lines looking blurry.
Care is taken to make sure thickness is at least one pixel when this function returns, but returned position may become zero as a result of rounding.
Passed, and returned: a 32-bit integer.
pointer to the thickness of a line, in Pango units
Passed, and returned: a 32-bit integer.
corresponding position
Reorder items from logical order to visual order.
The visual order is determined from the associated directional levels of the items. The original list is unmodified.
(Please open a bug if you use this function. It is not a particularly convenient interface, and the code is duplicated elsewhere in Pango for that reason.)
Passed: a list, each a <PangoItem>.
a GList of <PangoItem> in logical order.
Returned: a list, each a <PangoItem>.
a GList of <PangoItem> structures in visual
order.
Finds a language tag that is reasonably representative of script.
The language 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.
For some scripts, no sample language will be returned because there is
no language that is sufficiently representative. The best example of
this is han, where various different variants of
written Chinese, Japanese, and Korean all use significantly different
sets of Han characters and forms of shared characters. No sample
language can be provided for many historical scripts as well.
As of 1.18, this function checks the environment variables
PANGO_LANGUAGE and LANGUAGE (checked in that order) first.
If one of them is set, it is parsed as a list of language tags separated
by colons or other separators. This function will return the first
language in the parsed list that Pango believes may use script for
writing. This last predicate is tested using language:includes-script?. This can be used to
control Pango’s font selection for non-primary languages. For example,
a PANGO_LANGUAGE enviroment variable set to "en:fa" makes Pango
choose fonts suitable for Persian (fa) instead of Arabic (ar) when a
segment of Arabic text is found in an otherwise non-Arabic text. The
same trick can be used to choose a default language for
han when setting context language is not feasible.
Passed: a <PangoScript>, or one of its symbols.
Returned: a <PangoLanguage>, or #f.
a <PangoLanguage> that is representative of the
script
Convert the characters in item into glyphs.
This is similar to Pango.shape_with_flags, except it takes a
<PangoItem> instead of separate item-text and
analysis arguments.
It also takes log-attrs, which are needed for implementing some aspects of hyphen insertion and text transforms (in particular, capitalization).
Note that the extra attributes in the analyis that is returned
from itemize have indices that are relative to the
entire paragraph, so you do not pass the full paragraph text as
paragraph-text, you need to subtract the item offset from their
indices before calling Pango.shape_with_flags.
Passed: a <PangoItem>.
<PangoItem> to shape
Passed: a string, or #f.
text of the paragraph (see details).
Passed: a 32-bit integer.
the length (in bytes) of paragraph-text. -1 means nul-terminated text.
Passed: a <PangoLogAttr>, or #f.
array of <PangoLogAttr> for item
Passed, filled in, and returned: a
<PangoGlyphString>.
glyph string in which to store results
Passed: a <PangoShapeFlags>, or a list of its
symbols, or one of them.
flags influencing the shaping process
Deserializes a <PangoTabArray> from a string.
This is the counterpart to tab-array:to-string. See that functions for details about
the format.
Passed: a string.
a string
Returned: a <PangoTabArray>, or #f.
a new <PangoTabArray>
Determines the inherent direction of a character.
The inherent direction is either ltr,
rtl, or neutral.
This function is useful to categorize characters into left-to-right
letters, right-to-left letters, and everything else. If full Unicode
bidirectional type of a character is needed,
Pango.BidiType.for_unichar can be used instead.
Passed: a character.
a Unicode character
Returned: a <PangoDirection>.
the direction of the character.
Converts a floating-point number to Pango units.
The conversion is done by multiplying d by PANGO_SCALE and
rounding the result to nearest integer.
Passed: a real number.
double floating-point value
Returned: a 32-bit integer.
the value in Pango units.
Converts a number in Pango units to floating-point.
The conversion is done by dividing i by PANGO_SCALE.
Passed: a 32-bit integer.
value in Pango units
Returned: a real number.
the double value.
Returns the encoded version of Pango available at run-time.
This is similar to the macro PANGO_VERSION except that the macro
returns the encoded version available at compile-time. A version number
can be encoded into an integer using PANGO_VERSION_ENCODE().
Returned: a 32-bit integer.
The encoded version of Pango library available at run time.
Checks that the Pango library in use is compatible with the given version.
Generally you would pass in the constants PANGO_VERSION_MAJOR,
PANGO_VERSION_MINOR, PANGO_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.
Compatibility is defined by two things: first the version of the running library is newer than the version required-major.required_minor.required-micro. Second the running library must be binary compatible with the version required-major.required_minor.required-micro (same major version.)
For compile-time version checking use PANGO_VERSION_CHECK().
Passed: a 32-bit integer.
the required major version
Passed: a 32-bit integer.
the required minor version
Passed: a 32-bit integer.
the required major version
Returned: a string, or #f.
#f if the Pango library is compatible with the given version, or
a string describing the version mismatch. The returned string is owned
by Pango and should not be modified or freed.
Returns the version of Pango available at run-time.
This is similar to the macro PANGO_VERSION_STRING except that the
macro returns the version available at compile-time.
Returned: a string.
A string containing the version of Pango library available at run time. The returned string is owned by Pango and should not be modified or freed.