Get pixel height of a character
()
| 20 | |
| 21 | /// Get pixel height of a character |
| 22 | pub fn char_pixel_height() -> usize { |
| 23 | ioctl_read_bad! { tiocgwinsz, 21523, Winsize } |
| 24 | |
| 25 | let mut size = Winsize { |
| 26 | ws_row: 0, |
| 27 | ws_col: 0, |
| 28 | ws_xpixel: 0, |
| 29 | ws_ypixel: 0 |
| 30 | }; |
| 31 | |
| 32 | unsafe {tiocgwinsz(0, &mut size).unwrap() }; |
| 33 | |
| 34 | if size.ws_ypixel > 2 { |
| 35 | size.ws_ypixel as usize / size.ws_row as usize |
| 36 | } else { |
| 37 | 28 |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | /// Generate SVG file from latex file with given zoom |
| 42 | pub fn generate_svg_from_latex(path: &Path, zoom: f32) -> Result<PathBuf> { |