Struct pango::GlyphString [−][src]
pub struct GlyphString(_);
Expand description
The GlyphString
structure is used to store strings
of glyphs with geometry and visual attribute information.
The storage for the glyph information is owned
by the structure which simplifies memory management.
Implementations
Create a new GlyphString
.
Returns
the newly allocated GlyphString
, which
should be freed with pango_glyph_string_free()
.
Compute the logical and ink extents of a glyph string. See the documentation
for FontExt::glyph_extents()
for details about the interpretation
of the rectangles.
Examples of logical (red) and ink (green) rects:
font
a Font
Returns
ink_rect
rectangle used to store the extents of the glyph string
as drawn or None
to indicate that the result is not needed.
logical_rect
rectangle used to store the logical extents of the
glyph string or None
to indicate that the result is not needed.
Computes the extents of a sub-portion of a glyph string. The extents are relative to the start of the glyph string range (the origin of their coordinate system is at the start of the range, not at the start of the entire glyph string).
start
start index
end
end index (the range is the set of bytes with indices such that start <= index < end)
font
a Font
Returns
ink_rect
rectangle used to
store the extents of the glyph string range as drawn or
None
to indicate that the result is not needed.
logical_rect
rectangle used to
store the logical extents of the glyph string range or
None
to indicate that the result is not needed.
Computes the logical width of the glyph string as can also be computed
using extents()
. However, since this only computes the
width, it’s much faster. This is in fact only a convenience function that
computes the sum of geometry.width for each glyph in the self
.
Returns
the logical width of the glyph string.
Converts from character position to x position. (X position is measured from the left edge of the run). Character positions are computed by dividing up each cluster into equal portions.
text
the text for the run
length
the number of bytes (not characters) in text
.
analysis
the analysis information return from itemize()
index_
the byte index within text
trailing
whether we should compute the result for the beginning (false
)
or end (true
) of the character.
Returns
x_pos
location to store result
Convert from x offset to character position. Character positions are computed by dividing up each cluster into equal portions. In scripts where positioning within a cluster is not allowed (such as Thai), the returned value may not be a valid cursor position; the caller must combine the result with the logical attributes for the text to compute the valid cursor position.
text
the text for the run
length
the number of bytes (not characters) in text.
analysis
the analysis information return from itemize()
x_pos
the x offset (in Pango units)
Returns
index_
location to store calculated byte index within text
trailing
location to store a boolean indicating whether the user clicked on the leading or trailing edge of the character.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Returns the type identifier of Self
.
Auto Trait Implementations
impl RefUnwindSafe for GlyphString
impl !Send for GlyphString
impl !Sync for GlyphString
impl Unpin for GlyphString
impl UnwindSafe for GlyphString
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<'a, T, C> FromValueOptional<'a> for T where
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
T: FromValue<'a, Checker = C>,