@@ -37,51 +37,51 @@ impl FontWeight {
3737 /// The minimum value for the font weight value. Unlike [`ffi::AFONT_WEIGHT_MIN`] being `0`,
3838 /// [`FontWeight::MIN`] is `1` to make the `MIN..MAX` range be inclusive, keeping consistency
3939 /// between [`FontWeight`] and other types like `std::num::NonZeroU*`.
40- pub const MIN : FontWeight = FontWeight ( ffi:: AFONT_WEIGHT_MIN as u16 + 1 ) ;
40+ pub const MIN : Self = Self ( ffi:: AFONT_WEIGHT_MIN as u16 + 1 ) ;
4141
4242 /// A font weight value for the thin weight.
43- pub const THIN : FontWeight = FontWeight ( ffi:: AFONT_WEIGHT_THIN as u16 ) ;
43+ pub const THIN : Self = Self ( ffi:: AFONT_WEIGHT_THIN as u16 ) ;
4444
4545 /// A font weight value for the extra-light weight.
46- pub const EXTRA_LIGHT : FontWeight = FontWeight ( ffi:: AFONT_WEIGHT_EXTRA_LIGHT as u16 ) ;
46+ pub const EXTRA_LIGHT : Self = Self ( ffi:: AFONT_WEIGHT_EXTRA_LIGHT as u16 ) ;
4747
4848 /// A font weight value for the light weight.
49- pub const LIGHT : FontWeight = FontWeight ( ffi:: AFONT_WEIGHT_LIGHT as u16 ) ;
49+ pub const LIGHT : Self = Self ( ffi:: AFONT_WEIGHT_LIGHT as u16 ) ;
5050
5151 /// A font weight value for the normal weight.
52- pub const NORMAL : FontWeight = FontWeight ( ffi:: AFONT_WEIGHT_NORMAL as u16 ) ;
52+ pub const NORMAL : Self = Self ( ffi:: AFONT_WEIGHT_NORMAL as u16 ) ;
5353
5454 /// A font weight value for the medium weight.
55- pub const MEDIUM : FontWeight = FontWeight ( ffi:: AFONT_WEIGHT_MEDIUM as u16 ) ;
55+ pub const MEDIUM : Self = Self ( ffi:: AFONT_WEIGHT_MEDIUM as u16 ) ;
5656
5757 /// A font weight value for the semi-bold weight.
58- pub const SEMI_BOLD : FontWeight = FontWeight ( ffi:: AFONT_WEIGHT_SEMI_BOLD as u16 ) ;
58+ pub const SEMI_BOLD : Self = Self ( ffi:: AFONT_WEIGHT_SEMI_BOLD as u16 ) ;
5959
6060 /// A font weight value for the bold weight.
61- pub const BOLD : FontWeight = FontWeight ( ffi:: AFONT_WEIGHT_BOLD as u16 ) ;
61+ pub const BOLD : Self = Self ( ffi:: AFONT_WEIGHT_BOLD as u16 ) ;
6262
6363 /// A font weight value for the extra-bold weight.
64- pub const EXTRA_BOLD : FontWeight = FontWeight ( ffi:: AFONT_WEIGHT_EXTRA_BOLD as u16 ) ;
64+ pub const EXTRA_BOLD : Self = Self ( ffi:: AFONT_WEIGHT_EXTRA_BOLD as u16 ) ;
6565
6666 /// A font weight value for the black weight.
67- pub const BLACK : FontWeight = FontWeight ( ffi:: AFONT_WEIGHT_BLACK as u16 ) ;
67+ pub const BLACK : Self = Self ( ffi:: AFONT_WEIGHT_BLACK as u16 ) ;
6868
6969 /// The maximum value for the font weight value.
70- pub const MAX : FontWeight = FontWeight ( ffi:: AFONT_WEIGHT_MAX as u16 ) ;
70+ pub const MAX : Self = Self ( ffi:: AFONT_WEIGHT_MAX as u16 ) ;
7171}
7272
7373impl fmt:: Display for FontWeight {
7474 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
7575 f. write_str ( match * self {
76- FontWeight :: THIN => "Thin" ,
77- FontWeight :: EXTRA_LIGHT => "Extra Light (Ultra Light)" ,
78- FontWeight :: LIGHT => "Light" ,
79- FontWeight :: NORMAL => "Normal (Regular)" ,
80- FontWeight :: MEDIUM => "Medium" ,
81- FontWeight :: SEMI_BOLD => "Semi Bold (Demi Bold)" ,
82- FontWeight :: BOLD => "Bold" ,
83- FontWeight :: EXTRA_BOLD => "Extra Bold (Ultra Bold)" ,
84- FontWeight :: BLACK => "Black (Heavy)" ,
76+ Self :: THIN => "Thin" ,
77+ Self :: EXTRA_LIGHT => "Extra Light (Ultra Light)" ,
78+ Self :: LIGHT => "Light" ,
79+ Self :: NORMAL => "Normal (Regular)" ,
80+ Self :: MEDIUM => "Medium" ,
81+ Self :: SEMI_BOLD => "Semi Bold (Demi Bold)" ,
82+ Self :: BOLD => "Bold" ,
83+ Self :: EXTRA_BOLD => "Extra Bold (Ultra Bold)" ,
84+ Self :: BLACK => "Black (Heavy)" ,
8585 _ => return writeln ! ( f, "{}" , self . 0 ) ,
8686 } )
8787 }
@@ -103,7 +103,7 @@ impl TryFrom<u16> for FontWeight {
103103 type Error = FontWeightValueError ;
104104
105105 fn try_from ( value : u16 ) -> Result < Self , Self :: Error > {
106- FontWeight :: new ( value)
106+ Self :: new ( value)
107107 }
108108}
109109
@@ -434,7 +434,7 @@ impl FontMatcher {
434434 pub fn new ( ) -> Self {
435435 let ptr = NonNull :: new ( unsafe { ffi:: AFontMatcher_create ( ) } )
436436 . expect ( "AFontMatcher_create returned NULL" ) ;
437- unsafe { FontMatcher :: from_ptr ( ptr) }
437+ unsafe { Self :: from_ptr ( ptr) }
438438 }
439439
440440 /// Performs the matching from the generic font family for the text and select one font.
@@ -532,7 +532,7 @@ impl SystemFontIterator {
532532 /// Creates a system font iterator.
533533 pub fn new ( ) -> Option < Self > {
534534 NonNull :: new ( unsafe { ffi:: ASystemFontIterator_open ( ) } )
535- . map ( |p| unsafe { SystemFontIterator :: from_ptr ( p) } )
535+ . map ( |p| unsafe { Self :: from_ptr ( p) } )
536536 }
537537}
538538
0 commit comments