Commit Graph

205 Commits

Author SHA1 Message Date
Kovid Goyal
a88cb2d14d Fix horizontal alignment of emoji incorrect becase rendered_width was not being set after switching to using cairo to render them
Fixes #9395
2026-01-20 20:01:20 +05:30
Kovid Goyal
0c7dd7edb2 Implement horizontal alignment for font based rendering
Still need to do it for box chars
2025-02-19 09:04:22 +05:30
Kovid Goyal
4b38818dca Make CodeQL happy 2025-02-06 10:13:48 +05:30
Kovid Goyal
ea5db4ec09 fix build with old compiler 2025-02-03 14:01:11 +05:30
Kovid Goyal
02a88b2803 Use 64 byte aligned memory for cairo surface buffer 2025-02-03 11:06:42 +05:30
Kovid Goyal
a0b6c49c94 DRYer 2025-02-03 11:06:42 +05:30
Kovid Goyal
b5cc4b8f4e Set variation settings for cairo fonts 2025-02-03 11:06:42 +05:30
Kovid Goyal
bab14e8612 Set the palette index cairo font option 2025-02-03 11:06:42 +05:30
Kovid Goyal
3d06cb8709 Set cairo hinting options 2025-02-03 11:06:41 +05:30
Kovid Goyal
f145403fce Render all emoji not just colrv1 with cairo
Less code duplication and we get upscaling of bitmaps for free needed
when rendering large sized text for multicells.
2025-02-03 11:06:41 +05:30
Kovid Goyal
a9677f655a Fix baseline alignment when redering with cairo 2025-02-03 11:06:41 +05:30
Kovid Goyal
44eec08b24 Fix buffer not being cleared before re-use 2025-02-03 11:06:41 +05:30
Kovid Goyal
ea54cbf193 Fix cairo not releasing static resources at program shutdown 2025-02-03 11:06:41 +05:30
Kovid Goyal
9d9bfc6f26 Forgot to unpremultiply alpha for cairo 2025-02-03 11:06:41 +05:30
Kovid Goyal
1b6fa1ee03 Get rendering of COLRv1 glyphs basically working
TODO:
Set cairo font options: hinting, variations, antialias, etc.
Add a test for rendering with some small colrv1 sample font
Check that the destructor is dereferencing the freetype font as expected
2025-02-03 11:06:41 +05:30
Kovid Goyal
c599b7e02f API to render a single codepoint using a Face 2025-02-03 10:56:52 +05:30
Kovid Goyal
b96da25380 More work on multicell font rendering 2025-02-03 10:56:44 +05:30
Kovid Goyal
8993386399 Store font related cell metrics in a single struct 2025-02-03 10:56:44 +05:30
Matubu
b0e49d70db Fix segfault when font descriptor point to invalid font file 2024-10-18 02:31:54 +02:00
Kovid Goyal
ab3cefd81f Output font features in debug info 2024-08-25 11:19:36 +05:30
Kovid Goyal
2560a024b9 ... 2024-08-24 11:20:16 +05:30
Kovid Goyal
e5321f96a3 never return zero cell width for a font 2024-08-24 11:19:44 +05:30
Kovid Goyal
60601a6dba Fix #7772 2024-08-24 11:12:37 +05:30
Kovid Goyal
80ec6ae4b6 DRYer 2024-08-18 13:41:59 +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
a8daf06737 Linux: choose-fonts: fix rendering of ligatures in preview text 2024-06-25 11:28:47 +05:30
Kovid Goyal
0cc8dd28de Add support for font features when rendering sample text 2024-06-24 07:54:19 +05:30
Kovid Goyal
e2919a0f2d Fix preview rendering when height of previewed font greater than cell height 2024-06-24 07:54:18 +05:30
Kovid Goyal
a69d71d416 Render font feature list in UI 2024-06-24 07:54:18 +05:30
Kovid Goyal
57edb412e6 Add tests to validate feature-from-spec 2024-06-24 07:54:18 +05:30
Kovid Goyal
060732b428 work on passing font features via font specs 2024-06-24 07:54:18 +05:30
Kovid Goyal
7e56920fa3 Get feature human readable names 2024-06-24 07:54:18 +05:30
Kovid Goyal
0f76d3e13b Code to read features from GSUB/GPOS tables 2024-06-24 07:54:18 +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
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
3e8ca9fa73 Cleanup repr for fontconfig faces 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
f0cac79143 Work on rendering sample text for a font 2024-06-24 07:54:14 +05:30
Kovid Goyal
48ed369342 Code to read the STAT OpenType table 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
b385ccbc45 Output resolved fonts in debug config 2024-06-24 07:53:16 +05:30
Kovid Goyal
ba1a268de0 Implement postscript variation name prefix for CoreText as well 2024-06-24 07:53:16 +05:30
Kovid Goyal
98dac1020d Show the postscript variations name prefix when listing fonts 2024-06-24 07:53:16 +05:30
Kovid Goyal
2244b664bc Get variable font data from CoreText 2024-06-24 07:53:15 +05:30
Kovid Goyal
fcbf0782b5 Fix building on older FreeType 2024-06-24 07:53:15 +05:30
Kovid Goyal
f4311d4b61 Add information about variable fonts to list-fonts output 2024-06-24 07:53:15 +05:30
Kovid Goyal
57770f2f55 Code to get variable data from freetype to python 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
bb3b5df99a better field name 2024-04-18 22:46:20 +05:30