Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for running BiDi algorithm on text with styling annotations. #10

Merged
merged 2 commits into from Jul 27, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions Makefile
Expand Up @@ -13,21 +13,22 @@ all: index.js mapbox-gl-rtl-text.js mapbox-gl-rtl-text.js.min mapbox-gl-rtl-text
build/wrapper.js: build/ushape_wrapper.o build/ubidi_wrapper.o
mkdir -p build
${EMSCRIPTEN}/emcc -Oz -v -o build/wrapper.js build/ushape_wrapper.o build/ubidi_wrapper.o icu-llvm/source/lib/libicuuc.a \
-s EXPORTED_FUNCTIONS="['_ushape_arabic','_bidi_processText','_bidi_getLine','_bidi_getParagraphEndIndex']" \
-s EXPORTED_FUNCTIONS="['_ushape_arabic','_bidi_processText','_bidi_getLine','_bidi_getParagraphEndIndex','_bidi_setLine','_bidi_writeReverse','_bidi_getVisualRun']" \
-s NO_EXIT_RUNTIME="1" \
-s DEAD_FUNCTIONS="[]" \
-s NO_FILESYSTEM="1" \
-s INLINING_LIMIT="1" \
-s ALLOW_MEMORY_GROWTH="1" \
-s EXPORTED_RUNTIME_METHODS="['stringToUTF16','UTF16ToString','ccall','_malloc','_free']" \
--llvm-lto 3 \
-s WASM=0 \
--llvm-lto 3 \
--memory-init-file 0 \
--closure 0

build/wrapper.wasm.js: build/ushape_wrapper.o build/ubidi_wrapper.o
mkdir -p build
${EMSCRIPTEN}/emcc -Oz -v -o build/wrapper.wasm.js build/ushape_wrapper.o build/ubidi_wrapper.o icu-llvm/source/lib/libicuuc.a \
-s EXPORTED_FUNCTIONS="['_ushape_arabic','_bidi_processText','_bidi_getLine','_bidi_getParagraphEndIndex']" \
-s EXPORTED_FUNCTIONS="['_ushape_arabic','_bidi_processText','_bidi_getLine','_bidi_getParagraphEndIndex','_bidi_setLine','_bidi_writeReverse','_bidi_getVisualRun']" \
-s NO_EXIT_RUNTIME="1" \
-s DEAD_FUNCTIONS="[]" \
-s NO_FILESYSTEM="1" \
Expand Down
8 changes: 4 additions & 4 deletions build.sh
Expand Up @@ -20,7 +20,7 @@ function setup_emsdk {
download_and_extract \
https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz \
emsdk-portable.tgz \
90c9b5c2ac03f4ac5295fa0f7e5caaf343169b3f
5524019776723b42ce731f20d9dff91be63c8f50

emsdk-portable/emsdk update
emsdk-portable/emsdk install latest
Expand All @@ -30,9 +30,9 @@ function setup_emsdk {

function fetch_icu {
download_and_extract \
http://download.icu-project.org/files/icu4c/58.1/icu4c-58_1-src.tgz \
icu58_1.tgz \
ad6995ba349ed79dde0f25d125a9b0bb56979420
http://download.icu-project.org/files/icu4c/62.1/icu4c-62_1-src.tgz \
icu62_1.tgz \
8a216e755cddd169b9ec8cc7edeed38824900f06
cp -R icu icu-llvm
}

Expand Down
10,182 changes: 5,238 additions & 4,944 deletions index.js

Large diffs are not rendered by default.

10,183 changes: 5,238 additions & 4,945 deletions mapbox-gl-rtl-text.js

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions mapbox-gl-rtl-text.js.min

Large diffs are not rendered by default.