aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/term
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/term')
-rw-r--r--sys/cmd/term/config.h6
-rw-r--r--sys/cmd/term/hb.c2
-rw-r--r--sys/cmd/term/rules.mk4
-rw-r--r--sys/cmd/term/term.c40
-rw-r--r--sys/cmd/term/term.h2
-rw-r--r--sys/cmd/term/x.c16
6 files changed, 42 insertions, 28 deletions
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 <X11/Xft/Xft.h>
-#include <hb-ft.h>
+#include <harfbuzz/hb-ft.h>
#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 7beb8dc..45c9eb2 100644
--- a/sys/cmd/term/rules.mk
+++ b/sys/cmd/term/rules.mk
@@ -2,7 +2,7 @@ include share/push.mk
# Iterate through subdirectory tree
# Local sources
-SRCS_$(d) := $(d)/term.c $(d)/x.c $(d)/hb.c
+SRCS_$(d) := $(d)/term.c $(d)/x.c #$(d)/hb.c
BINS_$(d) := $(d)/term
include share/paths.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/libutf/libutf.a $(OBJ_DIR)/sys/base/base.a
$(COMPLINK)
diff --git a/sys/cmd/term/term.c b/sys/cmd/term/term.c
index 8805b0b..50ab29c 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 f779654..6784974 100644
--- a/sys/cmd/term/term.h
+++ b/sys/cmd/term/term.h
@@ -11,7 +11,7 @@
#include <sys/types.h>
#include <sys/wait.h>
-#include <hb.h>
+#include <harfbuzz/hb.h>
// -----------------------------------------------------------------------
// 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 <X11/XKBlib.h>
/* 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;