diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-05-16 11:17:59 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-05-16 11:17:59 +0200 |
| commit | 123bae234ea05efa8221cfb412572b618719e070 (patch) | |
| tree | a4f4a2ca14baa7542233c0ad54514ff98abfea3e /x.c | |
| parent | 045a0fab4f80b57f4a982ae6bc5f33fe21d66111 (diff) | |
| download | st-123bae234ea05efa8221cfb412572b618719e070.tar.gz st-123bae234ea05efa8221cfb412572b618719e070.tar.bz2 st-123bae234ea05efa8221cfb412572b618719e070.zip | |
Updated to 0.8.3 with previous config + mouse scrollback
Diffstat (limited to 'x.c')
| -rw-r--r-- | x.c | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -19,6 +19,7 @@ char *argv0; #include "arg.h" #include "st.h" #include "win.h" +#include "hb.h" /* types used in config.h */ typedef struct { @@ -1031,6 +1032,9 @@ xunloadfont(Font *f) void xunloadfonts(void) { + /* Clear Harfbuzz font cache. */ + hbunloadfonts(); + /* Free the loaded fonts in the font cache. */ while (frclen > 0) XftFontClose(xw.dpy, frc[--frclen].font); @@ -1229,7 +1233,7 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x mode = glyphs[i].mode; /* Skip dummy wide-character spacing. */ - if (mode == ATTR_WDUMMY) + if (mode & ATTR_WDUMMY) continue; /* Determine font for glyph if different from previous glyph. */ @@ -1336,6 +1340,9 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x numspecs++; } + /* Harfbuzz transformation for ligatures. */ + hbtransform(specs, glyphs, len, x, y); + return numspecs; } @@ -1382,7 +1389,7 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i /* Change basic system colors [0-7] to bright system colors [8-15] */ if ((base.mode & ATTR_BOLD_FAINT) == ATTR_BOLD && BETWEEN(base.fg, 0, 7)) - fg = &dc.col[base.fg + 8]; + fg = &dc.col[base.fg]; if (IS_SET(MODE_REVERSE)) { if (fg == &dc.col[defaultfg]) { @@ -1485,14 +1492,17 @@ xdrawglyph(Glyph g, int x, int y) } void -xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) +xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og, Line line, int len) { Color drawcol; /* remove the old cursor */ if (selected(ox, oy)) og.mode ^= ATTR_REVERSE; - xdrawglyph(og, ox, oy); + + /* Redraw the line where cursor was previously. + * It will restore the ligatures broken by the cursor. */ + xdrawline(line, 0, oy, len); if (IS_SET(MODE_HIDE)) return; |
