mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-27 14:27:34 +00:00
owed by pdf-chrome-w3: Span::strikethrough (asked by pdf-print-ocr-w2, R-2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
00893772d3
commit
32ea853de0
@@ -294,6 +294,9 @@ impl TextRun<'_> {
|
||||
if span.underline {
|
||||
format.underline = egui::Stroke::new(env.tokens.stroke.thin, color);
|
||||
}
|
||||
if span.strikethrough {
|
||||
format.strikethrough = egui::Stroke::new(env.tokens.stroke.thin, color);
|
||||
}
|
||||
job.append(text_part, 0.0, format);
|
||||
}
|
||||
job
|
||||
|
||||
@@ -22,6 +22,8 @@ pub struct Span<'a> {
|
||||
pub highlight: bool,
|
||||
/// Underlined in the span's colour, `stroke.thin` wide, along the bottom of the line box.
|
||||
pub underline: bool,
|
||||
/// Struck through in the span's colour, `stroke.thin` wide, across the middle of the line box.
|
||||
pub strikethrough: bool,
|
||||
/// The role's semibold face, at the role's size.
|
||||
pub strong: bool,
|
||||
}
|
||||
@@ -38,6 +40,7 @@ impl<'a> Span<'a> {
|
||||
shortcut: false,
|
||||
highlight: false,
|
||||
underline: false,
|
||||
strikethrough: false,
|
||||
strong: false,
|
||||
}
|
||||
}
|
||||
@@ -84,6 +87,12 @@ impl<'a> Span<'a> {
|
||||
self
|
||||
}
|
||||
|
||||
/// Struck through: a word marked for removal.
|
||||
pub fn strikethrough(mut self) -> Self {
|
||||
self.strikethrough = true;
|
||||
self
|
||||
}
|
||||
|
||||
/// The role's semibold face: a short mark that stands out among the row's other text, such as a layer's `fx`.
|
||||
pub fn strong(mut self) -> Self {
|
||||
self.strong = true;
|
||||
|
||||
Reference in New Issue
Block a user