From 0a1041044141ddbda0c67602e70fe8894e7430fd Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sun, 7 Nov 2021 11:43:28 -0800 Subject: config changes for laptop --- sys/cmd/term/config.h | 6 +++--- sys/cmd/term/hb.c | 2 +- sys/cmd/term/rules.mk | 2 +- sys/cmd/term/term.c | 40 +++++++++++++++++++++------------------- sys/cmd/term/term.h | 2 +- sys/cmd/term/x.c | 16 ++++++++++++++-- 6 files changed, 41 insertions(+), 27 deletions(-) (limited to 'sys/cmd/term') diff --git a/sys/cmd/term/config.h b/sys/cmd/term/config.h index 40bc759..a740ecf 100644 --- a/sys/cmd/term/config.h +++ b/sys/cmd/term/config.h @@ -6,7 +6,7 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char *font = "consolas:pixelsize=16:antialias=true"; +static char *font = "consolas:size=16"; static int borderpx = 2; /* @@ -154,8 +154,8 @@ static uint rows = 24; * Default colour and shape of the mouse cursor */ static uint mouseshape = XC_left_ptr; -static uint mousefg = 7; -static uint mousebg = 0; +static uint mousefg = 0; +static uint mousebg = 7; /* * Color used to display font attributes when fontconfig selected a font which diff --git a/sys/cmd/term/hb.c b/sys/cmd/term/hb.c index 4aed59b..4b6b42d 100644 --- a/sys/cmd/term/hb.c +++ b/sys/cmd/term/hb.c @@ -1,7 +1,7 @@ #include "term.h" #include -#include +#include #define FEATURE(c1,c2,c3,c4) { .tag = HB_TAG(c1,c2,c3,c4), .value = 1, .start = HB_FEATURE_GLOBAL_START, .end = HB_FEATURE_GLOBAL_END } diff --git a/sys/cmd/term/rules.mk b/sys/cmd/term/rules.mk index ef307c1..3d25464 100644 --- a/sys/cmd/term/rules.mk +++ b/sys/cmd/term/rules.mk @@ -16,7 +16,7 @@ $(BINS_$(d)): TCFLAGS = \ $(BINS_$(d)): TCLIBS = \ `$(PKG) --libs fontconfig` \ `$(PKG) --libs freetype2` \ - -lm -lrt -lX11 -lutil -lXft -lXrender -lharfbuzz + -lm -lrt -lX11 -lutil -lXft -lXrender #-lharfbuzz $(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/libunicode/libunicode.a $(OBJ_DIR)/sys/base/base.a $(COMPLINK) diff --git a/sys/cmd/term/term.c b/sys/cmd/term/term.c index f92db28..3cd99c3 100644 --- a/sys/cmd/term/term.c +++ b/sys/cmd/term/term.c @@ -289,11 +289,11 @@ selnormalize(void) int selected(int x, int y) { - if (sel.mode == SelEmpty || sel.ob.x == -1 || + if(sel.mode == SelEmpty || sel.ob.x == -1 || sel.alt != IS_SET(Taltscreen)) return 0; - if (sel.type == SelRectangular) + if(sel.type == SelRectangular) return BETWEEN(y, sel.nb.y, sel.ne.y) && BETWEEN(x, sel.nb.x, sel.ne.x); @@ -389,16 +389,16 @@ getsel(void) ptr = str = xmalloc(bufsize); /* append every set & selected glyph to the selection */ - for (y = sel.nb.y; y <= sel.ne.y; y++) { - if ((linelen = tlinelen(y)) == 0) { + for(y = sel.nb.y; y <= sel.ne.y; y++) { + if((linelen = tlinelen(y)) == 0) { *ptr++ = '\n'; continue; } - if (sel.type == SelRectangular) { + if(sel.type == SelRectangular) { gp = &term.line[y][sel.nb.x]; lastx = sel.ne.x; - } else { + }else{ gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0]; lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1; } @@ -1016,9 +1016,9 @@ tclearregion(int x1, int y1, int x2, int y2) int x, y, temp; Letter *gp; - if (x1 > x2) + if(x1 > x2) temp = x1, x1 = x2, x2 = temp; - if (y1 > y2) + if(y1 > y2) temp = y1, y1 = y2, y2 = temp; LIMIT(x1, 0, term.col-1); @@ -1026,11 +1026,11 @@ tclearregion(int x1, int y1, int x2, int y2) LIMIT(y1, 0, term.row-1); LIMIT(y2, 0, term.row-1); - for (y = y1; y <= y2; y++) { + for(y = y1; y <= y2; y++) { term.dirty[y] = 1; - for (x = x1; x <= x2; x++) { + for(x = x1; x <= x2; x++) { gp = &term.line[y][x]; - if (selected(x, y)) + if(selected(x, y)) selclear(); gp->fg = term.c.attr.fg; gp->bg = term.c.attr.bg; @@ -2104,9 +2104,11 @@ tputc(rune u) else return; +#if 0 if(!hb_unicode_compose(hb_unicode_funcs_get_default(),gp->u, u, &nu)) { return; } +#endif gp->u = nu; return; @@ -2134,7 +2136,7 @@ tputc(rune u) goto check_control_code; } - if (IS_SET(Tsixel)) { + if(IS_SET(Tsixel)) { /* TODO: implement sixel mode */ return; } @@ -2155,7 +2157,7 @@ tputc(rune u) * term.esc = 0; * strhandle(); */ - if (strescseq.siz > (SIZE_MAX - UTFmax) / 2) + if(strescseq.siz > (SIZE_MAX - UTFmax) / 2) return; strescseq.siz *= 2; strescseq.buf = xrealloc(strescseq.buf, strescseq.siz); @@ -2210,20 +2212,20 @@ check_control_code: return; } - if (selected(term.c.x, term.c.y)) + if(selected(term.c.x, term.c.y)) selclear(); gp = &term.line[term.c.y][term.c.x]; - if (IS_SET(Twrap) && (term.c.state & CursorWrap)) { + if(IS_SET(Twrap) && (term.c.state & CursorWrap)) { gp->mode |= Gwrap; tnewline(1); gp = &term.line[term.c.y][term.c.x]; } - if (IS_SET(Tinsert) && term.c.x+width < term.col) + if(IS_SET(Tinsert) && term.c.x+width < term.col) memmove(gp+width, gp, (term.col - term.c.x - width) * sizeof(Letter)); - if (term.c.x+width > term.col) { + if(term.c.x+width > term.col) { tnewline(1); gp = &term.line[term.c.y][term.c.x]; } @@ -2238,9 +2240,9 @@ check_control_code: gp[1].mode = Gwdummy; } } - if (term.c.x+width < term.col) { + if(term.c.x+width < term.col) { tmoveto(term.c.x+width, term.c.y); - } else { + }else{ term.c.state |= CursorWrap; } } diff --git a/sys/cmd/term/term.h b/sys/cmd/term/term.h index 3ff2852..4cd8b4b 100644 --- a/sys/cmd/term/term.h +++ b/sys/cmd/term/term.h @@ -11,7 +11,7 @@ #include #include -#include +#include // ----------------------------------------------------------------------- // macros diff --git a/sys/cmd/term/x.c b/sys/cmd/term/x.c index ea64bff..27a2e7a 100644 --- a/sys/cmd/term/x.c +++ b/sys/cmd/term/x.c @@ -12,8 +12,10 @@ #include /* harfbuzz additions */ +#if 0 void hbunloadfonts(); void hbtransform(XftGlyphFontSpec *, const Letter*, size_t, int, int); +#endif /* types used in config.h */ typedef struct Shortcut Shortcut; @@ -1025,7 +1027,9 @@ xunloadfont(Font *f) void xunloadfonts(void) { +#if 0 hbunloadfonts(); +#endif /* Free the loaded fonts in the font cache. */ while (frclen > 0) @@ -1235,11 +1239,14 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, Letter *glyphs, int len, int x, int mode = glyphs[i].mode; /* Skip dummy wide-character spacing. */ +#if 0 if(mode & Gwdummy) +#endif + if(mode == Gwdummy) continue; /* Determine font for glyph if different from previous glyph. */ - if(prevmode != mode) { + if(prevmode != mode){ prevmode = mode; font = &dc.font; frcflags = FRC_NORMAL; @@ -1259,7 +1266,7 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, Letter *glyphs, int len, int x, int /* lookup character index with default font. */ glyphidx = XftCharIndex(xw.dpy, font->match, r); - if(glyphidx) { + if(glyphidx){ specs[numspecs].font = font->match; specs[numspecs].glyph = glyphidx; specs[numspecs].x = (short)xp; @@ -1342,7 +1349,9 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, Letter *glyphs, int len, int x, int numspecs++; } +#if 0 hbtransform(specs, glyphs, len, x, y); +#endif return numspecs; } @@ -1489,7 +1498,10 @@ xdrawcursor(int cx, int cy, Letter g, int ox, int oy, Letter og, Letter *line, i /* remove the old cursor */ if(selected(ox, oy)) og.mode ^= Greverse; + xdrawglyph(og, ox, oy); +#if 0 xdrawline(line, 0, oy, len); +#endif if(IS_SET(Whide)) return; -- cgit v1.2.1