Age | Commit message (Collapse) | Author |
|
I had misunderstood the purpose of the OpenType line gap field 'hlgp'. I
thought this was a suggested total line spacing, but it's actually extra
spacing to be added to (ascender - descender).
|
|
This was broken in the recent changes to allow fractional scaling, as a
calculation hadn't been updated.
|
|
|
|
|
|
|
|
Instead of scaling various theme parameters ourselves, just set the
scale in Cairo. This shouldn't result in any visible changes, but lays
the ground work for fractional scaling support.
|
|
This allows rounded background corners to work when a padding of -1 is
specified.
|
|
|
|
This turned out to be much more complex than anticipated, and the
potential for bugs is therefore quite high.
|
|
Each piece of text is now individually themable, with foreground and
background colours and optionally rounded background corners.
|
|
|
|
|
|
|
|
All text handling should now be explicitly UTF-8 or UTF-32, removing the
ambiguity around wchar_t and related functions.
|
|
This should allow case-insensitive matching for non-Latin characters,
and fix matching for characters with diacritics.
|
|
|
|
|
|
|
|
When not highlighting matches or drawing a selection background box, we
can skip a bunch of slow code to improve performance.
|
|
Previously the selection background didn't really wrap text correctly,
especially if the font was very slanted. This fixes that, so the width
is tightly wrapped around any font.
|
|
Pagination was broken in horizontal mode before, and in general tried to
render too many results (leading to a cut-off last result). This commit
fixes both of those, with the minor caveat that you can no longer scroll
straight to the last result.
|
|
|
|
This was done by breaking the selected result into three parts, and
rendering each separately. A side-effect is that ligatures split when a
match ends inside them, but I think that's the correct behaviour (rather
than highlighting the whole ligature).
There may be issues with some non-latin languages that make much more
extensive use of ligatures / combining characters, however.
|
|
|
|
This adds some extra padding in the selection background, rather than
tightly wrapping the selection text.
|
|
This fixes some slanted fonts being cut off if they extend back towards
the prompt too far.
|
|
Tofi will now try to autodetect how many results can be drawn if
--num-results=0 is specified, which is now the default.
|
|
Search results will now be sorted by history first, then by the position
of the match, such that a match at the start of a result will appear
before a match later in the result.
|
|
|
|
|
|
Also improve text on non-hidpi screens.
|
|
This improves start-up performance for large windows.
|
|
|
|
Implement horizontal mode for Pango, and add min-input-width option.
|
|
Tofi now uses Harfbuzz if a file is passed to --font-name, and Pango
otherwise.
|
|
The scale factor is now only used to scale font sizes, not all Cairo
drawing operations. This makes pixel-sized options correct.
|
|
Invoking 'tofi' now acts like dmenu, expecting newline-separated options
on stdin.
Also fix history file handling and add an option to disable it.
|
|
|
|
Single letter style arguments have been removed.
|
|
There are too many really to use single-character args, so the next step
should be a config file.
|
|
- Split the compgen and history sorting parts of compgen(), for future
dmenu-like work.
- Add a separate tofi-compgen executable.
- Remove harfbuzz-glib usage, as we shouldn't be doing any complicated
unicode stuff.
|
|
|
|
|
|
|
|
Previously integers were used, effectively removing any sub-pixel
positioning.
|
|
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.
|
|
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.
|
|
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.
|