Commit Graph

99 Commits

Author SHA1 Message Date
Kovid Goyal
bd5a85a4e7 Fix compilation on ancient linux distros 2018-10-24 08:40:25 +05:30
Kovid Goyal
631f97eb26 Linux: Fix a crash when using the GNU Unifont as a fallback font
Fixes #1087
2018-10-24 08:20:37 +05:30
Kovid Goyal
0c0ce4844c Dont use deprecated FT_Bitmap_New 2018-10-24 07:07:57 +05:30
Kovid Goyal
ab65b9b2fb Do not convert bitmaps when loading a glyph to access its metrics 2018-09-09 09:46:19 +05:30
Kovid Goyal
f7a621f89f Use bitmap pitch to iterate over pixels 2018-09-09 09:42:51 +05:30
Kovid Goyal
b808a05e5e Clean up monochrome bitmap support code 2018-09-09 08:33:32 +05:30
ismed
739ed906f0 Use the old FT_Bitmap_New for backward compatibility 2018-09-08 21:07:38 +01:00
ismed
9fd462077a Add support for embedded bitmap glyphs 2018-09-08 20:22:48 +01:00
Luflosi
1d91edfb00 dont -> don't 2018-08-29 03:18:25 +02:00
Kovid Goyal
cc767061cc Linux: Fix compilation with python 3.7
Fixes #714
2018-07-10 18:47:05 +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
2a99ef254f Dont segfault when printing a freetype font object with a NULL postscript name 2018-05-17 19:49:31 +05:30
Kovid Goyal
aa18429a8c DRYer 2018-04-22 21:22:08 +05:30
Kovid Goyal
9c43707f40 Make the hinting defaults zero when missing 2018-04-22 20:34:00 +05:30
Kovid Goyal
99ff92a5a7 Don't fail to start if the user deletes the hintstyle key from their fontconfig configuration. Fixes #480 2018-04-22 20:29:46 +05:30
Kovid Goyal
d866c0d202 Fix NULL return without error set 2018-04-22 20:19:21 +05:30
Kovid Goyal
ce85382c68 Revert the change to use rendered bitmap width to calculate cell width
Instead if the bitmap is up to two pixels wider than the cell width
simply crop on the right. Fixes #352
2018-03-30 18:54:15 +05:30
Kovid Goyal
b3b216a6dc ... 2018-03-27 12:09:18 +05:30
Kovid Goyal
431564c8bc Linux: When calculating cell widths use the actual rendered bitmap width in addition to the horizontal advance reported by FreeType.
The horizontal advance is insufficient for some fonts at some point
sizes. So although rendering the characters is slower, we do it
to ensure cell width is correct. Fixes #352
2018-03-27 12:04:38 +05:30
Kovid Goyal
527255e3a1 Fix compilation with gcc 8
Apparently some nitwit Linux distros have made an unreleased compiler
their default compiler. Fixes #376

Fixes various new warnings that GCC 8 issues
2018-03-12 10:38:12 +05:30
Kovid Goyal
59a5e23466 Almost always resize glyphs that are too wide
When using FreeType, rescale glyphs that dont fit if they are more than
1px wider than the cell rather than 25% of the cell width. This matches
the behavior of CoreText and is needed for rendering the various Emoji
with default text presentation (i.e. emoji that have wcwidth() == 1)
2018-02-05 09:21:14 +05:30
Kovid Goyal
c74f4a8165 Fix extra columns cut-off from the right edge of italic characters that are too wide to fit in a cell 2018-01-28 10:06:39 +05:30
Kovid Goyal
1ae7ae4a1d Fix consecutive separate ligatures being rendered in the same group
Rendering multiple ligatures in the smae group is bad for performance
and also causes incorrect rendering if the last ligature in the group
does not fit into the number of cells in the group.
2018-01-14 11:18:44 +05:30
Kovid Goyal
0fcce6ec58 Remove trailing whitespace from native code files 2017-12-20 08:44:47 +05:30
Kovid Goyal
c86c166448 More work on positioning glyphs with CoreText 2017-12-11 18:48:14 +05:30
Kovid Goyal
5407fa72b4 Start work on rendering with CoreText 2017-12-10 20:28:06 +05:30
Kovid Goyal
b1853ca966 Dont insist color fonts have bitmaps 2017-12-09 12:01:43 +05:30
Kovid Goyal
ed2e83654f Draw emoji on macOS using CoreText rather than FreeType
Needed because FreeType cannot handle the latest version of the Apple
Color Emoji font, which probably uses SVG-in-OTF instead of SBIX.
Finishes up the color emoji implementation.
2017-12-09 12:01:43 +05:30
Kovid Goyal
ec6dcd53b5 Finish up placement of color emojis
Note that for some reason rendering is broken on Apple
2017-12-09 12:01:43 +05:30
Kovid Goyal
03847b15f6 Implement downsampling of color emoji bitmaps
Still need to fix placement of the downsampled bitmaps in the cell
2017-12-09 12:01:43 +05:30
Kovid Goyal
8d7515bd9b Basic color emoji rendering working
Still need to downscale color bitmaps to fit into cells
2017-12-09 12:01:43 +05:30
Kovid Goyal
9cda51b5a8 Store sprites in an RGBA texture
Needed to support color emoji
2017-12-09 12:01:42 +05:30
Kovid Goyal
01324a7ad2 Reduce the rescale threshold from 133% to 125% 2017-12-05 23:32:40 +05:30
Kovid Goyal
122ad8a1f8 Detect if a freetype font has color tables 2017-12-05 23:31:26 +05:30
Kovid Goyal
9ed980a511 More 32bit fixes 2017-11-30 00:02:44 +05:30
Kovid Goyal
32920fee5b Fix super imposing of glyphs generating fringes 2017-11-19 07:56:35 +05:30
Kovid Goyal
336857a106 A more general cp->gid API 2017-11-12 23:43:21 +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
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
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
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