Expand description
Rust Pango bindings
Rust bindings and wrappers for Pango, part of gtk-rs-core.
Pango 1.38 is the lowest supported version for the underlying library.
Minimum supported Rust version
Currently, the minimum supported Rust version is 1.56.0.
Documentation
Using
We recommend using crates from crates.io, as demonstrated here.
If you want to track the bleeding edge, use the git dependency instead:
[dependencies]
pango = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "pango" }
Avoid mixing versioned and git crates like this:
# This will not compile
[dependencies]
pango = "0.13"
pango = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "pango" }
See Also
License
pango is available under the MIT License, please refer to it.
Re-exports
pub use ffi;pub use glib;
Modules
- Traits and essential types intended for blanket imports.
Structs
- The
Analysisstructure stores information about the properties of a segment of text. - The
AttrClassstructure stores the type and operations for a particular type of attribute. - A
AttrIteratoris used to iterate through aAttrList. - A
AttrListrepresents a list of attributes that apply to a section of text. - The
Attributestructure represents the common portions of all attributes. - The
Colorstructure is used to represent a color in an uncalibrated RGB color-space. - A
Contextstores global information used to control the itemization process. - A
Coveragestructure is a map from Unicode characters toCoverageLevelvalues. - A
Fontis used to represent a font in a rendering-system-independent manner. - A
FontDescriptiondescribes a font in an implementation-independent manner. - A
FontFaceis used to represent a group of fonts with the same family, slant, weight, and width, but varying sizes. - A
FontFamilyis used to represent a family of related font faces. - A
FontMaprepresents the set of fonts available for a particular rendering system. - The bits in a
FontMaskcorrespond to the set fields in aFontDescription. - A
FontMetricsstructure holds the overall metric information for a font. FontsetSimpleis a implementation of the abstractFontsetbase class as an array of fonts.- The
GlyphGeometrystructure contains width and positioning information for a single glyph. - A
GlyphInfostructure represents a single glyph with positioning information and visual attributes. - A
GlyphItemIteris an iterator over the clusters in aGlyphItem. - A
GlyphStringis used to store strings of glyphs with geometry and visual attribute information. - The result of
LayoutLine::x_to_index. - The
Itemstructure stores information about a segment of text. - The
Languagestructure is used to represent a language. - A
Layoutstructure represents an entire paragraph of text. - Flags that influence the behavior of
Pango::Layout::deserialize(). - A
LayoutItercan be used to iterate over the visual extents of aLayout. - A
LayoutLinerepresents one of the lines resulting from laying out a paragraph viaLayout. - LayoutSerializeFlags
v1_50Flags that influence the behavior ofLayout::serialize(). - A
Matrixspecifies a transformation between user-space and device coordinates. - The
Rectanglestructure represents a rectangle. - ShapeFlags
v1_44Flags influencing the shaping process. - ShowFlags
v1_44These flags affect how Pango treats characters that are normally not visible in the output. - A
TabArraycontains an array of tab stops.
Enums
- The
AttrTypedistinguishes between different types of attributes. - BaselineShift
v1_50An enumeration that affects baseline shifts between runs. BidiTyperepresents the bidirectional character type of a Unicode character.CoverageLevelis used to indicate how well a font can represent a particular Unicode character for a particular script.Directionrepresents a direction in the Unicode bidirectional algorithm.EllipsizeModedescribes what sort of ellipsization should be applied to text.- FontScale
v1_50An enumeration that affects font sizes for superscript and subscript positioning and for (emulated) Small Caps. Gravityrepresents the orientation of glyphs in a segment of text.GravityHintdefines how horizontal scripts should behave in a vertical context.- Overline
v1_46TheOverlineenumeration is used to specify whether text should be overlined, and if so, the type of line. RenderPartdefines different items to render for such purposes as setting colors.- The
Scriptenumeration identifies different writing systems. - An enumeration specifying the width of the font relative to other designs within a family.
- An enumeration specifying the various slant styles possible for a font.
TabAlignspecifies where the text appears relative to the tab stop position.- TextTransform
v1_50An enumeration that affects how Pango treats characters during shaping. - The
Underlineenumeration is used to specify whether text should be underlined, and if so, the type of underlining. - An enumeration specifying capitalization variant of the font.
- An enumeration specifying the weight (boldness) of a font.
Constants
- Whether the segment should be shifted to center around the baseline.
- Whether this run holds ellipsized text.
- Whether to add a hyphen at the end of the run during shaping.
- Value for @start_index in
Attributethat indicates the beginning of the text. - Value for @end_index in
Attributethat indicates the end of the text. - A
PangoGlyphvalue that indicates a zero-width empty glpyh. - A
PangoGlyphvalue for invalid input. - Flag used in
PangoGlyphto turn agunicharvalue of a valid Unicode character into an unknown-character glyph for thatgunichar. - The scale between dimensions used for Pango distances and device units.
- The scale factor for one magnification step (1.2).
- The scale factor for normal size (1.0).
- The scale factor for one shrinking step (1 / 1.2).
- The scale factor for three magnification steps (1.2 * 1.2 * 1.2).
- The scale factor for three shrinking steps (1 / (1.2 * 1.2 * 1.2)).
- The scale factor for two magnification steps (1.2 * 1.2).
- The scale factor for two shrinking steps (1 / (1.2 * 1.2)).
Traits
Functions
- Converts extents from Pango units to device units.
- Searches a string the first character that has a strong direction, according to the Unicode bidirectional algorithm.
- Locates a paragraph boundary in @text.
- Checks if a character that should not be normally rendered.
- Breaks a piece of text into segments with consistent directional level and font.
- Like
pango_itemize(), but with an explicitly specified base direction. - Parses marked-up text to create a plain-text string and an attribute list.
- Parses a font stretch.
- Parses a font style.
- Parses a font variant.
- Parses a font weight.
- Quantizes the thickness and position of a line to whole device pixels.
- Convert the characters in @text into glyphs.
- shape_with_flags
v1_44 - Determines the inherent direction of a character.
- Converts a floating-point number to Pango units.
- Converts a number in Pango units to floating-point.
- Returns the encoded version of Pango available at run-time.
- Checks that the Pango library in use is compatible with the given version.
- Returns the version of Pango available at run-time.