Skip to content

Commit

Permalink
Fix yaft package.
Browse files Browse the repository at this point in the history
  • Loading branch information
verylowfreq committed Apr 15, 2022
1 parent 5a6b0c1 commit e9e0306
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 30 deletions.
4 changes: 2 additions & 2 deletions package/yaft/yaft.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
YAFT_VERSION = 59ef091187736200e07ee1d67d6249ad4c691542
YAFT_LICENSE = MIT License
YAFT_SITE = $(call github,uobikiemukot,yaft,v$(MICROPYTHON_LIB_2_VERSION))
YAFT_SITE = https://github.com/uobikiemukot/yaft
YAFT_SITE_METHOD = git
YAFT_LICENSE = MIT License
YAFT_LICENSE_FILES = LICENSE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
diff --git a/conf.h b/conf.h
index 65df86a..21c190e 100644
--- a/conf.h
+++ b/conf.h
@@ -12,6 +12,7 @@ enum {
/* misc */
enum {
VERBOSE = false, /* write dump of input to stdout, debug message to stderr */
+ //VERBOSE = true,
TABSTOP = 8, /* hardware tabstop */
LAZY_DRAW = true, /* don't draw when input data size is larger than BUFSIZE */
BACKGROUND_DRAW = false, /* always draw even if vt is not active */
@@ -20,6 +21,7 @@ enum {
SUBSTITUTE_HALF = 0x0020, /* used for missing glyph(single width): U+0020 (SPACE) */
SUBSTITUTE_WIDE = 0x3000, /* used for missing glyph(double width): U+3000 (IDEOGRAPHIC SPACE) */
REPLACEMENT_CHAR = 0x003F, /* used for malformed UTF-8 sequence : U+003F (QUESTION MARK) */
+ //REPLACEMENT_CHAR = '*'
};

/* TERM value */
diff --git a/makefile b/makefile
index 1eac71f..bd59bcf 100644
index 1eac71f..8820a57 100644
--- a/makefile
+++ b/makefile
@@ -1,8 +1,11 @@
CC ?= gcc
#CC ?= clang
+TARGET_CC ?= arm-buildroot-linux-gnueabi-gcc

CFLAGS ?= -std=c99 -pedantic -Wall -Wextra -O3 -s -pipe
-CFLAGS ?= -std=c99 -pedantic -Wall -Wextra -O3 -s -pipe
+CFLAGS_FOR_BUILD += -std=c99 -pedantic -Wall -Wextra -O3 -s -pipe
LDFLAGS ?=
+TARGET_CFLAGS ?= -std=c99 -Wall -Wextra -O1 -g -s -pipe
+TARGET_LDFLAGS ?=

XCFLAGS ?= -std=c99 -pedantic -Wall -Wextra -I/usr/include/X11/ -O3 -s -pipe
XLDFLAGS ?= -lX11
@@ -23,7 +26,7 @@ yaft: mkfont_bdf
yaftx: mkfont_bdf

mkfont_bdf: tools/mkfont_bdf.c tools/mkfont_bdf.h tools/bdf.h tools/util.h
- $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+ $(CC_FOR_BUILD) -o $@ $< $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD)

glyph.h: mkfont_bdf
# If you want to use your favorite fonts, please change following line
@@ -35,7 +38,7 @@ glyph.h: mkfont_bdf

yaft: yaft.c $(HDR)
Expand All @@ -44,7 +34,7 @@ index 1eac71f..bd59bcf 100644
yaftx: x/yaftx.c $(HDR)
# If you want to change configuration, please modify conf.h before make (see conf.h for more detail)
diff --git a/terminal.h b/terminal.h
index b175610..38f7de2 100644
index b175610..9f987b6 100644
--- a/terminal.h
+++ b/terminal.h
@@ -199,13 +199,33 @@ void addch(struct terminal_t *term, uint32_t code)
Expand All @@ -54,17 +44,17 @@ index b175610..38f7de2 100644
- return;
- else if (0x100000 <= code && code <= 0x10FFFD) /* unicode private area: plane 16 (DRCSMMv1) */
+ {
+ logging(DEBUG, "addch: U+%.4X is zero-width.\n", code);
+ // logging(DEBUG, "addch: U+%.4X is zero-width.\n", code);
+ if (code < ' ') {
+ // ASCII Control char ?
+ return;
+ } else {
+ // return;
+ logging(DEBUG, "addch: DEBUG: Assuming full-width.\n");
+ // logging(DEBUG, "addch: DEBUG: Assuming full-width.\n");
+ width = 2;
+ }
+ }
+
+
+ if (0x100000 <= code && code <= 0x10FFFD) /* unicode private area: plane 16 (DRCSMMv1) */
glyphp = drcs_glyph(term, code);
else if (code >= UCS2_CHARS /* yaft support only UCS2 */
Expand All @@ -75,10 +65,10 @@ index b175610..38f7de2 100644
+ // glyphp = (width == 1) ? term->glyph[SUBSTITUTE_HALF]: term->glyph[SUBSTITUTE_WIDE];
+ if (width == 1) {
+ glyphp = term->glyph[SUBSTITUTE_HALF];
+ logging(DEBUG, "addch: U+%.4X is replaced with SUBSTITUDE_HALF\n", code);
+ // logging(DEBUG, "addch: U+%.4X is replaced with SUBSTITUDE_HALF\n", code);
+ } else {
+ glyphp = term->glyph[SUBSTITUTE_WIDE];
+ logging(DEBUG, "addch: U+%.4X is replaced with SUBSTITUDE_WIDE\n", code);
+ // logging(DEBUG, "addch: U+%.4X is replaced with SUBSTITUDE_WIDE\n", code);
+ }
+ }
else
Expand Down

0 comments on commit e9e0306

Please # to comment.