diff options
Diffstat (limited to 'x.c')
-rw-r--r-- | x.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -19,6 +19,7 @@ static char *argv0; | |||
19 | #include "arg.h" | 19 | #include "arg.h" |
20 | #include "st.h" | 20 | #include "st.h" |
21 | #include "win.h" | 21 | #include "win.h" |
22 | #include "hb.h" | ||
22 | 23 | ||
23 | /* types used in config.h */ | 24 | /* types used in config.h */ |
24 | typedef struct { | 25 | typedef struct { |
@@ -1117,6 +1118,9 @@ xunloadfont(Font *f) | |||
1117 | void | 1118 | void |
1118 | xunloadfonts(void) | 1119 | xunloadfonts(void) |
1119 | { | 1120 | { |
1121 | /* Clear Harfbuzz font cache. */ | ||
1122 | hbunloadfonts(); | ||
1123 | |||
1120 | /* Free the loaded fonts in the font cache. */ | 1124 | /* Free the loaded fonts in the font cache. */ |
1121 | while (frclen > 0) | 1125 | while (frclen > 0) |
1122 | XftFontClose(xw.dpy, frc[--frclen].font); | 1126 | XftFontClose(xw.dpy, frc[--frclen].font); |
@@ -1320,7 +1324,7 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x | |||
1320 | mode = glyphs[i].mode; | 1324 | mode = glyphs[i].mode; |
1321 | 1325 | ||
1322 | /* Skip dummy wide-character spacing. */ | 1326 | /* Skip dummy wide-character spacing. */ |
1323 | if (mode == ATTR_WDUMMY) | 1327 | if (mode & ATTR_WDUMMY) |
1324 | continue; | 1328 | continue; |
1325 | 1329 | ||
1326 | /* Determine font for glyph if different from previous glyph. */ | 1330 | /* Determine font for glyph if different from previous glyph. */ |
@@ -1432,6 +1436,9 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x | |||
1432 | numspecs++; | 1436 | numspecs++; |
1433 | } | 1437 | } |
1434 | 1438 | ||
1439 | /* Harfbuzz transformation for ligatures. */ | ||
1440 | hbtransform(specs, glyphs, len, x, y); | ||
1441 | |||
1435 | return numspecs; | 1442 | return numspecs; |
1436 | } | 1443 | } |
1437 | 1444 | ||
@@ -1585,14 +1592,17 @@ xdrawglyph(Glyph g, int x, int y) | |||
1585 | } | 1592 | } |
1586 | 1593 | ||
1587 | void | 1594 | void |
1588 | xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) | 1595 | xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og, Line line, int len) |
1589 | { | 1596 | { |
1590 | Color drawcol; | 1597 | Color drawcol; |
1591 | 1598 | ||
1592 | /* remove the old cursor */ | 1599 | /* remove the old cursor */ |
1593 | if (selected(ox, oy)) | 1600 | if (selected(ox, oy)) |
1594 | og.mode ^= ATTR_REVERSE; | 1601 | og.mode ^= ATTR_REVERSE; |
1595 | xdrawglyph(og, ox, oy); | 1602 | |
1603 | /* Redraw the line where cursor was previously. | ||
1604 | * It will restore the ligatures broken by the cursor. */ | ||
1605 | xdrawline(line, 0, oy, len); | ||
1596 | 1606 | ||
1597 | if (IS_SET(MODE_HIDE)) | 1607 | if (IS_SET(MODE_HIDE)) |
1598 | return; | 1608 | return; |