222 Commits

Author SHA1 Message Date
Kovid Goyal
536d6e00d9
Further simplify logic for PUA space ligatures 2021-11-14 12:47:54 +05:30
Kovid Goyal
725a04b321
Fix #4236 2021-11-14 12:42:08 +05:30
Kovid Goyal
4fc8267264
Fix #4235 2021-11-14 10:23:42 +05:30
Kovid Goyal
fbf47f75d5
Fix soft hyphens not being preserved when round tripping text through the terminal
Also roundtrip all characters in the Cf category.

Characters with the DI (Default Ignorable) property are now
preserved but not rendered and treated as zero-width
as per the unicode standard.
See https://www.unicode.org/faq/unsup_char.html
2021-10-07 12:44:22 +05:30
Kovid Goyal
40b50332de
Fix space ligatures not working with Iosevka for some characters in the Enclosed Alphanumeric Supplement
Recognize chars in this block as non-emoji dingbats to turn on space
ligatures for them

Fixes #3954
2021-08-19 22:28:07 +05:30
Kovid Goyal
ef76c075e0
Get rid of bits from CellAttrs 2021-08-18 10:06:08 +05:30
Kovid Goyal
780e526143
Use a union for cell attributes
Cleaner code, no performance impact
2021-08-18 10:06:08 +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
9d3a2cc219
Fix space based ligatures not rendering correctly
The new infinite ligature cache needed to be keyed by total number of
cells as well as total number of glyphs, otherwise a space based
ligature which is the same glyph rendered in different numbers of cells
wold render incorrectly when present in multiple forms. Fixes #3729
2021-06-16 18:41:01 +05:30
Kovid Goyal
1b35708d89
macOS: Fix a crash when rendering ligatures larger than 128 characters
Fixes #3724
2021-06-14 07:15:52 +05:30
Kovid Goyal
d09c20aa01
Store the global font_size on the opts object where it belongs 2021-06-04 21:51:02 +05:30
Kovid Goyal
46a0566e2e
Special handling for IOSevka's future ligatures
See https://github.com/be5invis/Iosevka/issues/1007
2021-05-21 17:53:49 +05:30
Kovid Goyal
0a742ea8d0
middle is more common than start or end 2021-05-18 09:55:00 +05:30
Kovid Goyal
eced40a761
... 2021-05-07 09:31:31 +05:30
Kovid Goyal
5ac315bc3a
DRYer 2021-05-07 09:30:44 +05:30
Kovid Goyal
32df4daa63
Fix warning from CodeQL 2021-05-07 09:27:52 +05:30
Kovid Goyal
dc6ab69387
Workaround spurious error reported by ASAN 2021-05-07 08:34:18 +05:30
Kovid Goyal
7301c56753
... 2021-05-07 07:42:39 +05:30
Kovid Goyal
3b76d657bd
Fix colored indication not being sent to GPU 2021-05-07 07:41:19 +05:30
Kovid Goyal
2adb6240e4
Reduce GPU memory for infinite length ligatures
An infinite length ligature (longer than 9 glyphs) that has long
sequences of a repeated glyph now does not store a separate sprite
for every repeat.

For example in the ligature ---------- even though there are 10 hyphen
glyphs only four will be stored on the GPU.
2021-05-07 06:59:30 +05:30
Kovid Goyal
e11af496da
Remove incorrect cast 2021-05-07 06:59:30 +05:30
Kovid Goyal
f6e33406d7
Dont assume all sprites are rendered if the first one is 2021-05-07 06:59:30 +05:30
Kovid Goyal
6eab138d68
... 2021-05-07 06:59:29 +05:30
Kovid Goyal
33287115de
Support infinite length ligatures 2021-05-07 06:59:24 +05:30
Kovid Goyal
4a34f596a8
Remove MAX_EXTRA_GLYPHS_IN_GROUP 2021-05-07 06:58:55 +05:30
Kovid Goyal
7616a3e743
... 2021-05-07 06:58:55 +05:30
Kovid Goyal
c64353c324
Dont make canvas dependent on max num of glyphs 2021-05-07 06:58:55 +05:30
Kovid Goyal
8eac22d37a
typo 2021-05-07 06:58:55 +05:30
Kovid Goyal
35fab12330
Dont rely on max glyphs limit for scratch space 2021-05-07 06:58:55 +05:30
Kovid Goyal
a46988bc50
Simplify code by getting rid of ExtraGlyphs 2021-05-07 06:58:54 +05:30
Kovid Goyal
26e1d6fe5c
Use uthash for glyph properties as well 2021-05-07 06:58:54 +05:30
Kovid Goyal
33de0f821f
Use uthash for the sprite position cache 2021-05-07 06:58:54 +05:30
Kovid Goyal
accdf9a6a8
DRYer 2021-05-06 08:57:38 +05:30
Kovid Goyal
1a4efd9d81
Remove unused code 2021-05-06 07:46:31 +05:30
Kovid Goyal
f32ad617a2
Special case rendering of the few remaining Powerline box drawing chars
Fixes #3535
2021-04-26 09:07:55 +05:30
Kovid Goyal
7043d565c9
... 2021-04-24 09:44:40 +05:30
Kovid Goyal
3f5f218e0b
Use correct printf codes 2021-04-19 13:00:48 +05:30
Kovid Goyal
d28caf15b2
More glyph grouping fixes 2021-03-25 14:06:16 +05:30
Kovid Goyal
7c7933efa9
Fix #3416 2021-03-24 13:17:38 +05:30
Kovid Goyal
1f4fdb174a
Fix rendering of the new infinite length ligatures on CoreText
Apparently on CoreText, harfbuzz gives incorrect values for glyph
positions. So we use it only for selection and grouping of glyphs.
Actual positioning is done using CoreText. This means sophisticated
positioning using GPOS tables is probably broken, but that isn't really
useable in a character grid anyway.

Also remove the hack where glyph_centering was done for calt ligatures
as it seems to not be needed with modern FiraCode and CoreText
rendering. Fixes #3372
2021-03-11 20:11:40 +05:30
Kovid Goyal
3d9a95d0cd
... 2021-02-15 16:24:39 +05:30
Kovid Goyal
085bc09dfb
Micro-optimization 2021-02-15 16:24:04 +05:30
Kovid Goyal
886309850f
Dont add alpha when rendering alpha mask on canvas
Instead use the larger of the two alphas. This gives better results
for overlapping text, such as the infinite length ligature glyphs used
by FiraCode. I dont think adding ever gave better results anyway.
2021-02-15 16:08:06 +05:30
Kovid Goyal
ba005e991a
Improve handling of infinite length ligatures in newer versions of FiraCode and CascadiaCode.
Now such ligatures are detected based on glyph naming convention.
This removes the gap in the ligatures at cell boundaries. However, at
least in Fira Code the infinite length ligature glyphs define a negative
left side bearing. This means they overlap when drawn consecutively,
leading to unsightly bumps at the joins.

Fixes #2695
2021-02-15 15:49:09 +05:30
Kovid Goyal
912c46fc57
Fix rendering of ligatures in the latest release of Cascadia code
For some reason it puts empty glyphs after the ligature glyph rather than before it.
There is a possibility this fix might break something else, we will see.
Fixes #3313
2021-02-15 11:57:57 +05:30
Kovid Goyal
7b816bb96f
Font independent rendering for braille characters, which ensures they are properly aligned at all font sizes. 2020-10-25 20:20:22 +05:30
Kovid Goyal
ca6010789e
Fix a memory leak when changing font sizes
had forgotten to free unused font groups
2020-09-18 07:40:30 +05:30
Kovid Goyal
d7a6ceb3a6
Add character cell diagonals to box_chars 2020-09-03 13:51:54 +05:30
Kovid Goyal
e95c789d4b
Add the block elements to box_chars
Also use a single eight_bar function for all blocks
2020-09-03 10:56:06 +05:30
Kovid Goyal
a508161265
Add smooth mosaic chars to box drawing 2020-09-02 22:00:58 +05:30