138 Commits

Author SHA1 Message Date
Kovid Goyal
d61055b51d Finish up render_decoration() wrapper 2025-02-11 13:02:13 +05:30
Kovid Goyal
23097ee184 Function to easily test decoration rendering 2025-02-10 16:31:03 +05:30
Kovid Goyal
44eec08b24 Fix buffer not being cleared before re-use 2025-02-03 11:06:41 +05:30
Kovid Goyal
d068a0a6de Add basic colrv1 rendering test 2025-02-03 11:06:41 +05:30
Kovid Goyal
c599b7e02f API to render a single codepoint using a Face 2025-02-03 10:56:52 +05:30
Kovid Goyal
da1626090a Update codebase to Python 3.10 using pyupgrade 2025-02-03 10:56:50 +05:30
Kovid Goyal
c67475271f Remove box drawing python code 2025-02-03 10:56:48 +05:30
Kovid Goyal
b249fba93d misc fixes for decoration rendering 2025-02-03 10:56:46 +05:30
Kovid Goyal
b2a4db2028 Revert metadata row for sprites
Store in a separate VAO instead more performant as it uses less VRAM and
allows shader lookup co-ords to be passed to fragment shaders without
calculation in the fragment shader.
2025-02-03 10:56:45 +05:30
Kovid Goyal
5d195bf50b Give sprites a metadata row accessible in the shaders
Will allow sprites to point to where their decorations should be read
from, for instance. Needed for scaled text and also if we want to
implement decoration avoidance.
2025-02-03 10:56:45 +05:30
Kovid Goyal
6a169eedd5 Move decorations drawing code to C form Python
Makes it faster and easier to call from C
2025-02-03 10:56:45 +05:30
Kovid Goyal
0fb49f4139 Switch to using an index for sprite tracking
Frees up two bytes in GPUCell. Doesn't require a minimum texture row
size. Makes a bunch of code faster. Index uses 31 bits which gives us
2,147,483,647 aka ~ 2 billion sprites.
2025-02-03 10:56:45 +05:30
Kovid Goyal
1aec299ad8 ... 2025-02-03 10:56:45 +05:30
Kovid Goyal
3dca2687d8 Make font rendering tests use a text font rather than system font 2025-02-03 10:56:44 +05:30
Kovid Goyal
4118bfc8ee Change algorithm for y position of dashed/dotted underlines
Make the inner loop faster and ensure that the same logic for y-position
and thickness is used as for the straight underline. Fixes #8074
2024-11-25 11:07:56 +05:30
Kovid Goyal
f1d0d0949b Run pyupgrade to update the codebase to python 3.9
Gets rid of a lot of typing ugliness by using type annotations on
builtin types
2024-07-31 07:55:27 +05:30
Kovid Goyal
fd5b96b43b Use builtin NERD font for symbol_map if no system NERD font is available 2024-07-02 15:33:07 +05:30
Kovid Goyal
a783e5d85a Ensure builtin NERD font is used only if glyph is not found by normal font fallback 2024-07-02 14:18:22 +05:30
Kovid Goyal
98c85d2923 Use builtin NERD fonts
Prevents users from having to install their own NERD font. System fonts
are still used preferentially on Linux but on macOS the builtin one is
used preferentially. Cant find any CoreText API to change this.

Still has to be implemented on macOS. And need to add code to the build
system to bundle the font when building.
2024-07-02 10:28:07 +05:30
Kovid Goyal
5eccdd3d13 ... 2024-06-29 16:24:35 +05:30
Kovid Goyal
226cc92b01 API to add font file to system font lookup 2024-06-29 16:18:43 +05:30
Kovid Goyal
060732b428 work on passing font features via font specs 2024-06-24 07:54:18 +05:30
Kovid Goyal
852889a561 Implement rendering of sample text 2024-06-24 07:54:14 +05:30
Kovid Goyal
f0cac79143 Work on rendering sample text for a font 2024-06-24 07:54:14 +05:30
Kovid Goyal
d826265fd7 Get query terminal working again
Also return current OS Window's font size
2024-06-24 07:54:13 +05:30
Kovid Goyal
f5ae6fe152 Refactor font selection code to share more between fontconfig and CoreText 2024-06-24 07:54:12 +05:30
Kovid Goyal
56f8fb9f75 Implement basic support for selecting font variations in fontconfig 2024-06-24 07:54:09 +05:30
Kovid Goyal
6e3c9856d1 Wire up parsing of font specs 2024-06-24 07:53:16 +05:30
Kovid Goyal
77292a16d6 Make shebangs consistent
Follow PEP 0394 and use /usr/bin/env python so that the python in the
users venv is respected. Not that the kitty python files are meant to be
executed standalone anyway, but, whatever.

Fixes #6810
2023-11-11 08:32:05 +05:30
Kovid Goyal
9a77fdcd04 A new option undercurl_style to control the rendering of undercurls
Fixes #5883
2023-01-16 14:23:10 +05:30
Kovid Goyal
7fe5d7b58f Replace isort with ruff 2023-01-09 16:47:42 +05:30
Kovid Goyal
5d42d1f955 Remove the old python icat implementation
Keep the python backend code as it is used by the diff kitten to display
image diffs.
2023-01-05 19:34:12 +05:30
Kovid Goyal
9ac744ae63 DRYer 2022-07-26 16:10:43 +05:30
Kovid Goyal
93b05bcd1e Make the calculation of the bound for underline_position more precise
Fixes #5308
2022-07-26 16:07:01 +05:30
Kovid Goyal
01b4654461 A new option narrow_symbols to turn off opportunistic wide rendering of private use codepoints 2022-02-11 13:04:44 +05:30
Kovid Goyal
f9b35c71d7 Another place to use NUM_UNDERLINE_STYLES 2022-02-04 14:16:31 +05:30
Kovid Goyal
6b47f6f769 Make adding new underline styles easier in the future 2022-02-04 14:05:19 +05:30
pagedown
c21f00c476 Refactor: More f-string for kitty fonts and rc send_text 2022-01-29 20:22:22 +08:00
pagedown
dc61adf9d8 Refactor: More f-string 2022-01-28 19:34:13 +08:00
Joseph Adams
ee2c9775a7 Use distribute_dots() to even out spacing in underline 2022-01-18 15:46:31 +01:00
Joseph Adams
da486153de Add (possibly erroneous) test for new underline.
Also make more clear *what* exactly is rendered in the cell (i.e. a
strikethrough).
2022-01-18 12:52:59 +01:00
Joseph Adams
e86c7d668c Add rendering functions for dotted and dashed underline.
Dashed underline looks pretty good regardless of conditions, but the
dotted underline only looks good/correct on certain font-sizes. This is
due to the underline being rendered on a per cell/glyph basis (so one
can not place a dot directly between two letters, say. Could be remedied
by pulling the rendering of the underlines into the shader, but that is
more work.
2022-01-17 13:25:08 +01:00
Joseph Adams
a2c4f830b3 Enable use of higher options for underlining text.
In `Colored and styled underlines` it's proposed that the SGR codes
\e[4:4m and \e[4:5m are used to add a dotted or dashed underline to the
rendering context respectively. This commit prepares the necessary
changes to add the two additional underline style, while still rendering
them as a normal underline and curly underline.
2022-01-13 17:27:02 +01:00
Kovid Goyal
1be7425186 Another mypy 0.920 fix 2021-12-17 06:15:10 +05:30
Kovid Goyal
d31935b8eb Old python compat 2021-10-27 14:23:07 +05:30
Kovid Goyal
d090db380f Add more type annotations 2021-10-27 13:26:18 +05:30
Kovid Goyal
6546c1da9b run pyupgrade to upgrade the codebase to python3.6 2021-10-21 12:43:55 +05:30
Kovid Goyal
6d7df1c5e8 Refactor configuration file parsing
Now the time for importing the kitty.config module has been halved, from
16ms from 32ms on my machine. Also, the new architecture will eventually
allow for auto generating a bunch of python-to-C boilerplate code.
2021-05-31 17:40:49 +05:30
Kovid Goyal
c5afe4e745 Merge branch 'feat/undercurl-retina' of https://github.com/disrupted/kitty 2021-05-21 08:30:21 +05:30
disrupted
d650a97dda Fix undercurl height & thickness on HiDPI screens
Update positioning
2021-05-18 19:00:46 +02:00