cairo

Struct FontFace

Source
pub struct FontFace { /* private fields */ }
Expand description

GLib type: Shared boxed type with reference counted clone semantics.

Implementations§

Source§

impl FontFace

Source

pub fn as_ptr(&self) -> *mut cairo_font_face_t

Return the inner pointer to the underlying C value.

Source

pub unsafe fn from_glib_ptr_borrow(ptr: &*mut cairo_font_face_t) -> &Self

Borrows the underlying C value.

Source§

impl FontFace

Source

pub fn toy_create( family: &str, slant: FontSlant, weight: FontWeight, ) -> Result<FontFace, Error>

Source

pub fn create_from_ft(face: &Face) -> Result<FontFace, Error>

Available on crate feature freetype only.

Creates a new font face for the FreeType backend from an already opened FreeType face.

Source

pub fn create_from_ft_with_flags( face: &Face, load_flags: c_int, ) -> Result<FontFace, Error>

Available on crate feature freetype only.

Creates a new font face for the FreeType backend from an already opened FreeType face, additionally allowing you to pass flags to the underlying C API.

Source

pub unsafe fn from_raw_full(ptr: *mut cairo_font_face_t) -> FontFace

Source

pub unsafe fn from_raw_none(ptr: *mut cairo_font_face_t) -> FontFace

Source

pub fn to_raw_none(&self) -> *mut cairo_font_face_t

Source

pub fn toy_get_family(&self) -> Option<String>

Source

pub fn toy_get_slant(&self) -> FontSlant

Source

pub fn toy_get_weight(&self) -> FontWeight

Source

pub fn type_(&self) -> FontType

Source

pub fn reference_count(&self) -> usize

Source

pub fn synthesize(&self) -> FtSynthesize

Source

pub fn set_synthesize(&self, synth_flags: FtSynthesize)

Source

pub fn unset_synthesize(&self, synth_flags: FtSynthesize)

Source

pub fn status(&self) -> Result<(), Error>

Source

pub fn set_user_data<T: 'static>( &self, key: &'static UserDataKey<T>, value: Rc<T>, ) -> Result<(), Error>

Attach user data to self for the given key.

Source

pub fn user_data<T: 'static>( &self, key: &'static UserDataKey<T>, ) -> Option<Rc<T>>

Return the user data previously attached to self with the given key, if any.

Source

pub fn user_data_ptr<T: 'static>( &self, key: &'static UserDataKey<T>, ) -> Option<NonNull<T>>

Return the user data previously attached to self with the given key, if any, without incrementing the reference count.

The pointer is valid when it is returned from this method, until the cairo object that self represents is destroyed or remove_user_data or set_user_data is called with the same key.

Source

pub fn remove_user_data<T: 'static>( &self, key: &'static UserDataKey<T>, ) -> Result<(), Error>

Unattached from self the user data associated with key, if any. If there is no other Rc strong reference, the data is destroyed.

Trait Implementations§

Source§

impl Clone for FontFace

Source§

fn clone(&self) -> Self

Makes a clone of this shared reference.

This increments the strong reference count of the reference. Dropping the reference will decrement it again.

1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FontFace

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<FontFace> for Value

Source§

fn from(s: FontFace) -> Self

Converts to this type from the input type.
Source§

impl HasParamSpec for FontFace

Source§

type ParamSpec = ParamSpecBoxed

Source§

type SetValue = FontFace

Preferred value to be used as setter for the associated ParamSpec.
Source§

type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, FontFace>

Source§

fn param_spec_builder() -> Self::BuilderFn

Source§

impl StaticType for FontFace

Source§

fn static_type() -> Type

Returns the type identifier of Self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoClosureReturnValue for T
where T: Into<Value>,

Source§

impl<T> Property for T
where T: HasParamSpec,

Source§

type Value = T

Source§

impl<T> PropertyGet for T
where T: HasParamSpec,

Source§

type Value = T

Source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

Source§

impl<T> StaticTypeExt for T
where T: StaticType,

Source§

fn ensure_type()

Ensures that the type has been registered with the type system.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TransparentType for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,