@@ -5,8 +5,8 @@ use crate::{
5
5
6
6
/// Functionality required from font data.
7
7
///
8
- /// See also [`FontArc`](struct. FontArc.html ), [`FontRef`](struct. FontRef.html )
9
- /// and [`FontVec`](struct. FontVec.html ).
8
+ /// See also [`FontArc`](crate:: FontArc), [`FontRef`](crate:: FontRef)
9
+ /// and [`FontVec`](crate:: FontVec).
10
10
///
11
11
/// ## Units
12
12
///
@@ -58,63 +58,63 @@ pub trait Font {
58
58
59
59
/// Unscaled glyph ascent.
60
60
///
61
- /// Scaling can be done with [as_scaled](trait.Font.html#method. as_scaled).
61
+ /// Scaling can be done with [` as_scaled`](Self:: as_scaled).
62
62
fn ascent_unscaled ( & self ) -> f32 ;
63
63
64
64
/// Unscaled glyph descent.
65
65
///
66
- /// Scaling can be done with [as_scaled](trait.Font.html#method. as_scaled).
66
+ /// Scaling can be done with [` as_scaled`](Self:: as_scaled).
67
67
fn descent_unscaled ( & self ) -> f32 ;
68
68
69
69
/// Unscaled height `ascent - descent`.
70
70
///
71
- /// Scaling can be done with [as_scaled](trait.Font.html#method. as_scaled).
71
+ /// Scaling can be done with [` as_scaled`](Self:: as_scaled).
72
72
#[ inline]
73
73
fn height_unscaled ( & self ) -> f32 {
74
74
self . ascent_unscaled ( ) - self . descent_unscaled ( )
75
75
}
76
76
77
77
/// Unscaled line gap.
78
78
///
79
- /// Scaling can be done with [as_scaled](trait.Font.html#method. as_scaled).
79
+ /// Scaling can be done with [` as_scaled`](Self:: as_scaled).
80
80
fn line_gap_unscaled ( & self ) -> f32 ;
81
81
82
82
/// Lookup a `GlyphId` matching a given `char`.
83
83
///
84
- /// Scaling can be done with [as_scaled](trait.Font.html#method. as_scaled).
84
+ /// Scaling can be done with [` as_scaled`](Self:: as_scaled).
85
85
fn glyph_id ( & self , c : char ) -> GlyphId ;
86
86
87
87
/// Unscaled horizontal advance for a given glyph id.
88
88
///
89
89
/// Returns `0.0` if the font does not define this value.
90
90
///
91
- /// Scaling can be done with [as_scaled](trait.Font.html#method. as_scaled).
91
+ /// Scaling can be done with [` as_scaled`](Self:: as_scaled).
92
92
fn h_advance_unscaled ( & self , id : GlyphId ) -> f32 ;
93
93
94
94
/// Unscaled horizontal side bearing for a given glyph id.
95
95
///
96
96
/// Returns `0.0` if the font does not define this value.
97
97
///
98
- /// Scaling can be done with [as_scaled](trait.Font.html#method. as_scaled).
98
+ /// Scaling can be done with [` as_scaled`](Self:: as_scaled).
99
99
fn h_side_bearing_unscaled ( & self , id : GlyphId ) -> f32 ;
100
100
101
101
/// Unscaled vertical advance for a given glyph id.
102
102
///
103
103
/// Returns `0.0` if the font does not define this value.
104
104
///
105
- /// Scaling can be done with [as_scaled](trait.Font.html#method. as_scaled).
105
+ /// Scaling can be done with [` as_scaled`](Self:: as_scaled).
106
106
fn v_advance_unscaled ( & self , id : GlyphId ) -> f32 ;
107
107
108
108
/// Unscaled vertical side bearing for a given glyph id.
109
109
///
110
110
/// Returns `0.0` if the font does not define this value.
111
111
///
112
- /// Scaling can be done with [as_scaled](trait.Font.html#method. as_scaled).
112
+ /// Scaling can be done with [` as_scaled`](Self:: as_scaled).
113
113
fn v_side_bearing_unscaled ( & self , id : GlyphId ) -> f32 ;
114
114
115
115
/// Returns additional unscaled kerning to apply for a particular pair of glyph ids.
116
116
///
117
- /// Scaling can be done with [as_scaled](trait.Font.html#method. as_scaled).
117
+ /// Scaling can be done with [` as_scaled`](Self:: as_scaled).
118
118
fn kern_unscaled ( & self , first : GlyphId , second : GlyphId ) -> f32 ;
119
119
120
120
/// Compute unscaled glyph outline curves & bounding box.
@@ -216,8 +216,7 @@ pub trait Font {
216
216
Some ( OutlinedGlyph :: new ( glyph, outline, scale_factor) )
217
217
}
218
218
219
- /// Construct a [`PxScaleFontRef`](struct.PxScaleFontRef.html) by associating with the
220
- /// given pixel `scale`.
219
+ /// Construct a [`PxScaleFont`] by associating with the given pixel `scale`.
221
220
///
222
221
/// # Example
223
222
/// ```
@@ -242,8 +241,7 @@ pub trait Font {
242
241
}
243
242
}
244
243
245
- /// Move into a [`PxScaleFont`](struct.PxScaleFont.html) associated with the
246
- /// given pixel `scale`.
244
+ /// Move into a [`PxScaleFont`] associated with the given pixel `scale`.
247
245
#[ inline]
248
246
fn into_scaled < S : Into < PxScale > > ( self , scale : S ) -> PxScaleFont < Self >
249
247
where
@@ -266,6 +264,8 @@ pub trait Font {
266
264
/// assert_eq!(font.font_data(), owned_font_data);
267
265
/// # Ok(()) }
268
266
/// ```
267
+ ///
268
+ /// [`FontArc::try_from_slice`]: crate::FontArc::try_from_slice
269
269
#[ inline]
270
270
fn font_data ( & self ) -> & [ u8 ] {
271
271
// panic impl prevents this method from breaking external Font impls
0 commit comments