Commit Graph
77 Commits
Author SHA1 Message Date
Kovid Goyal 109a856b91 Fix #2313 2020-01-26 08:00:06 +05:30
Kovid Goyal 43fc335be2 more macOS float fixes 2019-09-27 20:05:11 +05:30
Luflosi 8e96a27d51 Use the OPT() macro where possible 2019-09-12 10:02:53 +02:00
Kovid Goyal 57542fc204 Only disable liga and dlig for nimbus mono 2019-08-10 08:22:36 +05:30
Luflosi cdbe2f13ca Cocoa: Move slightly towards modern Objective-C
Inspired by https://github.com/glfw/glfw/commit/9a9568212c2dfd17fe46845eaa68ec0731de6173.
2019-07-25 17:14:32 -05:00
Kovid Goyal cdb493cf50 Couple more MIN/MAX type fixes 2019-07-04 09:15:13 +05:30
Kovid Goyal efad733cc5 DRYer 2019-06-30 18:42:20 +05:30
Kovid Goyal 1fcd6e1811 macOS: Fix finding fallback font for private use unicode symbols not working reliably
Fixes #1650
2019-06-30 18:11:58 +05:30
Kovid Goyal 1ae32b5742 Linux: Automatically increase cell height if the font being used is broken and draws the underscore outside the bounding box
See #690
2019-05-29 16:04:50 +05:30
Kovid Goyal 1369a36178 Exclude variation selectors when finding fallback font 2019-05-13 20:36:29 +05:30
Luflosi 4b65b4ac2b Fix potential undefined behaviour
When `gray_color_space` is `NULL`, it is passed into `CGBitmapContextCreate()`. Since there are no guarantees in https://developer.apple.com/documentation/coregraphics/1455939-cgbitmapcontextcreate?language=objc to what happens in that case, depending on the implementation there may be undefined behaviour.
2019-03-15 14:31:19 +01:00
Kovid Goyal 16c0871e22 Implement resizing cells rendering on CoreText 2019-03-04 19:54:11 +05:30
Daniel Hahler 3c4cb3c35b get_glyph_width for core text?! 2018-09-29 18:56:54 +02:00
Daniel Hahler 8e09e809aa fixup! render_glyphs_in_cells: skip centering glyph for PUA 2018-09-29 16:23:16 +02:00
Theodore Dubois 94052bb712 Add option to increase font thickness on macOS 2018-09-10 19:30:29 -07:00
Kovid Goyal 28c154ecf0 typo 2018-09-10 21:58:15 +05:30
Kovid Goyal 8176f661ea macOS: Fix small leak in glyph rendering code 2018-09-10 21:41:26 +05:30
Kovid Goyal 55f457caf4 macOS: Fix a character that cannot be rendered in any font causing font fallback for all subsequent characters that cannot be rendered in the main font to fail
Fixes #799
2018-09-04 14:21:36 +05:30
Kovid Goyal 8dea5b3e3e Reduce data sent to GPU per draw by 30%
Split up the Cell structure into a CPUCell and a GPUCell. Only the
GPUCell part needs to be sent to the GPU. Should make kitty use even
less system resources and make a performance difference on systems where
the GPU bandwidth is constrained.

Also allows adding more CPU only data in the future without affecting
GPU bandwidth. For example, hyperlinks or more combining characters.
2018-05-27 21:25:09 +05:30
Kovid Goyal df9eab279a Implement changing the font size for individual top level (OS) windows 2018-05-27 12:37:49 +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 96c93fa252 Add support for emoji presentation when choosing fallback fonts 2018-02-06 11:11:22 +05:30
Kovid Goyal 409bd37db5 Store combining chars as an array in the Cell
Makes it easier to increase the number of combining chars if needed,
rather than storing them as a mask.
2018-01-18 14:10:58 +05:30
Kovid Goyal 1ae7ae4a1d Fix consecutive separate ligatures being rendered in the same group
Rendering multiple ligatures in the smae group is bad for performance
and also causes incorrect rendering if the last ligature in the group
does not fit into the number of cells in the group.
2018-01-14 11:18:44 +05:30
Kovid Goyal 0fcce6ec58 Remove trailing whitespace from native code files 2017-12-20 08:44:47 +05:30
Kovid Goyal b9d0ec0d4c CoreText: Use the layout engine to calculate cell height
Slower, but hopefully more accurate, since it takes into account
whatever kludges Apple is currently using to calculate line height
in its applications.
2017-12-13 14:12:23 +05:30
Kovid Goyal 869abc4d5c ... 2017-12-13 14:05:01 +05:30
Kovid Goyal 872118fcbe CoreText: Fix incorrect underline position and thickness calculation 2017-12-13 13:59:11 +05:30
Kovid Goyal d25c0d42bc CoreText: Ensure cell_width and cell_height are never zero 2017-12-13 09:35:50 +05:30
Kovid Goyal a1b4f7c92d Fix COreText leak on exit 2017-12-13 08:27:33 +05:30
Kovid Goyal 47704f24c1 CoreText: Get rid of the line height fudge factor
It was leading to larger line heights than in iTerm on High Sierra with
Menlo. Also as per Apple documentation, line height should be ascent +
descent + leading.
https://developer.apple.com/library/content/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TypoFeatures/TextSystemFeatures.html
2017-12-13 08:22:26 +05:30
Kovid Goyal a29b424477 CoreText: Implement resizing of glyphs too wide to fit 2017-12-11 20:34:23 +05:30
Kovid Goyal 005c4bf29e Finish up CoreText based rendering 2017-12-11 19:04:44 +05:30
Kovid Goyal c86c166448 More work on positioning glyphs with CoreText 2017-12-11 18:48:14 +05:30
Kovid Goyal 0999ce159e Fix colors incorrect when rendering directly to buf 2017-12-11 10:43:32 +05:30
Kovid Goyal 98d8ab2953 Fix OT shaper not working on macOS
Also dont keep an extra reference to the hb font in fonts.c
2017-12-11 09:48:20 +05:30
Kovid Goyal 5407fa72b4 Start work on rendering with CoreText 2017-12-10 20:28:06 +05:30
Kovid Goyal e332522a61 Mark backend API in fonts.h header 2017-12-10 09:21:46 +05:30
Kovid Goyal ed2e83654f Draw emoji on macOS using CoreText rather than FreeType
Needed because FreeType cannot handle the latest version of the Apple
Color Emoji font, which probably uses SVG-in-OTF instead of SBIX.
Finishes up the color emoji implementation.
2017-12-09 12:01:43 +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 3592f82e4f Implement fallback fonts in CoreText 2017-11-11 08:08:03 +05:30
Kovid Goyal 289cfe7584 Fix bold-italic variant not being auto-selected on macOS 2017-11-10 22:06:11 +05:30
Kovid Goyal cccacfdf7c Restore Apple's line height fudge factor on macOS 2017-11-10 17:38:36 +05:30
Kovid Goyal 541f389a06 Work on using FreeType to render on macOS as well 2017-11-10 15:39:53 +05:30
Kovid Goyal 5c582f7639 Start work on harfbuzz rendering on macs 2017-11-10 12:52:54 +05:30
Kovid Goyal 3ec64a17f8 Dont call the font change machinery when the actual size has not changed 2017-11-09 16:55:45 +05:30
Kovid Goyal dd6108de5b DRYer 2017-11-09 16:55:44 +05:30
Kovid Goyal aa1b94aed0 Ensure descriptor is always set for coretext font objects 2017-11-09 16:55:44 +05:30