Expand description
§Rust Pango bindings
Rust bindings and wrappers for Pango, part of gtk-rs-core.
Pango 1.40 is the lowest supported version for the underlying library.
§Minimum supported Rust version
Currently, the minimum supported Rust version is 1.83.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§
Modules§
- prelude
- Traits and essential types intended for blanket imports.
Structs§
- Analysis
- The Analysisstructure stores information about the properties of a segment of text.
- AttrClass 
- The AttrClassstructure stores the type and operations for a particular type of attribute.
- AttrColor 
- GLib type: Boxed type with copy-on-clone semantics.
- AttrFloat 
- GLib type: Boxed type with copy-on-clone semantics.
- AttrFont Desc 
- GLib type: Boxed type with copy-on-clone semantics.
- AttrFont Features 
- GLib type: Boxed type with copy-on-clone semantics.
- AttrInt
- GLib type: Boxed type with copy-on-clone semantics.
- AttrInto Iter 
- AttrIterator 
- A AttrIteratoris used to iterate through aAttrList.
- AttrLanguage 
- GLib type: Boxed type with copy-on-clone semantics.
- AttrList 
- A AttrListrepresents a list of attributes that apply to a section of text.
- AttrShape 
- GLib type: Boxed type with copy-on-clone semantics.
- AttrSize 
- GLib type: Boxed type with copy-on-clone semantics.
- AttrString 
- GLib type: Boxed type with copy-on-clone semantics.
- Attribute
- The Attributestructure represents the common portions of all attributes.
- Color
- The Colorstructure is used to represent a color in an uncalibrated RGB color-space.
- Context
- A Contextstores global information used to control the itemization process.
- Coverage
- A Coveragestructure is a map from Unicode characters toCoverageLevelvalues.
- Font
- A Fontis used to represent a font in a rendering-system-independent manner.
- FontDescription 
- A FontDescriptiondescribes a font in an implementation-independent manner.
- FontFace 
- A FontFaceis used to represent a group of fonts with the same family, slant, weight, and width, but varying sizes.
- FontFamily 
- A FontFamilyis used to represent a family of related font faces.
- FontMap
- A FontMaprepresents the set of fonts available for a particular rendering system.
- FontMask 
- The bits in a FontMaskcorrespond to the set fields in aFontDescription.
- FontMetrics 
- A FontMetricsstructure holds the overall metric information for a font.
- Fontset
- A Fontsetrepresents a set ofFontto use when rendering text.
- FontsetSimple 
- FontsetSimpleis a implementation of the abstract- Fontsetbase class as an array of fonts.
- GlyphGeometry 
- The GlyphGeometrystructure contains width and positioning information for a single glyph.
- GlyphInfo 
- A GlyphInfostructure represents a single glyph with positioning information and visual attributes.
- GlyphItem 
- A GlyphItemis a pair of aItemand the glyphs resulting from shaping the items text.
- GlyphItem Into Iter 
- GlyphItem Iter 
- A GlyphItemIteris an iterator over the clusters in aGlyphItem.
- GlyphString 
- A GlyphStringis used to store strings of glyphs with geometry and visual attribute information.
- HitPosition
- The result of LayoutLine::x_to_index.
- Item
- The Itemstructure stores information about a segment of text.
- Language
- The Languagestructure is used to represent a language.
- Layout
- A Layoutstructure represents an entire paragraph of text.
- LayoutDeserialize Flags v1_50
- Flags that influence the behavior of Pango::Layout::deserialize().
- LayoutIter 
- A LayoutItercan be used to iterate over the visual extents of aLayout.
- LayoutLine 
- A LayoutLinerepresents one of the lines resulting from laying out a paragraph viaLayout.
- LayoutSerialize Flags v1_50
- Flags that influence the behavior of Layout::serialize().
- Matrix
- A Matrixspecifies a transformation between user-space and device coordinates.
- Rectangle
- The Rectanglestructure represents a rectangle.
- Renderer
- Rendereris a base class for objects that can render text provided as- GlyphStringor- Layout.
- ScriptInto Iter 
- ScriptIter 
- A ScriptIteris used to iterate through a string and identify ranges in different scripts.
- ShapeFlags v1_44
- Flags influencing the shaping process.
- ShowFlags v1_44
- These flags affect how Pango treats characters that are normally not visible in the output.
- TabArray
- A TabArraycontains an array of tab stops.
Enums§
- Alignment
- Alignmentdescribes how to align the lines of a- Layoutwithin the available space.
- AttrType 
- The AttrTypedistinguishes between different types of attributes.
- BaselineShift v1_50
- An enumeration that affects baseline shifts between runs.
- BidiType Deprecated 
- BidiTyperepresents the bidirectional character type of a Unicode character.
- CoverageLevel 
- CoverageLevelis used to indicate how well a font can represent a particular Unicode character for a particular script.
- Direction
- Directionrepresents a direction in the Unicode bidirectional algorithm.
- EllipsizeMode 
- EllipsizeModedescribes what sort of ellipsization should be applied to text.
- FontColor v1_57
- Specifies whether a font should or should not have color glyphs.
- FontScale v1_50
- An enumeration that affects font sizes for superscript and subscript positioning and for (emulated) Small Caps.
- Gravity
- Gravityrepresents the orientation of glyphs in a segment of text.
- GravityHint 
- GravityHintdefines how horizontal scripts should behave in a vertical context.
- Overlinev1_46
- The Overlineenumeration is used to specify whether text should be overlined, and if so, the type of line.
- RenderPart 
- RenderPartdefines different items to render for such purposes as setting colors.
- Script
- The Scriptenumeration identifies different writing systems.
- Stretch
- An enumeration specifying the width of the font relative to other designs within a family.
- Style
- An enumeration specifying the various slant styles possible for a font.
- TabAlign
- TabAlignspecifies where the text appears relative to the tab stop position.
- TextTransform v1_50
- An enumeration that affects how Pango treats characters during shaping.
- Underline
- The Underlineenumeration is used to specify whether text should be underlined, and if so, the type of underlining.
- Variant
- An enumeration specifying capitalization variant of the font.
- Weight
- An enumeration specifying the weight (boldness) of a font.
- WrapMode 
- WrapModedescribes how to wrap the lines of a- Layoutto the desired width.
Constants§
- ANALYSIS_FLAG_ CENTERED_ BASELINE 
- Whether the segment should be shifted to center around the baseline.
- ANALYSIS_FLAG_ IS_ ELLIPSIS 
- Whether this run holds ellipsized text.
- ANALYSIS_FLAG_ NEED_ HYPHEN 
- Whether to add a hyphen at the end of the run during shaping.
- ATTR_INDEX_ FROM_ TEXT_ BEGINNING 
- Value for @start_index in Attributethat indicates the beginning of the text.
- ATTR_INDEX_ TO_ TEXT_ END 
- Value for @end_index in Attributethat indicates the end of the text.
- GLYPH_EMPTY 
- A PangoGlyphvalue that indicates a zero-width empty glpyh.
- GLYPH_INVALID_ INPUT 
- A PangoGlyphvalue for invalid input.
- GLYPH_UNKNOWN_ FLAG 
- Flag used in PangoGlyphto turn agunicharvalue of a valid Unicode character into an unknown-character glyph for thatgunichar.
- SCALE
- The scale between dimensions used for Pango distances and device units.
- SCALE_LARGE 
- The scale factor for one magnification step (1.2).
- SCALE_MEDIUM 
- The scale factor for normal size (1.0).
- SCALE_SMALL 
- The scale factor for one shrinking step (1 / 1.2).
- SCALE_XX_ LARGE 
- The scale factor for three magnification steps (1.2 * 1.2 * 1.2).
- SCALE_XX_ SMALL 
- The scale factor for three shrinking steps (1 / (1.2 * 1.2 * 1.2)).
- SCALE_X_ LARGE 
- The scale factor for two magnification steps (1.2 * 1.2).
- SCALE_X_ SMALL 
- The scale factor for two shrinking steps (1 / (1.2 * 1.2)).
Traits§
Functions§
- extents_to_ pixels 
- Converts extents from Pango units to device units.
- find_base_ dir 
- Searches a string the first character that has a strong direction, according to the Unicode bidirectional algorithm.
- find_paragraph_ boundary 
- Locates a paragraph boundary in @text.
- is_zero_ width 
- Checks if a character that should not be normally rendered.
- itemize
- Breaks a piece of text into segments with consistent directional level and font.
- itemize_with_ base_ dir 
- Like pango_itemize(), but with an explicitly specified base direction.
- markup_parser_ finish 
- Finishes parsing markup.
- markup_parser_ new 
- Incrementally parses marked-up text to create a plain-text string and an attribute list.
- parse_markup 
- Parses marked-up text to create a plain-text string and an attribute list.
- parse_stretch 
- Parses a font stretch.
- parse_style 
- Parses a font style.
- parse_variant 
- Parses a font variant.
- parse_weight 
- Parses a font weight.
- quantize_line_ geometry 
- Quantizes the thickness and position of a line to whole device pixels.
- reorder_items 
- Reorder items from logical order to visual order.
- shape
- Convert the characters in @text into glyphs.
- shape_full 
- Convert the characters in @text into glyphs.
- shape_with_ flags v1_44
- Convert the characters in @text into glyphs.
- unichar_direction 
- Determines the inherent direction of a character.
- units_from_ double 
- Converts a floating-point number to Pango units.
- units_to_ double 
- Converts a number in Pango units to floating-point.
- version
- Returns the encoded version of Pango available at run-time.
- version_check 
- Checks that the Pango library in use is compatible with the given version.
- version_string 
- Returns the version of Pango available at run-time.