Skip to content

Commit 658f100

Browse files
committed
chore: fix compilation error
1 parent b08d18d commit 658f100

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

crates/sdo-pdf/src/font.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,10 @@ pub fn type3_font<'a>(
201201
let sig_origin_y = font_metrics.baseline;
202202
let sig_upper_y = sig_origin_y - pchar.top as i32;
203203
let sig_lower_y = sig_upper_y - pchar.height as i32;
204-
max_above_baseline = max_above_baseline.max(sig_upper_y * font_metrics.fontunits_per_pixel_y as i32 / 4);
205-
max_below_baseline = max_below_baseline.min(sig_lower_y * font_metrics.fontunits_per_pixel_y as i32 / 4);
204+
max_above_baseline =
205+
max_above_baseline.max(sig_upper_y * font_metrics.fontunits_per_pixel_y as i32);
206+
max_below_baseline =
207+
max_below_baseline.min(sig_lower_y * font_metrics.fontunits_per_pixel_y as i32);
206208
} else {
207209
// FIXME: empty glyph for non-printable characters?
208210
}

crates/sdo-pdf/src/info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub fn prepare_info(info: &mut Info, meta: &MetaInfo) -> Result<(), PDFDocEncodi
3939
}
4040

4141
/// Add a simple output intend for PDF/A
42-
///
42+
///
4343
/// This is not yet properly implemented
4444
pub fn prepare_pdfa_output_intent(hnd: &mut Handle) -> crate::Result<()> {
4545
// Output intents

crates/sdo-pdf/src/sdoc/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,17 @@ fn write_pdf_page_text<O: io::Write>(
8080
})?;
8181
let width = {
8282
let w = fi.width(te.cval);
83-
if is_wide { w * 2 } else { w }
83+
if is_wide {
84+
w * 2
85+
} else {
86+
w
87+
}
8488
};
8589

8690
// FIXME: font_size is multiplied by 0.5 to support "small"
8791
contents.cset(te.cset, font_size).map_err(Error::Contents)?;
8892
contents.fwidth(font_width).map_err(Error::Contents)?;
89-
93+
9094
let mut diff = (offset as i32) - (prev_width as i32);
9195
if diff != 0 {
9296
if is_wide {

crates/sdo-pdf/src/sdoc/text.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl<O: io::Write> TextContents<O> {
191191
pub(crate) fn slant(&mut self, is_italic: bool) -> io::Result<()> {
192192
let slant = match is_italic {
193193
true => 0.25, // 1:4 slant
194-
false => 0.0, // no slant
194+
false => 0.0, // no slant
195195
};
196196
if slant != self.slant {
197197
self.flush()?;

src/cli/sdoc/ps.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ fn output_ps_writer(
1919
pd: FontKind,
2020
pw: &mut PsWriter<impl Write>,
2121
) -> eyre::Result<()> {
22-
let (hdpi, vdpi) = pd.resolution();
22+
let resolution = pd.resolution();
23+
let hdpi = resolution.x;
24+
let vdpi = resolution.y;
2325

2426
pw.write_magic()?;
2527
pw.write_meta_field("Creator", "Signum! Document Toolbox v0.3")?;

0 commit comments

Comments
 (0)