2327 Commits

Author SHA1 Message Date
Kovid Goyal
ddc327b772
Prevent DoS attacks via requesting too many fallback fonts 2017-11-13 08:40:47 +05:30
Kovid Goyal
a70f6405ac
Allocate fallback fonts on the heap
The size of a font is quite large ~ 100KB so it does not make sense to
store their data statically.
2017-11-13 08:39:30 +05:30
Kovid Goyal
bf0ad30d17
DRYer 2017-11-13 07:30:35 +05:30
Kovid Goyal
6fbe52acf4
... 2017-11-13 07:13:42 +05:30
Kovid Goyal
9fccc38382
Better fix for not using the unsafe to break flag
Recognize special glyphs by comparing the index to the glyph for the
codepoint in the font. Cannot rely on glyph width as many glyphs have
zero width. For example the glyph for space characters.
2017-11-13 07:03:58 +05:30
Kovid Goyal
339c0d2980
Put back consumed API 2017-11-12 23:43:22 +05:30
Kovid Goyal
336857a106
A more general cp->gid API 2017-11-12 23:43:21 +05:30
Kovid Goyal
d01e5f72fc
Use a cache for dummy glyph lookups 2017-11-12 23:43:21 +05:30
Kovid Goyal
5c6be7f637
Insulate emoji test from system wcwidth 2017-11-12 23:43:21 +05:30
Kovid Goyal
088087df73
Use only cluster numbers and glyph sizes for grouping glyphs into cells
See https://github.com/behdad/harfbuzz/issues/615 for discussion
2017-11-12 23:43:21 +05:30
Kovid Goyal
0bd093ec2e
Also fix mouse URXVT_PROTOCOL
Fixes #169
2017-11-12 22:11:20 +05:30
Kovid Goyal
4613e161ce
Fix incorrect encoding for mouse events in the UTF8_PROTOCOL
Fixes #167
2017-11-12 22:05:01 +05:30
Kovid Goyal
dad9444db0
Dont crash if harfbuzz return null info or positions pointers 2017-11-12 17:18:49 +05:30
Kovid Goyal
dd0080d3ce
Fix #168 2017-11-12 16:14:59 +05:30
Kovid Goyal
6b9303ba7d
Dont store standard cursors on the window object 2017-11-12 12:42:09 +05:30
Kovid Goyal
eb32423fb6
oops 2017-11-12 12:33:44 +05:30
Kovid Goyal
9bb2a05a9b
Update list of major features 2017-11-12 11:49:42 +05:30
Kovid Goyal
653fc0dd7e
Fix #50 2017-11-12 11:42:50 +05:30
Kovid Goyal
cee6ef9941
Center multi-cell glyph runs 2017-11-12 11:04:52 +05:30
Kovid Goyal
67a37f1f41
Adjust the point size of fallback and symbol fonts so that their heights match the current cell height 2017-11-12 10:30:57 +05:30
Kovid Goyal
604e82fd65
oops 2017-11-11 21:15:19 +05:30
Kovid Goyal
5f4e003bed
Add a ligature shaping test 2017-11-11 20:55:53 +05:30
Kovid Goyal
53e9f35c1f
Add test for harfbuzz shaping 2017-11-11 18:47:34 +05:30
Kovid Goyal
c56a2ed055
Ensure that harfbuzz always uses the OpenType shaper 2017-11-11 18:25:25 +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
f5040532c5
Ensure combining chars are zero-width regardless of wcwidth implementation 2017-11-11 09:29:28 +05:30
Kovid Goyal
447a2fe8cf
... 2017-11-11 09:20:34 +05:30
Kovid Goyal
a14defbab7
Change the showcase fonts 2017-11-11 09:13:04 +05:30
Kovid Goyal
3592f82e4f
Implement fallback fonts in CoreText 2017-11-11 08:08:03 +05:30
Kovid Goyal
4edfa9f4fd
Implement loading of bitmap fonts via FreeType
Needed for some fallback fonts such as Apple Color Emoji
2017-11-11 08:07:18 +05:30
Kovid Goyal
51fe1e4dab
... 2017-11-11 07:12:50 +05:30
Kovid Goyal
2df9f3500c
Build with --debug in update-on-ox 2017-11-11 07:12:21 +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
b603d7abb7
Ensure underline_thickness is not zero 2017-11-10 21:46:50 +05:30
Kovid Goyal
3437433ed4
... 2017-11-10 17:43:47 +05:30
Kovid Goyal
cccacfdf7c
Restore Apple's line height fudge factor on macOS 2017-11-10 17:38:36 +05:30
Kovid Goyal
c6fa0503af
Simplify font_units_to_pixels
Make use of the precalculated scaling value in the FT Face metrics
object
2017-11-10 17:23:28 +05:30
Kovid Goyal
579933ac27
... 2017-11-10 15:55:59 +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
d2654db6f0
oops 2017-11-10 14:57:44 +05:30
Kovid Goyal
c2b2833a37
API to load FreeType font from path and psname 2017-11-10 14:50:15 +05:30
Kovid Goyal
b0fffad0c2
API to create FreeType face from in memory data 2017-11-10 14:30:54 +05:30
Kovid Goyal
774956053a
Allow storing arbitrary data on FreeType Face objects 2017-11-10 14:20:20 +05:30
Kovid Goyal
5c582f7639
Start work on harfbuzz rendering on macs 2017-11-10 12:52:54 +05:30
Kovid Goyal
ccc0433fa1
... 2017-11-10 11:26:58 +05:30
Kovid Goyal
43bf056f09
Add a command to list fonts 2017-11-10 11:02:32 +05:30
Kovid Goyal
1d7b650fd0
... 2017-11-10 10:30:34 +05:30
Kovid Goyal
fefe6c9024
Use fc-list instead of fc-match to select fonts
This is because there is no way to force fc-match to return a monospace
font. So if the user specifies a non-existent font we end up with some
non-monospaced font, which looks terrible.

Also, this makes the font selection logic or macOS and Linux similar.
2017-11-10 10:15:37 +05:30
Kovid Goyal
b58e900806
Call prerender() in rendering tests setup 2017-11-10 08:30:35 +05:30