Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl DPU {
}
pub(crate) fn to_line_metrics(self, metrics: ttf_parser::LineMetrics) -> LineMetrics {
LineMetrics {
position: self.i16_to_px(metrics.position),
top: self.i16_to_px(metrics.position),
thickness: self.i16_to_px(metrics.thickness),
}
}
Expand All @@ -56,6 +56,11 @@ impl DPU {
/// Metrics for line marks
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct LineMetrics {
pub position: f32,
/// The vertical position of the top of the line
pub top: f32,
/// The recommended thickness of the line
///
/// Be aware that `top` and `top + thickness` could round to the same value,
/// thus adjustments might be necessary to ensure visibility of the line.
pub thickness: f32,
}
Loading
Loading