[]Struct pango::FontMetrics

pub struct FontMetrics(_);

A FontMetrics structure holds the overall metric information for a font (possibly restricted to a script). The fields of this structure are private to implementations of a font backend. See the documentation of the corresponding getters for documentation of their meaning.

Implementations

impl FontMetrics[src]

pub fn get_approximate_char_width(&self) -> i32[src]

Gets the approximate character width for a font metrics structure. This is merely a representative value useful, for example, for determining the initial size for a window. Actual characters in text will be wider and narrower than this.

Returns

the character width, in Pango units.

pub fn get_approximate_digit_width(&self) -> i32[src]

Gets the approximate digit width for a font metrics structure. This is merely a representative value useful, for example, for determining the initial size for a window. Actual digits in text can be wider or narrower than this, though this value is generally somewhat more accurate than the result of FontMetrics::get_approximate_char_width for digits.

Returns

the digit width, in Pango units.

pub fn get_ascent(&self) -> i32[src]

Gets the ascent from a font metrics structure. The ascent is the distance from the baseline to the logical top of a line of text. (The logical top may be above or below the top of the actual drawn ink. It is necessary to lay out the text to figure where the ink will be.)

Returns

the ascent, in Pango units.

pub fn get_descent(&self) -> i32[src]

Gets the descent from a font metrics structure. The descent is the distance from the baseline to the logical bottom of a line of text. (The logical bottom may be above or below the bottom of the actual drawn ink. It is necessary to lay out the text to figure where the ink will be.)

Returns

the descent, in Pango units.

pub fn get_height(&self) -> i32[src]

Gets the line height from a font metrics structure. The line height is the distance between successive baselines in wrapped text.

If the line height is not available, 0 is returned.

Feature: v1_44

Returns

the height, in Pango units

pub fn get_strikethrough_position(&self) -> i32[src]

Gets the suggested position to draw the strikethrough. The value returned is the distance <emphasis>above</emphasis> the baseline of the top of the strikethrough.

Returns

the suggested strikethrough position, in Pango units.

pub fn get_strikethrough_thickness(&self) -> i32[src]

Gets the suggested thickness to draw for the strikethrough.

Returns

the suggested strikethrough thickness, in Pango units.

pub fn get_underline_position(&self) -> i32[src]

Gets the suggested position to draw the underline. The value returned is the distance <emphasis>above</emphasis> the baseline of the top of the underline. Since most fonts have underline positions beneath the baseline, this value is typically negative.

Returns

the suggested underline position, in Pango units.

pub fn get_underline_thickness(&self) -> i32[src]

Gets the suggested thickness to draw for the underline.

Returns

the suggested underline thickness, in Pango units.

Trait Implementations

impl Clone for FontMetrics

impl Debug for FontMetrics[src]

impl Eq for FontMetrics[src]

impl Hash for FontMetrics[src]

impl Ord for FontMetrics[src]

impl PartialEq<FontMetrics> for FontMetrics[src]

impl PartialOrd<FontMetrics> for FontMetrics[src]

impl StaticType for FontMetrics

impl StructuralEq for FontMetrics[src]

impl StructuralPartialEq for FontMetrics[src]

Auto Trait Implementations

impl RefUnwindSafe for FontMetrics

impl !Send for FontMetrics

impl !Sync for FontMetrics

impl Unpin for FontMetrics

impl UnwindSafe for FontMetrics

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.