diff options
| author | Saumit Dinesan <justsaumit@protonmail.com> | 2022-09-04 23:45:50 +0530 | 
|---|---|---|
| committer | Saumit Dinesan <justsaumit@protonmail.com> | 2022-09-04 23:45:50 +0530 | 
| commit | 8b775dba2a886c5b2d0fadddafdf58c7c69d9cfb (patch) | |
| tree | dc3dd17d7014084a16d844e9ca853990ca1b7f93 /x.c | |
| parent | df482c4158e3579c8ab41d2851ea4cbb9b0057c7 (diff) | |
replacing ligatures+scrollback patch w +boxdraw and applying said patch(previous one gave errors even on manual patching w 0 errors)
Diffstat (limited to 'x.c')
| -rw-r--r-- | x.c | 17 | 
1 files changed, 14 insertions, 3 deletions
| @@ -20,6 +20,7 @@ char *argv0;  #include "arg.h"  #include "st.h"  #include "win.h" +#include "hb.h"  /* types used in config.h */  typedef struct { @@ -1180,6 +1181,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); @@ -1382,7 +1386,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. */ @@ -1494,6 +1498,9 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x  		numspecs++;  	} +	/* Harfbuzz transformation for ligatures. */ +	hbtransform(specs, glyphs, len, x, y); +  	return numspecs;  } @@ -1663,7 +1670,7 @@ 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;  	XRenderColor colbg; @@ -1671,7 +1678,11 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)  	/* 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; | 
