summaryrefslogtreecommitdiff
path: root/src/entry_backend/harfbuzz.c
AgeCommit message (Collapse)Author
2023-04-10Fix broken line spacing with some fonts.Phil Jones
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).
2023-03-16Fix selection background for Harfbuzz backend.Phil Jones
This was broken in the recent changes to allow fractional scaling, as a calculation hadn't been updated.
2023-03-12Minor cleanup of harfbuzz initialisation code.Phil Jones
2023-03-12Fix rendering issue for some versions of Harfbuzz.Phil Jones
2023-02-28Fix background box -1 padding alignment.Phil Jones
2023-02-28Convert to using Cairo scale.Phil Jones
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.
2023-02-26Pad just enough when -1 is specified.Phil Jones
This allows rounded background corners to work when a padding of -1 is specified.
2022-12-21Fix compilation with Harfbuzz < 4.0.0.Phil Jones
2022-12-21Add text cursor support.Phil Jones
This turned out to be much more complex than anticipated, and the potential for bugs is therefore quite high.
2022-11-21Overhaul text theming.Phil Jones
Each piece of text is now individually themable, with foreground and background colours and optionally rounded background corners.
2022-11-21Add --font-variations option.Phil Jones
2022-11-20Add --font-features option.Phil Jones
2022-11-16Add placeholder text options.Phil Jones
2022-10-23Replace wchar and friends with Unicode handling.Phil Jones
All text handling should now be explicitly UTF-8 or UTF-32, removing the ambiguity around wchar_t and related functions.
2022-10-18Improve UTF-8 handling.Phil Jones
This should allow case-insensitive matching for non-Latin characters, and fix matching for characters with diacritics.
2022-10-05Add options to hide input for passwords etc.Phil Jones
2022-08-22Add --prompt-padding option.Phil Jones
2022-08-09Improve performance for some themes.Phil Jones
When not highlighting matches or drawing a selection background box, we can skip a bunch of slow code to improve performance.
2022-08-05Correct selection background for slanted fonts.Phil Jones
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.
2022-08-04Improve pagination.Phil Jones
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.
2022-08-03Add pagination of results.Phil Jones
2022-07-30Add option to colour matching portion of results.Phil Jones
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.
2022-07-29Make a selection-padding of -1 be infinite.Phil Jones
2022-07-29Add --selection-padding option.Phil Jones
This adds some extra padding in the selection background, rather than tightly wrapping the selection text.
2022-07-29Redraw prompt each frame.Phil Jones
This fixes some slanted fonts being cut off if they extend back towards the prompt too far.
2022-07-26Add automatic detection of number of results.Phil Jones
Tofi will now try to autodetect how many results can be drawn if --num-results=0 is specified, which is now the default.
2022-07-05Sort results by match position.Phil Jones
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.
2022-06-26Add optional background around selected result.Phil Jones
2022-06-25Add option to disable font hinting.Phil Jones
Also improve text on non-hidpi screens.
2022-06-25Don't double-draw background colour on first draw.Phil Jones
This improves start-up performance for large windows.
2022-06-25Fix padding and split into top/bottom/left/right.Phil Jones
2022-06-24Horizontal mode fixes.Phil Jones
Implement horizontal mode for Pango, and add min-input-width option.
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-21Add result selection.Phil Jones
2022-06-21Add config file handling.Phil Jones
Single letter style arguments have been removed.
2022-06-21Add various command line arguments.Phil Jones
There are too many really to use single-character args, so the next step should be a config file.
2022-06-10Various small changes.Phil Jones
- 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.
2022-06-10Minor cleanup.Phil Jones
2022-06-10Cleanup and comment HarfBuzz code.Phil Jones
2022-06-10Use doubles for harfbuzz glyph coordinates.Phil Jones
Previously integers were used, effectively removing any sub-pixel positioning.
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.