|
|
@ -31,7 +31,10 @@ mod filters {
|
|
|
|
use crate::svg::{SVGMeasure, SVGUnit};
|
|
|
|
use crate::svg::{SVGMeasure, SVGUnit};
|
|
|
|
|
|
|
|
|
|
|
|
pub fn kle_font_units(kle_font_units: &usize) -> askama::Result<SVGMeasure> {
|
|
|
|
pub fn kle_font_units(kle_font_units: &usize) -> askama::Result<SVGMeasure> {
|
|
|
|
Ok(SVGMeasure::new((6 + kle_font_units * 2) as f64, SVGUnit::Pixel))
|
|
|
|
Ok(SVGMeasure::new(
|
|
|
|
|
|
|
|
(6 + kle_font_units * 2) as f64,
|
|
|
|
|
|
|
|
SVGUnit::Pixel,
|
|
|
|
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -45,8 +48,14 @@ pub enum Error {
|
|
|
|
pub type Result<T> = std::result::Result<T, Error>;
|
|
|
|
pub type Result<T> = std::result::Result<T, Error>;
|
|
|
|
|
|
|
|
|
|
|
|
pub fn render_file<P, Q>(input_path: P, output_path: Q) -> Result<()>
|
|
|
|
pub fn render_file<P, Q>(input_path: P, output_path: Q) -> Result<()>
|
|
|
|
where P: AsRef<Path>, Q: AsRef<Path> {
|
|
|
|
where
|
|
|
|
use std::{fs::{self, OpenOptions}, io::Write};
|
|
|
|
P: AsRef<Path>,
|
|
|
|
|
|
|
|
Q: AsRef<Path>,
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
use std::{
|
|
|
|
|
|
|
|
fs::{self, OpenOptions},
|
|
|
|
|
|
|
|
io::Write,
|
|
|
|
|
|
|
|
};
|
|
|
|
let mut file = OpenOptions::new()
|
|
|
|
let mut file = OpenOptions::new()
|
|
|
|
.write(true)
|
|
|
|
.write(true)
|
|
|
|
.truncate(true)
|
|
|
|
.truncate(true)
|
|
|
|