From 8ba0615b0fe832a15eb695ccd661674b6946995c Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 28 Sep 2026 11:41:43 +0100 Subject: Resolve bidirectional text as UAX #9 does, passing all of Unicode's bidi tests --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e00385c..f96fb29 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,8 @@ LIBPURE = $(PURE)/build/libpure.a # Parts: lib/ (the aup library: the interface vocabulary), surfaces/ (the vega # host: TUI, CLI, NUI sentences, web), symbols/ (glyphs and icons as one -# format, drawn by CPU or GPU). +# format, drawn by CPU or GPU), text/ (Unicode's algorithms over tables +# text/unicode.py generates from the UCD: python3 text/unicode.py > text/unicode-data.c). SURFACES = surfaces/screen.c surfaces/draw.c surfaces/width.c surfaces/web.c surfaces/pixels.c surfaces/display.c \ surfaces/input.c surfaces/hangul.c surfaces/main.c @@ -48,7 +49,14 @@ $(BUILD)/vega-symbols: symbols/symbols-tool.c $(SYMBOLS) symbols/symbols.h symbo $(CC) $(CPPFLAGS) $(CFLAGS) $(FREETYPE_CFLAGS) symbols/symbols-tool.c $(SYMBOLS) $(LDFLAGS) \ $(FREETYPE_LIBS) $(GL_LIBS) -lm $(LDLIBS) -o $@ -check: $(BUILD)/vega $(BUILD)/vega-symbols $(BUILD)/vega-surface.so +TEXT = text/bidi.c text/unicode-data.c +$(BUILD)/test-text: text/test-text.c $(TEXT) text/text.h | $(BUILD) + $(CC) $(CPPFLAGS) $(CFLAGS) -Itext text/test-text.c $(TEXT) $(LDFLAGS) $(LDLIBS) -o $@ + +# Unicode's conformance tests, where the UCD is installed (Debian: unicode-data). +UCD ?= /usr/share/unicode +check: $(BUILD)/vega $(BUILD)/vega-symbols $(BUILD)/vega-surface.so $(BUILD)/test-text + if [ -f $(UCD)/BidiTest.txt ]; then $(BUILD)/test-text $(UCD); else echo "no UCD at $(UCD): text tests skipped"; fi $(MAKE) -C $(AUP) build/aup $(MAKE) -C $(PURE) build/pure-serve python3 tests/check.py --vega $(BUILD)/vega --symbols $(BUILD)/vega-symbols --aup $(AUP)/build/aup --serve $(PURE)/build/pure-serve -- cgit v1.2.3