pub trait FontMethods: GDIObjectMethods {
Show 38 methods
// Provided methods
fn get_base_font(&self) -> Font { ... }
fn get_face_name(&self) -> String { ... }
fn get_native_font_info_desc(&self) -> String { ... }
fn get_native_font_info_user_desc(&self) -> String { ... }
fn get_native_font_info(&self) -> Option<NativeFontInfoIsOwned<false>> { ... }
fn get_point_size(&self) -> c_int { ... }
fn get_fractional_point_size(&self) -> c_double { ... }
fn get_pixel_size(&self) -> Size { ... }
fn get_underlined(&self) -> bool { ... }
fn get_strikethrough(&self) -> bool { ... }
fn get_numeric_weight(&self) -> c_int { ... }
fn is_fixed_width(&self) -> bool { ... }
fn is_ok(&self) -> bool { ... }
fn add_private_font(filename: &str) -> bool { ... }
fn bold(&self) -> Font { ... }
fn italic(&self) -> Font { ... }
fn larger(&self) -> Font { ... }
fn smaller(&self) -> Font { ... }
fn underlined(&self) -> Font { ... }
fn strikethrough(&self) -> Font { ... }
fn make_bold(&self) -> &Self { ... }
fn make_italic(&self) -> &Self { ... }
fn make_larger(&self) -> &Self { ... }
fn make_smaller(&self) -> &Self { ... }
fn make_underlined(&self) -> &Self { ... }
fn make_strikethrough(&self) -> &Self { ... }
fn set_face_name(&self, face_name: &str) -> bool { ... }
fn set_native_font_info_str(&self, info: &str) -> bool { ... }
fn set_native_font_info_user_desc(&self, info: &str) -> bool { ... }
fn set_native_font_info_nativefontinfo<N: NativeFontInfoMethods>(
&self,
info: &N,
) { ... }
fn set_point_size(&self, point_size: c_int) { ... }
fn set_fractional_point_size(&self, point_size: c_double) { ... }
fn set_pixel_size<S: SizeMethods>(&self, pixel_size: &S) { ... }
fn set_underlined(&self, underlined: bool) { ... }
fn set_strikethrough(&self, strikethrough: bool) { ... }
fn set_numeric_weight(&self, weight: c_int) { ... }
fn new_nativefontinfo<N: NativeFontInfoMethods>(
native_info: &N,
) -> Option<FontIsOwned<false>> { ... }
fn new_str(native_info_string: &str) -> Option<FontIsOwned<false>> { ... }
}Expand description
This trait represents C++ wxFont class’s methods and inheritance.
See FontIsOwned documentation for the class usage.
Provided Methods§
Sourcefn 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.
Sourcefn 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.
Sourcefn get_native_font_info_desc(&self) -> String
fn get_native_font_info_desc(&self) -> String
Returns the platform-dependent string completely describing this font.
Sourcefn 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.
See C++ wxFont::GetNativeFontInfoUserDesc()’s documentation.
Sourcefn 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.
Sourcefn get_point_size(&self) -> c_int
fn get_point_size(&self) -> c_int
Gets the point size as an integer number.
Sourcefn get_fractional_point_size(&self) -> c_double
fn get_fractional_point_size(&self) -> c_double
Gets the point size as a floating number.
Sourcefn get_pixel_size(&self) -> Size
fn get_pixel_size(&self) -> Size
Gets the pixel size.
Sourcefn get_underlined(&self) -> bool
fn get_underlined(&self) -> bool
Returns true if the font is underlined, false otherwise.
Sourcefn get_strikethrough(&self) -> bool
fn get_strikethrough(&self) -> bool
Returns true if the font is stricken-through, false otherwise.
Sourcefn get_numeric_weight(&self) -> c_int
fn get_numeric_weight(&self) -> c_int
Gets the font weight as an integer value.
Sourcefn 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.
Sourcefn 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.
Sourcefn underlined(&self) -> Font
fn underlined(&self) -> Font
Returns underlined version of this font.
Sourcefn strikethrough(&self) -> Font
fn strikethrough(&self) -> Font
Returns stricken-through version of this font.
Sourcefn make_italic(&self) -> &Self
fn make_italic(&self) -> &Self
Changes this font to be italic.
Sourcefn make_larger(&self) -> &Self
fn make_larger(&self) -> &Self
Changes this font to be larger.
Sourcefn make_smaller(&self) -> &Self
fn make_smaller(&self) -> &Self
Changes this font to be smaller.
Sourcefn make_underlined(&self) -> &Self
fn make_underlined(&self) -> &Self
Changes this font to be underlined.
Sourcefn make_strikethrough(&self) -> &Self
fn make_strikethrough(&self) -> &Self
Changes this font to be stricken-through.
Sourcefn set_face_name(&self, face_name: &str) -> bool
fn set_face_name(&self, face_name: &str) -> bool
Sets the facename for the font.
Sourcefn 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().
Sourcefn 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.
See C++ wxFont::SetNativeFontInfoUserDesc()’s documentation.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn set_pixel_size<S: SizeMethods>(&self, pixel_size: &S)
fn set_pixel_size<S: SizeMethods>(&self, pixel_size: &S)
Sets the pixel size.
Sourcefn set_underlined(&self, underlined: bool)
fn set_underlined(&self, underlined: bool)
Sets underlining.
Sourcefn set_strikethrough(&self, strikethrough: bool)
fn set_strikethrough(&self, strikethrough: bool)
Sets strike-through attribute of the font.
Sourcefn set_numeric_weight(&self, weight: c_int)
fn set_numeric_weight(&self, weight: c_int)
Sets the font weight using an integer value.
Sourcefn 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.
Sourcefn new_str(native_info_string: &str) -> Option<FontIsOwned<false>>
fn new_str(native_info_string: &str) -> Option<FontIsOwned<false>>
Sets the encoding for this font.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".