Commit Graph

60 Commits

Author SHA1 Message Date
Kovid Goyal
96d231dfa5 Use buffer size in cell_as_unicode_for_fallback as well 2025-02-16 10:02:39 +05:30
Kovid Goyal
cabd6c0589 Initial port of code to use TextCache 2024-11-04 09:10:07 +05:30
Matubu
b0e49d70db Fix segfault when font descriptor point to invalid font file 2024-10-18 02:31:54 +02:00
Kovid Goyal
611d8baf28 Linux: Fix a regression in 0.36.0 that caused font features defined via fontconfig to be ignored
Fixes #7773
2024-08-24 17:17:37 +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
66034d54fb DRYer
Use same algorithm for checking if cell can be rendered everywhere
2024-07-02 10:28:07 +05:30
Kovid Goyal
aaf65ec155 Move checking if font has cell text into the font backends
Gives us better control
2024-07-02 10:28:07 +05:30
Kovid Goyal
226cc92b01 API to add font file to system font lookup 2024-06-29 16:18:43 +05:30
Kovid Goyal
0cc8dd28de Add support for font features when rendering sample text 2024-06-24 07:54:19 +05:30
Kovid Goyal
f10f4e8e5b ... 2024-06-24 07:54:18 +05:30
Kovid Goyal
69de414ba1 Fix build on older fontconfig 2024-06-24 07:54:14 +05:30
Kovid Goyal
c1828fa2a4 Implement spec based selection for variable fonts 2024-06-24 07:54:14 +05:30
Kovid Goyal
56f8fb9f75 Implement basic support for selecting font variations in fontconfig 2024-06-24 07:54:09 +05:30
Kovid Goyal
00dc8f0e23 Ensure fontconfig pattern dict has all keys with default values 2024-06-24 07:53:16 +05:30
Kovid Goyal
2f3578ad93 Start work on listing variable fonts under macOS 2024-06-24 07:53:15 +05:30
Kovid Goyal
54fb6be112 Work on list variable fonts on Linux 2024-06-24 07:53:15 +05:30
Kovid Goyal
3ba2492e99 Allow fc-list to return variable fonts 2024-06-24 07:53:15 +05:30
Kovid Goyal
4ba6d02ab6 Revert "Workaround for fontconfig returning junk in all but the lowest eight bits for FC_INDEX"
This reverts commit d2c21ee297.

Apparently fontconfig overloads the top 16 bits as "instance index"
which is some kind of index for variable fonts? Who knows. fontconfig is
a natural disaster.

Fixes #7361
2024-04-18 22:06:57 +05:30
Kovid Goyal
d2c21ee297 Workaround for fontconfig returning junk in all but the lowest eight bits for FC_INDEX
Fixes #7263
2024-03-26 18:32:44 +05:30
Kovid Goyal
0042288e92 remove unused headers 2024-03-20 17:28:14 +05:30
Kovid Goyal
d9ccbcd0ce Font fallback: Fix the font used to render a character sometimes dependent on the order in which characters appear on screen
We ameliorate the performance hit by storing a hash table mapping cell
text to the loaded fallback font index so that lookups for previously
seen text are still fast.

Fixes #6865
2023-12-11 20:27:21 +05:30
Kovid Goyal
d3656bf7e9 Linux: Load libfontconfig at runtime to allow the binaries to work for running kittens on servers without FontConfig 2022-05-13 19:56:19 +05:30
Kovid Goyal
be34af4555 Remove inline from .c files
It is ignored by compilers and hides unused static functions
2021-08-03 09:11:17 +05:30
Kovid Goyal
ccc370e1c4 Dont initialize FontConfig when importing fast_data_types
This reduces the import time for fast_data_types by 12ms on my machine.
FontConfig initialization is very slow and it is only needed by the
main kitty program, however fast_data_types is imported in kittens and
remote control as well, where FontConfig is useless.
2021-05-15 10:41:54 +05:30
Kovid Goyal
55dc354e68 Improve at exit cleanup functions
Now they are run in a defined order not based on
the order of initialization
2021-04-01 11:48:36 +05:30
Kovid Goyal
dd2b6119b3 Implement rendering of emoji for CSD 2021-03-31 15:23:05 +05:30
Kovid Goyal
4a3c57054f Function to get fallback font for a char 2021-03-29 15:35:38 +05:30
Kovid Goyal
41b9495588 More work on text rendering 2021-03-29 14:56:49 +05:30
Kovid Goyal
cdbc096990 Start work on rendering text for CSDs 2021-03-29 12:15:47 +05:30
Kovid Goyal
aa8dd4ddf4 ... 2020-12-17 11:30:37 +05:30
Kovid Goyal
0b2726ec33 Cleanup fc_match_postscript_name 2020-12-17 11:16:51 +05:30
Kovid Goyal
bc7f689165 Clean up pattern_as_dict 2020-12-17 11:12:35 +05:30
Antoine Bertin
3e0855ff45 Properly convert font_features to a list 2020-12-16 17:52:43 +01:00
Antoine Bertin
822c9367c6 Support default font_features from fontconfig 2020-12-16 14:58:38 +01:00
Kovid Goyal
e3af9f68d3 Linux: Fix selection of fonts with multiple width variants not preferring the normal width faces
Fixes #2491
2020-03-29 01:52:33 +05:30
Kovid Goyal
a4cc10c41b More typing work 2020-03-04 06:10:57 +05:30
Kovid Goyal
bc302dad23 Linux: Allow using fonts with spacing=90 in addition to fonts with spacing=100
Fixes #1968
2019-09-15 06:08:40 +05:30
Kovid Goyal
1369a36178 Exclude variation selectors when finding fallback font 2019-05-13 20:36:29 +05:30
Kovid Goyal
4273cb35bf Linux: Dont fail on systems with fonts that have non-UTF-8 names. Fixes #1281 2018-12-31 07:31:17 +05:30
Kovid Goyal
6bf290149e Allow specifying monospace when calling fc_match 2018-10-24 06:45:06 +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
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
4f18342ea6 Linux: Fix fonts not being correctly read from TrueType Collection (.ttc) files.
kitty was always selecting the first font rather than the
actual matched font. Fixes #577
2018-05-27 12:30:28 +05:30
Kovid Goyal
96c93fa252 Add support for emoji presentation when choosing fallback fonts 2018-02-06 11:11:22 +05:30
Kovid Goyal
b9857f9499 Only consider emoji characters with emoji presentation to have width two
Fixes #308
2018-02-05 09:21:13 +05:30
Kovid Goyal
0fcce6ec58 Remove trailing whitespace from native code files 2017-12-20 08:44:47 +05:30
Kovid Goyal
ee27f23862 Add rgba and lcdfilter fields to the fc-dict 2017-12-09 12:58:23 +05:30
Kovid Goyal
e4b839742c Add option to control using color emoji or not 2017-12-09 12:01:43 +05:30