Skip to content

Commit 75d10ae

Browse files
Use intra-doc link syntax and fix 2 broken links. (#104)
1 parent 21cd5f4 commit 75d10ae

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

glyph/src/font.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use crate::{
55

66
/// Functionality required from font data.
77
///
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).
1010
///
1111
/// ## Units
1212
///
@@ -58,63 +58,63 @@ pub trait Font {
5858

5959
/// Unscaled glyph ascent.
6060
///
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).
6262
fn ascent_unscaled(&self) -> f32;
6363

6464
/// Unscaled glyph descent.
6565
///
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).
6767
fn descent_unscaled(&self) -> f32;
6868

6969
/// Unscaled height `ascent - descent`.
7070
///
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).
7272
#[inline]
7373
fn height_unscaled(&self) -> f32 {
7474
self.ascent_unscaled() - self.descent_unscaled()
7575
}
7676

7777
/// Unscaled line gap.
7878
///
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).
8080
fn line_gap_unscaled(&self) -> f32;
8181

8282
/// Lookup a `GlyphId` matching a given `char`.
8383
///
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).
8585
fn glyph_id(&self, c: char) -> GlyphId;
8686

8787
/// Unscaled horizontal advance for a given glyph id.
8888
///
8989
/// Returns `0.0` if the font does not define this value.
9090
///
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).
9292
fn h_advance_unscaled(&self, id: GlyphId) -> f32;
9393

9494
/// Unscaled horizontal side bearing for a given glyph id.
9595
///
9696
/// Returns `0.0` if the font does not define this value.
9797
///
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).
9999
fn h_side_bearing_unscaled(&self, id: GlyphId) -> f32;
100100

101101
/// Unscaled vertical advance for a given glyph id.
102102
///
103103
/// Returns `0.0` if the font does not define this value.
104104
///
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).
106106
fn v_advance_unscaled(&self, id: GlyphId) -> f32;
107107

108108
/// Unscaled vertical side bearing for a given glyph id.
109109
///
110110
/// Returns `0.0` if the font does not define this value.
111111
///
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).
113113
fn v_side_bearing_unscaled(&self, id: GlyphId) -> f32;
114114

115115
/// Returns additional unscaled kerning to apply for a particular pair of glyph ids.
116116
///
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).
118118
fn kern_unscaled(&self, first: GlyphId, second: GlyphId) -> f32;
119119

120120
/// Compute unscaled glyph outline curves & bounding box.
@@ -216,8 +216,7 @@ pub trait Font {
216216
Some(OutlinedGlyph::new(glyph, outline, scale_factor))
217217
}
218218

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`.
221220
///
222221
/// # Example
223222
/// ```
@@ -242,8 +241,7 @@ pub trait Font {
242241
}
243242
}
244243

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`.
247245
#[inline]
248246
fn into_scaled<S: Into<PxScale>>(self, scale: S) -> PxScaleFont<Self>
249247
where
@@ -266,6 +264,8 @@ pub trait Font {
266264
/// assert_eq!(font.font_data(), owned_font_data);
267265
/// # Ok(()) }
268266
/// ```
267+
///
268+
/// [`FontArc::try_from_slice`]: crate::FontArc::try_from_slice
269269
#[inline]
270270
fn font_data(&self) -> &[u8] {
271271
// panic impl prevents this method from breaking external Font impls

glyph/src/scale.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub struct PxScaleFactor {
5353
pub vertical: f32,
5454
}
5555

56-
/// A [`Font`](trait.Font.html) with an associated pixel scale. This can be used to provide
56+
/// A [`Font`] with an associated pixel scale. This can be used to provide
5757
/// pixel scale values for glyph advances, heights etc.
5858
///
5959
/// # Example
@@ -135,7 +135,7 @@ pub trait ScaleFont<F: Font> {
135135
self.font().glyph_id(c)
136136
}
137137

138-
/// Construct a [`Glyph`](struct.Glyph.html) with the font's pixel scale at
138+
/// Construct a [`Glyph`] with the font's pixel scale at
139139
/// position `point(0.0, 0.0)`.
140140
///
141141
/// # Example
@@ -207,7 +207,7 @@ pub trait ScaleFont<F: Font> {
207207

208208
/// Returns an iterator of all distinct `(GlyphId, char)` pairs. Not ordered.
209209
///
210-
/// Same as [`Font::codepoint_ids`](trait.Font.html#tymethod.codepoint_ids).
210+
/// Same as [`Font::codepoint_ids`].
211211
fn codepoint_ids(&self) -> crate::CodepointIdIter<'_>;
212212

213213
/// Compute glyph outline ready for drawing.
@@ -237,7 +237,7 @@ impl<F: Font, SF: ScaleFont<F>> ScaleFont<F> for &SF {
237237
}
238238
}
239239

240-
/// A [`Font`](trait.Font.html) and an associated pixel scale.
240+
/// A [`Font`] and an associated pixel scale.
241241
#[derive(Clone, Copy, Debug)]
242242
pub struct PxScaleFont<F> {
243243
pub font: F,

glyph/src/ttfp.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ impl From<GlyphId> for ttfp::GlyphId {
1818
}
1919

2020
/// Font data handle stored as a `&[u8]` + parsed data.
21-
/// See [`Font`](trait.Font.html) for more methods.
21+
/// See [`Font`] for more methods.
2222
///
23-
/// Also see the owned version [`FontVec`](struct.FontVec.html).
23+
/// Also see the owned version [`FontVec`].
2424
///
2525
/// # Example
2626
/// ```
@@ -45,7 +45,7 @@ impl<'font> FontRef<'font> {
4545
/// Creates an `FontRef` from a byte-slice.
4646
///
4747
/// For font collections see
48-
/// [`FontRef::try_from_slice_and_index`](#method.try_from_slice_and_index).
48+
/// [`FontRef::try_from_slice_and_index`].
4949
///
5050
/// # Example
5151
/// ```
@@ -62,7 +62,7 @@ impl<'font> FontRef<'font> {
6262
/// Creates an `FontRef` from byte-slice.
6363
///
6464
/// You can set index for font collections. For simple fonts use `0` or
65-
/// [`FontRef::try_from_slice`](#method.try_from_slice).
65+
/// [`FontRef::try_from_slice`].
6666
///
6767
/// # Example
6868
/// ```
@@ -81,9 +81,9 @@ impl<'font> FontRef<'font> {
8181
}
8282

8383
/// Font data handle stored in a `Vec<u8>` + parsed data.
84-
/// See [`Font`](trait.Font.html) for more methods.
84+
/// See [`Font`] for more methods.
8585
///
86-
/// Also see [`FontRef`](struct.FontRef.html).
86+
/// Also see [`FontRef`].
8787
///
8888
/// # Example
8989
/// ```
@@ -108,7 +108,7 @@ impl FontVec {
108108
/// Creates an `FontVec` from owned data.
109109
///
110110
/// For font collections see
111-
/// [`FontVec::try_from_vec_and_index`](#method.try_from_vec_and_index).
111+
/// [`FontVec::try_from_vec_and_index`].
112112
///
113113
/// # Example
114114
/// ```
@@ -126,7 +126,7 @@ impl FontVec {
126126
/// Creates an `FontVec` from owned data.
127127
///
128128
/// You can set index for font collections. For simple fonts use `0` or
129-
/// [`FontVec::try_from_vec`](#method.try_from_vec).
129+
/// [`FontVec::try_from_vec`].
130130
///
131131
/// # Example
132132
/// ```

rasterizer/src/geometry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl Point {
2828
}
2929
}
3030

31-
/// [`Point`](struct.Point.html) constructor.
31+
/// [`Point`] constructor.
3232
///
3333
/// # Example
3434
/// ```

0 commit comments

Comments
 (0)