Commit Graph

69 Commits

Author SHA1 Message Date
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
Kovid Goyal
e552bcb0c6 Prerender cursor sprites 2018-07-19 14:03:39 +05:30
Kovid Goyal
84b2fbba28 --debug-font-fallback also prints out what basic fonts were matched
Fixes #656
2018-06-19 12:48:33 +05:30
Kovid Goyal
b14c9614e0 DRYer 2018-05-27 12:37:05 +05:30
Kovid Goyal
ed44515318 All tests pass 2018-05-27 12:37:05 +05:30
Kovid Goyal
523aadaa3b Refactor font group handling
Allow kitty to manage multiple groups of fonts with different cell
sizes. Will eventually allow kitty to have different font sizes/dpi per
OSWindow
2018-05-27 12:37:05 +05:30
Kovid Goyal
2be2f6aa0c Make icat a kitten
The kittens framework did not exist when icat was first written.
2018-05-09 20:26:30 +05:30
Kovid Goyal
328f22adab Let update_cell_emtrics() know if it is being called in response to a DPI change 2018-02-06 20:12:57 +05:30
Kovid Goyal
fc7ec1d3f7 Get rid of the option to use the system wcwidth
The system wcwidth() is often wrong. Not to mention that if you SSH into
a different machine, then you have a potentially different wcwidth. The
only sane way to deal with this is to use the unicode standard.
2018-02-04 21:02:30 +05:30
Kovid Goyal
8d94285a5d Ensure underlines are rendered even for fonts with very poor metrics
Fixes #236
2017-12-19 00:54:04 +05:30
Kovid Goyal
cb04deef63 icat: Add a command line argument for horizontal alignment 2017-12-15 13:08:27 +05:30
Kovid Goyal
684a2e05f4 Move logical DPI calculation into glfw module
Now DPI state is maintained in only one central place.
2017-12-14 18:30:53 +05:30
Kovid Goyal
da0309545e Ensure bounds in add_line() 2017-12-13 13:46:28 +05:30
Kovid Goyal
54b802f1e6 Ensure bounds in add_dline() 2017-12-13 13:45:11 +05:30
Kovid Goyal
c86c166448 More work on positioning glyphs with CoreText 2017-12-11 18:48:14 +05:30
Kovid Goyal
ec6dcd53b5 Finish up placement of color emojis
Note that for some reason rendering is broken on Apple
2017-12-09 12:01:43 +05:30
Kovid Goyal
8d7515bd9b Basic color emoji rendering working
Still need to downscale color bitmaps to fit into cells
2017-12-09 12:01:43 +05:30
Kovid Goyal
9cda51b5a8 Store sprites in an RGBA texture
Needed to support color emoji
2017-12-09 12:01:42 +05:30
Kovid Goyal
e8441ce697 Ensure double underline is gapped even when underline thickness is less than three pixels 2017-12-05 11:42:35 +05:30
Kovid Goyal
e81ba3b207 Change undercurl escape code to 4:x
See https://github.com/neovim/neovim/issues/7479
for discussion. Also implement double underline.
2017-12-04 12:26:50 +05:30
Kovid Goyal
eb8f4e0b3c isosx -> is_macos 2017-12-01 12:16:13 +05:30
Kovid Goyal
235f3940f2 DRYer 2017-11-26 18:10:34 +05:30
Kovid Goyal
9fccc38382 Better fix for not using the unsafe to break flag
Recognize special glyphs by comparing the index to the glyph for the
codepoint in the font. Cannot rely on glyph width as many glyphs have
zero width. For example the glyph for space characters.
2017-11-13 07:03:58 +05:30
Kovid Goyal
088087df73 Use only cluster numbers and glyph sizes for grouping glyphs into cells
See https://github.com/behdad/harfbuzz/issues/615 for discussion
2017-11-12 23:43:21 +05:30
Kovid Goyal
5f4e003bed Add a ligature shaping test 2017-11-11 20:55:53 +05:30
Kovid Goyal
53e9f35c1f Add test for harfbuzz shaping 2017-11-11 18:47:34 +05:30
Kovid Goyal
e5d411b80d Refactor font code
DRYer with global state stored in fewer places. And only round-tripping
through python for font selection, not face creation.
2017-11-11 18:14:22 +05:30
Kovid Goyal
98e93cb4bd Workaround for broken CTFontCreateForString 2017-11-11 10:16:43 +05:30
Kovid Goyal
447a2fe8cf ... 2017-11-11 09:20:34 +05:30
Kovid Goyal
a14defbab7 Change the showcase fonts 2017-11-11 09:13:04 +05:30
Kovid Goyal
3592f82e4f Implement fallback fonts in CoreText 2017-11-11 08:08:03 +05:30
Kovid Goyal
5c582f7639 Start work on harfbuzz rendering on macs 2017-11-10 12:52:54 +05:30
Kovid Goyal
ccc0433fa1 ... 2017-11-10 11:26:58 +05:30
Kovid Goyal
fefe6c9024 Use fc-list instead of fc-match to select fonts
This is because there is no way to force fc-match to return a monospace
font. So if the user specifies a non-existent font we end up with some
non-monospaced font, which looks terrible.

Also, this makes the font selection logic or macOS and Linux similar.
2017-11-10 10:15:37 +05:30
Kovid Goyal
7a0b649cbd Fix resizing of fonts 2017-11-10 07:34:52 +05:30
Kovid Goyal
6d7546aa8c pre-rendering must happen after layout 2017-11-09 17:11:37 +05:30
Kovid Goyal
bc0a77ee31 Only detect support once when testing rendering 2017-11-09 16:55:45 +05:30
Kovid Goyal
75e1b30fc1 DRYer 2017-11-09 16:55:44 +05:30
Kovid Goyal
e72f153a66 Avoid unneccessary exception when failling to find a fallback font 2017-11-09 16:55:44 +05:30
Kovid Goyal
da8bf5adc7 Add rendering tests 2017-11-09 16:55:44 +05:30
Kovid Goyal
ce0e5a893f Make the showcase output a little nicer 2017-11-09 16:55:44 +05:30
Kovid Goyal
c8b7b49d56 Ensure underline_position is viable 2017-11-09 16:55:44 +05:30