textwidth

Crates.iotextwidth
lib.rstextwidth
version2.1.0
sourcesrc
created_at2018-07-01 12:18:02.922608
updated_at2020-10-21 17:04:17.181569
descriptionGet the width of a piece of text for a font through xlib
homepage
repository
max_upload_size
id72414
size8,677
Marcel Müller (TheNeikos)

documentation

README

textwidth

Documentation

A simple library to query a textwidth of a given font+size.

This is only supported on Linux and similar environments. Others are not planned as the author does not have one. PRs welcome.

⚠️ You have to call setup_multithreading if you plan on using multiple Context in a multi-threaded way, or if you are using x11/xlib in a multi-threaded fashion.

Example

use textwidth::Context;

let ctx = Context::with_misc().unwrap();
assert!(ctx.text_width("Hello World") > 0);
Commit count: 0

cargo fmt