diff options
author | Luke Smith <luke@lukesmith.xyz> | 2020-07-08 11:15:08 -0400 |
---|---|---|
committer | Luke Smith <luke@lukesmith.xyz> | 2020-07-08 11:15:08 -0400 |
commit | cfef7fa605c6215157c2d2485305f23280b4f6fe (patch) | |
tree | a337520766f009c5716110631eec3d12ef059325 /x.c | |
parent | 3f51ba298c70c346ed1f8257c5e180a074d6ff9b (diff) | |
parent | 6bf7545fc98cd0d42eb727d596215daac809c478 (diff) |
Merge branch 'master' of https://github.com/mackarelfish/st into mackarelfish-master
Diffstat (limited to 'x.c')
-rw-r--r-- | x.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -20,6 +20,7 @@ static char *argv0; #include "arg.h" #include "st.h" #include "win.h" +#include "hb.h" /* types used in config.h */ typedef struct { @@ -1142,6 +1143,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); @@ -1331,7 +1335,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. */ @@ -1443,6 +1447,9 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x numspecs++; } + /* Harfbuzz transformation for ligatures. */ + hbtransform(specs, glyphs, len, x, y); + return numspecs; } @@ -1585,14 +1592,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; |