diff --git a/.gitignore b/.gitignore index 26038bd..05025d2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,14 +4,16 @@ Cargo.lock *.swp +# IDE configs +.idea/ +.vscode/ + # Potential products from TeX while testing *.pdf *.log *.aux *.iml -.vscode - # Product of `qc` binary test.svg diff --git a/fonts/stix2/src/style.rs b/fonts/stix2/src/style.rs index bba7e23..12364de 100644 --- a/fonts/stix2/src/style.rs +++ b/fonts/stix2/src/style.rs @@ -77,11 +77,11 @@ static DIGIT_LUT: [u32; 28] = [ #[inline] pub fn style_symbol(codepoint: u32, style: Style) -> u32 { match codepoint { - LOWER_A...LOWER_Z => style_lookup(&LATIN_LOWER_LUT, codepoint, style), - UPPER_A...UPPER_Z => style_lookup(&LATIN_UPPER_LUT, codepoint, style), - UPPER_ALPHA...UPPER_OMEGA => style_lookup(&GREEK_UPPER_LUT, codepoint, style), - LOWER_ALPHA...LOWER_OMEGA => style_lookup(&GREEK_LOWER_LUT, codepoint, style), - DIGIT_0...DIGIT_9 => style_lookup(&DIGIT_LUT, codepoint, style), + LOWER_A..=LOWER_Z => style_lookup(&LATIN_LOWER_LUT, codepoint, style), + UPPER_A..=UPPER_Z => style_lookup(&LATIN_UPPER_LUT, codepoint, style), + UPPER_ALPHA..=UPPER_OMEGA => style_lookup(&GREEK_UPPER_LUT, codepoint, style), + LOWER_ALPHA..=LOWER_OMEGA => style_lookup(&GREEK_LOWER_LUT, codepoint, style), + DIGIT_0..=DIGIT_9 => style_lookup(&DIGIT_LUT, codepoint, style), _ => style_other(codepoint, style), } } diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 05ee0b0..050f0ae 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -308,7 +308,6 @@ impl Style { } fn font_scale(self) -> FontUnit { - use font::constants; match self { Style::Display | Style::DisplayCramped | Style::Text | Style::TextCramped => { FontUnit::from(1) diff --git a/src/parser/engine.rs b/src/parser/engine.rs index 805a4f2..5292c7e 100644 --- a/src/parser/engine.rs +++ b/src/parser/engine.rs @@ -176,7 +176,7 @@ pub fn command(lex: &mut Lexer, local: Style) -> Result> { } } -/// Parse an implicit group. For example `\left ... \right` is an implicit group. +/// Parse an implicit group. For example `\left ..= \right` is an implicit group. /// This is one point where we will deviate from TeX a little bit. We won't /// characterize every command that will start a new implicit group /// (for instance, `\frac`). @@ -403,7 +403,7 @@ pub fn parse(input: &str) -> Result> { /// negatives when used for other things. fn codepoint_atom_type(codepoint: char) -> Option { Some(match codepoint { - 'a'...'z' | 'A'...'Z' | '0'...'9' | 'Α'...'Ω' | 'α'...'ω' => AtomType::Alpha, + 'a'..='z' | 'A'..='Z' | '0'..='9' | 'Α'..='Ω' | 'α'..='ω' => AtomType::Alpha, '*' | '+' | '-' => AtomType::Binary, '[' | '(' => AtomType::Open, ']' | ')' | '?' | '!' => AtomType::Close, diff --git a/src/render/svg.rs b/src/render/svg.rs index 0e6edcd..a011783 100644 --- a/src/render/svg.rs +++ b/src/render/svg.rs @@ -16,8 +16,6 @@ pub fn render_to_path>(path: P, settings: &RenderSettings, input: } pub fn render_to_file(file: &mut File, settings: &RenderSettings, input: &str) { - use std::io::Write; - let s: Vec = SVGRenderer::new(&settings) .render(input) .expect("failed to render");