summaryrefslogtreecommitdiff
path: root/src/entry_backend/pango.h
AgeCommit message (Collapse)Author
2022-06-23Combine Harfbuzz & Pango backends.Phil Jones
Tofi now uses Harfbuzz if a file is passed to --font-name, and Pango otherwise.
2022-06-23Remove Cairo scale factor.Phil Jones
The scale factor is now only used to scale font sizes, not all Cairo drawing operations. This makes pixel-sized options correct.
2022-06-10Remove unneeded Pango layouts.Phil Jones
We don't actually need a separate pango layout for each piece of text, as we only use them one-by-one anyway, so just use one instead.
2022-06-10Avoid an unnecessary copy of the image buffer.Phil Jones
By pointing Cairo at the mmap-ed file used to create wl_shm buffers, we can eliminate a memcpy() on every draw, providing a decent speedup (especially for large window sizes). This comes at the expense of having to keep track of two Cairo contexts, one for each of our two buffers used for double buffering. Additionally, a single memcpy() is still required for initialisation of the second buffer, so the startup latency isn't affected much.
2022-06-09Add Harfbuzz backend.Phil Jones
Another source of slow startup is initialising Pango. If the user supplies a ttf file, we can skip any Pango stuff and use Harfbuzz directly with Cairo to do our font rendering, providing a large speedup.