Commit graph

110 commits

Author SHA1 Message Date
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
Kovid Goyal
608ac953e5
Pass DPI through to special render function 2021-05-18 07:46:04 +05:30
Antoine Bertin
822c9367c6 Support default font_features from fontconfig 2020-12-16 14:58:38 +01:00
Kovid Goyal
8b2fb105d0
Fix #2735 2020-06-05 19:24:40 +05:30
Kovid Goyal
362e4266bb
Better coalescing of multiple symbol_maps
When specifying multiple symbol_map values in kitty.conf later ones
should override conflicting previous ones. Fixes #2662
2020-05-17 23:03:28 +05:30
Trygve Aaberge
931e91f1a7 Read strikethrough info from font when using FreeType
This reads the strikethrough position and thickness from the font so it
is rendered correctly.

This is only implemented for FreeType, not Core Text, because I didn't
find any way to get the info from Core Text, and I don't have a Mac to
test it on either. When using Core Text or when the font doesn't provide
the info, the same approximation as before is used.
2020-03-30 20:09:30 +02:00
Kovid Goyal
382c31ddf2
Use a stub rather than TYPE_CHECKING 2020-03-15 13:27:40 +05:30
Kovid Goyal
c912eef040
Minor strictness increases 2020-03-14 14:59:31 +05:30
Kovid Goyal
8803eeb890
more typing work 2020-03-10 12:58:53 +05:30
Kovid Goyal
c817ba9eae
more typing work 2020-03-09 13:32:45 +05:30
Kovid Goyal
9beae321d7
More typing work 2020-03-08 22:08:18 +05:30
Kovid Goyal
9b973ef99c
More typing work 2020-03-08 20:36:50 +05:30
Kovid Goyal
cc1336a616
More typing work
Also use a mypy based linter when editing
2020-03-08 11:02:14 +05:30
Eyal Chojnowski
08ad4f389d Fix linting 2020-02-06 16:21:32 +01:00
Eyal Chojnowski
edba63d0d9 Make underline cursor thickness configurable 2020-02-06 16:15:12 +01:00
Eyal Chojnowski
332714a925 Make cursor beam thickness configurable 2020-02-06 12:54:42 +01:00
Kovid Goyal
547f138703
Bound width and height for render_curosr 2020-02-06 06:55:13 +05:30
Kovid Goyal
14560b008a
Clean up font features merge 2020-01-07 08:54:32 +05:30
Fredrick Brennan
1db613e95b Add font_feature_settings
Close #2247
2020-01-04 14:36:20 +08:00
Kovid Goyal
a649eb2a48
Coalesce neighboring symbol maps for better lookup performance 2019-11-12 20:05:48 +05:30
Luflosi
4eed8463b3
Simplify chained comparisions 2019-06-05 15:24:36 +02:00
Luflosi
a792c94ccf
Use python3 shebang for all python scripts
Fixes #1624.
Use python3 shebang for all python scripts as python still defaults to python2 on many systems.
2019-05-20 14:44:24 +02:00
Kovid Goyal
27acd4c7d4
Don't crash when rendering special cells with absurd cell sizes
Fixes #1378
2019-02-14 09:49:51 +05:30
Kovid Goyal
3fa7007e91
Use the Wu line anti-alias algorithm for drawing undercurls
Fixes #853
2018-12-05 14:02:21 +05:30
Kovid Goyal
019e6efeda
Reduce overlap with text when rendering wavy underline at small font sizes 2018-11-27 07:19:30 +05:30
Kovid Goyal
b0a39b127d
Remove unused import 2018-09-04 17:54:33 +05:30
Kovid Goyal
e36f1157cc
Improve anti-aliasing at small sizes for wavy underlines 2018-09-04 15:48:01 +05:30
Kovid Goyal
053b9a786c
Use a cosine instead of sine wave for wavy underlines
Matches other terminals
2018-09-04 15:35:48 +05:30
Kovid Goyal
b0a2dea747
Improve rendering of wavy underline at small font sizes
See #853
2018-09-03 10:15:53 +05:30