pub struct FontIsOwned<const OWNED: bool>(/* private fields */);Expand description
A font is an object which determines the appearance of text.
Fontrepresents a C++wxFontclass instance which your code has ownership,FontIsOwned<false>represents one which don’t own.- Use
Font’snew()orBuildable::builder()(if available) to create an instance of this class. - See C++
wxFontclass’s documentation for more details.
Implementations§
Source§impl<const OWNED: bool> FontIsOwned<OWNED>
impl<const OWNED: bool> FontIsOwned<OWNED>
Sourcepub fn new() -> FontIsOwned<OWNED>
pub fn new() -> FontIsOwned<OWNED>
Default ctor.
Sourcepub fn new_with_font<F: FontMethods>(font: &F) -> FontIsOwned<OWNED>
pub fn new_with_font<F: FontMethods>(font: &F) -> FontIsOwned<OWNED>
Copy constructor, uses reference counting.
Sourcepub fn new_with_fontinfo(font_info: *const c_void) -> FontIsOwned<OWNED>
pub fn new_with_fontinfo(font_info: *const c_void) -> FontIsOwned<OWNED>
Creates a font object using the specified font description.
Sourcepub fn new_with_str(native_info_string: &str) -> FontIsOwned<OWNED>
pub fn new_with_str(native_info_string: &str) -> FontIsOwned<OWNED>
Constructor from font description string.
Sourcepub fn new_with_nativefontinfo<N: NativeFontInfoMethods>(
native_info: &N,
) -> FontIsOwned<OWNED>
pub fn new_with_nativefontinfo<N: NativeFontInfoMethods>( native_info: &N, ) -> FontIsOwned<OWNED>
Construct font from a native font info structure.
pub fn none() -> Option<&'static Self>
Trait Implementations§
Source§impl Clone for FontIsOwned<false>
impl Clone for FontIsOwned<false>
Source§impl<const OWNED: bool> Drop for FontIsOwned<OWNED>
impl<const OWNED: bool> Drop for FontIsOwned<OWNED>
Source§impl<const OWNED: bool> DynamicCast for FontIsOwned<OWNED>
impl<const OWNED: bool> DynamicCast for FontIsOwned<OWNED>
fn class_info() -> ClassInfoIsOwned<false>
fn as_unowned<T>(&self) -> Option<<T as WxRustMethods>::Unowned>where
T: DynamicCast,
Source§impl<const OWNED: bool> FontMethods for FontIsOwned<OWNED>
impl<const OWNED: bool> FontMethods for FontIsOwned<OWNED>
Source§fn get_base_font(&self) -> Font
fn get_base_font(&self) -> Font
Returns a font with the same face/size as the given one but with normal weight and style and not underlined nor stricken through. Read more
Source§fn get_face_name(&self) -> String
fn get_face_name(&self) -> String
Returns the face name associated with the font, or the empty string if there is no face information. Read more
Source§fn get_native_font_info_desc(&self) -> String
fn get_native_font_info_desc(&self) -> String
Returns the platform-dependent string completely describing this font. Read more
Source§fn get_native_font_info_user_desc(&self) -> String
fn get_native_font_info_user_desc(&self) -> String
Returns a user-friendly string for this font object. Read more
Source§fn get_native_font_info(&self) -> Option<NativeFontInfoIsOwned<false>>
fn get_native_font_info(&self) -> Option<NativeFontInfoIsOwned<false>>
Returns a font with the same face/size as the given one but with normal weight and style and not underlined nor stricken through. Read more
Source§fn get_point_size(&self) -> c_int
fn get_point_size(&self) -> c_int
Gets the point size as an integer number. Read more
Source§fn get_fractional_point_size(&self) -> c_double
fn get_fractional_point_size(&self) -> c_double
Gets the point size as a floating number. Read more
Source§fn get_pixel_size(&self) -> Size
fn get_pixel_size(&self) -> Size
Gets the pixel size. Read more
Source§fn get_underlined(&self) -> bool
fn get_underlined(&self) -> bool
Returns true if the font is underlined, false otherwise. Read more
Source§fn get_strikethrough(&self) -> bool
fn get_strikethrough(&self) -> bool
Returns true if the font is stricken-through, false otherwise. Read more
Source§fn get_numeric_weight(&self) -> c_int
fn get_numeric_weight(&self) -> c_int
Gets the font weight as an integer value. Read more
Source§fn is_fixed_width(&self) -> bool
fn is_fixed_width(&self) -> bool
Returns true if the font is a fixed width (or monospaced) font, false if it is a proportional one or font is invalid. Read more
Source§fn is_ok(&self) -> bool
fn is_ok(&self) -> bool
Returns true if this object is a valid font, false otherwise. Read more
Source§fn add_private_font(filename: &str) -> bool
fn add_private_font(filename: &str) -> bool
Specify the name of a file containing a TrueType font to be made available to the current application. Read more
Source§fn underlined(&self) -> Font
fn underlined(&self) -> Font
Returns underlined version of this font. Read more
Source§fn strikethrough(&self) -> Font
fn strikethrough(&self) -> Font
Returns stricken-through version of this font. Read more
Source§fn make_italic(&self) -> &Self
fn make_italic(&self) -> &Self
Changes this font to be italic. Read more
Source§fn make_larger(&self) -> &Self
fn make_larger(&self) -> &Self
Changes this font to be larger. Read more
Source§fn make_smaller(&self) -> &Self
fn make_smaller(&self) -> &Self
Changes this font to be smaller. Read more
Source§fn make_underlined(&self) -> &Self
fn make_underlined(&self) -> &Self
Changes this font to be underlined. Read more
Source§fn make_strikethrough(&self) -> &Self
fn make_strikethrough(&self) -> &Self
Changes this font to be stricken-through. Read more
Source§fn set_native_font_info_str(&self, info: &str) -> bool
fn set_native_font_info_str(&self, info: &str) -> bool
Creates the font corresponding to the given native font description string which must have been previously returned by GetNativeFontInfoDesc(). Read more
Source§fn set_native_font_info_user_desc(&self, info: &str) -> bool
fn set_native_font_info_user_desc(&self, info: &str) -> bool
Creates the font corresponding to the given native font description string and returns true if the creation was successful. Read more
Source§fn set_native_font_info_nativefontinfo<N: NativeFontInfoMethods>(
&self,
info: &N,
)
fn set_native_font_info_nativefontinfo<N: NativeFontInfoMethods>( &self, info: &N, )
Sets the encoding for this font. Read more
Source§fn set_point_size(&self, point_size: c_int)
fn set_point_size(&self, point_size: c_int)
Sets the font size in points to an integer value. Read more
Source§fn set_fractional_point_size(&self, point_size: c_double)
fn set_fractional_point_size(&self, point_size: c_double)
Sets the font size in points. Read more
Source§fn set_pixel_size<S: SizeMethods>(&self, pixel_size: &S)
fn set_pixel_size<S: SizeMethods>(&self, pixel_size: &S)
Sets the pixel size. Read more
Source§fn set_underlined(&self, underlined: bool)
fn set_underlined(&self, underlined: bool)
Sets underlining. Read more
Source§fn set_strikethrough(&self, strikethrough: bool)
fn set_strikethrough(&self, strikethrough: bool)
Sets strike-through attribute of the font. Read more
Source§fn set_numeric_weight(&self, weight: c_int)
fn set_numeric_weight(&self, weight: c_int)
Sets the font weight using an integer value. Read more
Source§fn new_nativefontinfo<N: NativeFontInfoMethods>(
native_info: &N,
) -> Option<FontIsOwned<false>>
fn new_nativefontinfo<N: NativeFontInfoMethods>( native_info: &N, ) -> Option<FontIsOwned<false>>
Sets the encoding for this font. Read more
Source§impl<const OWNED: bool> From<FontIsOwned<OWNED>> for GDIObjectIsOwned<OWNED>
impl<const OWNED: bool> From<FontIsOwned<OWNED>> for GDIObjectIsOwned<OWNED>
Source§fn from(o: FontIsOwned<OWNED>) -> Self
fn from(o: FontIsOwned<OWNED>) -> Self
Converts to this type from the input type.
Source§impl<const OWNED: bool> From<FontIsOwned<OWNED>> for ObjectIsOwned<OWNED>
impl<const OWNED: bool> From<FontIsOwned<OWNED>> for ObjectIsOwned<OWNED>
Source§fn from(o: FontIsOwned<OWNED>) -> Self
fn from(o: FontIsOwned<OWNED>) -> Self
Converts to this type from the input type.
Source§impl<const OWNED: bool> ObjectMethods for FontIsOwned<OWNED>
impl<const OWNED: bool> ObjectMethods for FontIsOwned<OWNED>
Source§fn get_class_info(&self) -> Option<ClassInfoIsOwned<false>>
fn get_class_info(&self) -> Option<ClassInfoIsOwned<false>>
This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar). Read more
Source§fn get_ref_data(&self) -> Option<ObjectRefDataIsOwned<false>>
fn get_ref_data(&self) -> Option<ObjectRefDataIsOwned<false>>
Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. Read more
Source§fn is_kind_of<C>(&self, info: Option<&C>) -> boolwhere
C: ClassInfoMethods,
fn is_kind_of<C>(&self, info: Option<&C>) -> boolwhere
C: ClassInfoMethods,
Determines whether this class is a subclass of (or the same class as) the given class. Read more
Source§fn is_same_as<O>(&self, obj: &O) -> boolwhere
O: ObjectMethods,
fn is_same_as<O>(&self, obj: &O) -> boolwhere
O: ObjectMethods,
Returns true if this object has the same data pointer as obj. Read more
Source§fn ref_<O>(&self, clone: &O)where
O: ObjectMethods,
fn ref_<O>(&self, clone: &O)where
O: ObjectMethods,
Makes this object refer to the data in clone. Read more
Source§fn set_ref_data<O>(&self, data: Option<&O>)where
O: ObjectRefDataMethods,
fn set_ref_data<O>(&self, data: Option<&O>)where
O: ObjectRefDataMethods,
Sets the wxObject::m_refData pointer. Read more
Source§fn un_ref(&self)
fn un_ref(&self)
Decrements the reference count in the associated data, and if it is zero, deletes the data. Read more
This is the same of AllocExclusive() but this method is public. Read more
Source§impl<const OWNED: bool> WxRustMethods for FontIsOwned<OWNED>
impl<const OWNED: bool> WxRustMethods for FontIsOwned<OWNED>
type Unowned = FontIsOwned<false>
unsafe fn as_ptr(&self) -> *mut c_void
unsafe fn from_ptr(ptr: *mut c_void) -> Self
unsafe fn from_unowned_ptr(ptr: *mut c_void) -> Self::Unowned
unsafe fn with_ptr<F: Fn(&Self)>(ptr: *mut c_void, closure: F)
unsafe fn option_from(ptr: *mut c_void) -> Option<Self::Unowned>where
Self: Sized,
impl<const OWNED: bool> GDIObjectMethods for FontIsOwned<OWNED>
Auto Trait Implementations§
impl<const OWNED: bool> Freeze for FontIsOwned<OWNED>
impl<const OWNED: bool> RefUnwindSafe for FontIsOwned<OWNED>
impl<const OWNED: bool> !Send for FontIsOwned<OWNED>
impl<const OWNED: bool> !Sync for FontIsOwned<OWNED>
impl<const OWNED: bool> Unpin for FontIsOwned<OWNED>
impl<const OWNED: bool> UnwindSafe for FontIsOwned<OWNED>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more