Commit Graph

7455 Commits

Author SHA1 Message Date
Kovid Goyal
b017cc0c1e Handle variable fonts like cascadia code that dont have a postfix variation prefix name for some of their faces 2024-06-24 07:54:17 +05:30
Kovid Goyal
28f2919753 Fix medium face selection when more than family specified 2024-06-24 07:54:17 +05:30
Kovid Goyal
ff89f5187d Dont log an error when the default famil "monospace" is not found 2024-06-24 07:54:17 +05:30
Kovid Goyal
8ba6d5a296 CoreText: When finding medium face for a family prefer variable font if available 2024-06-24 07:54:16 +05:30
Kovid Goyal
7fd9bca845 IBM Plex Mono workaround is needed only under fontconfig 2024-06-24 07:54:16 +05:30
Kovid Goyal
2652342544 DRYer 2024-06-24 07:54:16 +05:30
Kovid Goyal
c27c731ffb Get font selection for the cascadia code variable fonts working 2024-06-24 07:54:16 +05:30
Kovid Goyal
7cdcbe6aeb Better scoring for malformed fonts with weird weight ranges 2024-06-24 07:54:16 +05:30
Kovid Goyal
304ecdd8c2 Refactor scoring 2024-06-24 07:54:16 +05:30
Kovid Goyal
b06a2bb937 Add more font selection tests 2024-06-24 07:54:16 +05:30
Kovid Goyal
46f391ae63 CoreText: Fix selection of font file with multi-file variant font
Also prefer semibold and use similar scorer as fontconfig
2024-06-24 07:54:16 +05:30
Kovid Goyal
1780028420 fontconfig: Prefer semi-bold as bold weight even for system selection 2024-06-24 07:54:16 +05:30
Kovid Goyal
ea65ede572 fontconfig: Lift axes spec to named style 2024-06-24 07:54:16 +05:30
Kovid Goyal
4ab8c16184 ... 2024-06-24 07:54:16 +05:30
Kovid Goyal
9cdc1674cf DRYer 2024-06-24 07:54:15 +05:30
Kovid Goyal
5d3ea374d4 Fix medium face selection via fontconfig when family has only variable font files 2024-06-24 07:54:15 +05:30
Kovid Goyal
4de06fbeb2 Fix face sample rendering 2024-06-24 07:54:15 +05:30
Kovid Goyal
a4bff36baf Get rendering of faces panel working 2024-06-24 07:54:15 +05:30
Kovid Goyal
22ecba93e5 Forgot to initialize canvas when rendering sample text onto it 2024-06-24 07:54:15 +05:30
Kovid Goyal
1d6cd27c6f Code to get specs from options 2024-06-24 07:54:14 +05:30
Kovid Goyal
0706c8cf7c Handle default values not present in variation data under CoreText 2024-06-24 07:54:14 +05:30
Kovid Goyal
076ddd2998 Use the cache for getting variable data for faces 2024-06-24 07:54:14 +05:30
Kovid Goyal
1763cbde46 Function to get the named style used by a variable font instance 2024-06-24 07:54:14 +05:30
Kovid Goyal
b44ffb9815 Get variable font selection working on coretext 2024-06-24 07:54:14 +05:30
Kovid Goyal
69de414ba1 Fix build on older fontconfig 2024-06-24 07:54:14 +05:30
Kovid Goyal
3e8ca9fa73 Cleanup repr for fontconfig faces 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
aaa34bb1d6 Fix crash on CoreText for very large font sizes 2024-06-24 07:54:14 +05:30
Kovid Goyal
852889a561 Implement rendering of sample text 2024-06-24 07:54:14 +05:30
Kovid Goyal
2be91d73dd Move the query_terminal implementation to Go 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
af9f205ec4 Also get the current fg/bg colors to render text with 2024-06-24 07:54:14 +05:30
Kovid Goyal
b6e92dd79d Query font size and DPI from terminal 2024-06-24 07:54:13 +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
0b09afe668 Make kitty +list-fonts a wrapper around choose font 2024-06-24 07:54:13 +05:30
Kovid Goyal
d1ba421e8c Work on getting styles from STAT table data 2024-06-24 07:54:13 +05:30
Kovid Goyal
3814e92f31 Work on listing available styles for a family 2024-06-24 07:54:12 +05:30
Kovid Goyal
3b80ee0981 Load font variable data on demand 2024-06-24 07:54:12 +05:30
Kovid Goyal
71f7da1550 dont use a thread for I/O with kitten 2024-06-24 07:54:12 +05:30
Kovid Goyal
3fa768d7ef get multiple JSON messages working 2024-06-24 07:54:12 +05:30
Kovid Goyal
26837ed6a4 List families asynchronously 2024-06-24 07:54:12 +05:30
Kovid Goyal
1d1998b4de Start work on list-fonts kitten 2024-06-24 07:54:12 +05:30
Kovid Goyal
48ed369342 Code to read the STAT OpenType table 2024-06-24 07:54:12 +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
6d7c54bcb2 Make CoreText signatures for some font finding methods the same as their equivalents in fontconfig 2024-06-24 07:54:12 +05:30
Kovid Goyal
1f58af3f58 DRYer 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
b385ccbc45 Output resolved fonts in debug config 2024-06-24 07:53:16 +05:30
Kovid Goyal
3ca20ebc4e Implement parsing of fvar table
Cant rely on CoreText for this as it has incomplete and buggy APIs
2024-06-24 07:53:16 +05:30