MCPcopy Create free account
hub / github.com/bytesnake/vim-graphical-preview / char_pixel_height

Function char_pixel_height

src/utils.rs:22–39  ·  view source on GitHub ↗

Get pixel height of a character

()

Source from the content-addressed store, hash-verified

20
21/// Get pixel height of a character
22pub 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
42pub fn generate_svg_from_latex(path: &Path, zoom: f32) -> Result<PathBuf> {

Callers 1

update_metadataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected