Giter VIP home page Giter VIP logo

mapbox-gl-rtl-text's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mapbox-gl-rtl-text's Issues

Rename .js.min -> .min.js

This would be needed to solve #15 on all occasions when the library is hosted from a normal webserver (nginx, etc.), as they guess MIME type from extension. I don't know any other JS library which would use the non-standard extension .js.min

Uyghur language script glyph error.

Hey, when using Mapbox studio Uyghur-language script appears to have shaping errors for the RTL text glyphs. Unsure what causes the error in some characters and not others (I don't speak Uyghur'che, but colleagues who do tell me it's not strictly the characters which vary from Arabic where the issue occurs) perhaps it's a specific unicode range, I believe Uyghur script is spread over four unicode ranges - Arabic, Arabic Suppliment and Arabic Presentation Forms A/B.
Essentially, for a number of charcters mapbox uses its final placement form no matter where in the word it occurs. For example, the place name for Kizilsu (قىزىلسۇ) renders like this screenshot
Where the ى character (among others) renders in the final form rather than the medial form.
The problem is as it appeared in the 'wrong' frame of the first gif in this blog post.
It would be great to get this language supported, we have a dataset of 16,000+ (only 500 translated into Uyghur so far) place names for Xinjiang that we use for a map tracing the human rights abuses against Uyghur people. Their culture and language is being erased in China, it would be neat if Mapbox could help preserve it!
Thanks,
Nathan.

import with webpack is not working

Hello together,

I tried to import it with webpack via
import mapboxglRTL from '@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text';

Webpack give me then following error:

ERROR in ./node_modules/@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text.js
Module not found: Error: Can't resolve 'fs' in 'project/node_modules/@mapbox/mapbox-gl-rtl-text'

using Version 0.2.1

Bad mapbox-gl dependency version documentation

README.md says that this package "Requires mapbox-gl-js (version 0.32.1 and up).".

package.json however has a dependency to mapbox-gl >=0.32.1 <2.0.0:

  "peerDependencies": {
    "mapbox-gl": ">=0.32.1 <2.0.0"
  },

Since the latest version of mapbox-gl is 2.5.1, this dependency breaks a standard installation and should be documented in the README .

Of course it would be even better if any incompatibility with mapbox-gl >= 2.0.0 was solved and this dependency was changed.
If it can be of any help some days ago I installed mapbox-gl-rtl-text 0.2.3 together with mapbox-gl 2.5.1 using --force in https://www.dsantini.it/etymology and as of now I haven't encountered problems.

Build against specific emscripten version

Right now the build script verifies the hash of the emscripten package it downloads, but after it downloads it updates to the latest version of emscripten:

function setup_emsdk {
download_and_extract \
https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz \
emsdk-portable.tgz \
4fb6c391effc6a6cd5666abe28a8c7c48a1150f3
emsdk-portable/emsdk update
emsdk-portable/emsdk install latest
emsdk-portable/emsdk activate latest
source emsdk-portable/emsdk_env.sh
}

This is a weird way of guaranteeing the version -- when a new version of emscripten is released and published to https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz, the build will break until the hash is updated (at which point it will be using the new version).

Instead, we should point the build to a specific/archived release.

Don't re-throw uncaught exceptions while running in Node environment

When it's running in a Node environment, the Emscripten runtime will rethrow any uncaught exception:

process['on']('uncaughtException', function (ex) {
    if (!(ex instanceof ExitStatus)) {
        throw ex;
    }
});

Although it doesn't mess with the stack trace, it means that if a developer runs into an uncaught exception while running the GL JS test suite, the first thing they see is a somewhat misleading error message showing an error being thrown from mapbox-gl-rtl-text.

This is part of a class of changes where the most straightforward place to make a change is in the Emscripten compiler, but I'd prefer not to start maintaining an Emscripten port. This is a simple enough case that I could maybe just take it out with a sed build step.

/cc @anandthakker @lbud

Deprecated: Future versions will refuse to execute script from 'mapbox-gl-rtl-text.js' because its MIME type ('binary/octet-stream') is not executable

import { setRTLTextPlugin } from 'mapbox-gl' setRTLTextPlugin('https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.1.2/mapbox-gl-rtl-text.js');

this warning appears in my browser console:

Deprecated: Future versions will refuse to execute script from 'mapbox-gl-rtl-text.js' because its MIME type ('binary/octet-stream') is not executable

UMD export for use without mapbox

We are trying to use your module as a plugin to our library, and we would like to be able to use it as a drop-in add-on in the browser as well, but index.js assumes Node.js/CommonJS environment.

I added a PR #12 that does it, but didn't re-build the library to avoid unnecessary diffs.

Thanks a lot for the great library.

Hash missmatch when downloading icu

Running build.sh the script tries to fetch the icu source files. Looks like the hashes are missmatching.

http://download.icu-project.org/files/icu4c/58.1/icu4c-58_1-src.tgz
icu58_1.tgz

Hash fe9dcbd4f7b3d1caa4d8878e25e13a1e4e014f8a of icu58_1.tgz doesn't match ad6995ba349ed79dde0f25d125a9b0bb56979420

When I replace the hash with an '*' it runs through but it errors later on. It looks like there are files missing in the icu source code

cp: icu: No such file or directory
Build ICU tools with --host=x86_64-apple-darwin in /Users/p.jakobs/projects/mapbox-gl-rtl-text/icu/source/.build
./build.sh: line 49: pushd: /Users/p.jakobs/projects/mapbox-gl-rtl-text/icu/source: No such file or directory
./build.sh: line 59: ./configure: No such file or directory
cat: config.log: No such file or directory
rm -rf build
rm -f index.js
mkdir -p build
mkdir -p build
node_modules/buble/bin/buble src/icu.js -y dangerousForOf > build/icu.js
/emcc -Oz -c src/ubidi_wrapper.c -I./icu-llvm/source/common -o build/ubidi_wrapper.o
make: /emcc: No such file or directory
/emcc -Oz -c src/ushape_wrapper.c -I./icu-llvm/source/common -o build/ushape_wrapper.o
make: /emcc: No such file or directory
make: *** [build/ubidi_wrapper.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [build/ushape_wrapper.o] Error 1
/bin/sh: node_modules/buble/bin/buble: No such file or directory
make: *** [build/icu.js] Error 127
make: *** No rule to make target `install'.  Stop.
./build.sh: line 84: popd: directory stack empty
Downloading: /Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/zips/emsdk_unix_update.tar.gz from https://s3.amazonaws.com/mozilla-games/emscripten/packages/emsdk_unix_update.tar.gz
Unpacking '/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/zips/emsdk_unix_update.tar.gz' to '/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable'
x emscripten-tags.txt
x emsdk
x emsdk_env.sh
x emsdk_manifest.json
x README.md
Fetching all tags from Emscripten Github repository...
Done. 90 tagged releases available, latest is 1.37.3.
Installing SDK 'sdk-1.35.0-64bit'..
Installing tool 'clang-e1.35.0-64bit'..
The contents of file 'emscripten-clang_e1.35.0.tar.gz' already exist in destination '/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/clang/e1.35.0_64bit', skipping.
Done installing tool 'clang-e1.35.0-64bit'.
Installing tool 'node-4.1.1-64bit'..
The contents of file 'node-v4.1.1-darwin-x64.tar.gz' already exist in destination '/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/node/4.1.1_64bit', skipping.
Done installing tool 'node-4.1.1-64bit'.
Installing tool 'emscripten-1.35.0'..
The contents of file 'emscripten-1.35.0.tar.gz' already exist in destination '/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/emscripten/1.35.0', skipping.
Done installing tool 'emscripten-1.35.0'.
Done installing SDK 'sdk-1.35.0-64bit'.
Writing .emscripten configuration file to user home directory /Users/p.jakobs/
The Emscripten configuration file /Users/p.jakobs/.emscripten has been rewritten with the following contents:

import os
LLVM_ROOT='/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/clang/e1.35.0_64bit'
EMSCRIPTEN_NATIVE_OPTIMIZER='/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/clang/e1.35.0_64bit/optimizer'
NODE_JS='/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/node/4.1.1_64bit/bin/node'
EMSCRIPTEN_ROOT='/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/emscripten/1.35.0'
SPIDERMONKEY_ENGINE = ''
V8_ENGINE = ''
TEMP_DIR = '/var/folders/ng/yd41pq0962n1wt4yc8r2_v040000gp/T'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]

To conveniently access the selected set of tools from the command line, consider adding the following directories to PATH, or call 'source emsdk_portable/emsdk_env.sh' to do this for you.

   /Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable:/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/clang/e1.35.0_64bit:/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/node/4.1.1_64bit/bin:/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/emscripten/1.35.0
Adding directories to PATH:
PATH += /Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable
PATH += /Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/clang/e1.35.0_64bit
PATH += /Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/node/4.1.1_64bit/bin
PATH += /Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/emscripten/1.35.0

Setting environment variables:
EM_CONFIG = /Users/p.jakobs/.emscripten
EMSCRIPTEN = /Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/emscripten/1.35.0

Building LLVM ICU with --host=x86_64-apple-darwin in /Users/p.jakobs/projects/mapbox-gl-rtl-text/icu-llvm/source/.build
./build.sh: line 90: pushd: /Users/p.jakobs/projects/mapbox-gl-rtl-text/icu-llvm/source: No such file or directory
sed: /Users/p.jakobs/projects/mapbox-gl-rtl-text/icu-llvm/source/config/mh-darwin: No such file or directory
sed: /Users/p.jakobs/projects/mapbox-gl-rtl-text/icu-llvm/source/configure: No such file or directory
sed: /Users/p.jakobs/projects/mapbox-gl-rtl-text/icu-llvm/source/configure: No such file or directory
ERROR:root:Exception thrown when invoking Popen in configure with args: "./configure --host=x86_64-apple-darwin --prefix=/Users/p.jakobs/projects/mapbox-gl-rtl-text/icu-llvm/source/.build --with-cross-build=/Users/p.jakobs/projects/mapbox-gl-rtl-text/icu/source --with-data-packaging=archive --enable-renaming --enable-strict --enable-static --enable-draft --enable-release --disable-tools --disable-debug --disable-rpath --disable-shared --disable-tests --disable-extras --disable-tracing --disable-layout --disable-icuio --disable-samples --disable-dyload"!
Traceback (most recent call last):
  File "/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/emscripten/1.35.0/emconfigure", line 41, in <module>
    shared.Building.configure(sys.argv[1:])
  File "/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/emscripten/1.35.0/tools/shared.py", line 1140, in configure
    process = Popen(args, stdout=None if EM_BUILD_VERBOSE_LEVEL >= 2 else stdout, stderr=None if EM_BUILD_VERBOSE_LEVEL >= 1 else stderr, env=env)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
cat: config.log: No such file or directory
rm -rf build
rm -f index.js
mkdir -p build
mkdir -p build
node_modules/buble/bin/buble src/icu.js -y dangerousForOf > build/icu.js
/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/emscripten/1.35.0/emcc -Oz -c src/ubidi_wrapper.c -I./icu-llvm/source/common -o build/ubidi_wrapper.o
/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/emscripten/1.35.0/emcc -Oz -c src/ushape_wrapper.c -I./icu-llvm/source/common -o build/ushape_wrapper.o
/bin/sh: node_modules/buble/bin/buble: No such file or directory
make: *** [build/icu.js] Error 127
make: *** Waiting for unfinished jobs....
INFO:root:(Emscripten: Running sanity checks)
INFO:root:(Emscripten: Running sanity checks)
src/ushape_wrapper.c:4:10: fatal error: 'unicode/ushape.h' file not found
#include <unicode/ushape.h>
         ^
1 error generated.
src/ubidi_wrapper.c:4:10: fatal error: 'unicode/ubidi.h' file not found
#include <unicode/ubidi.h>
         ^
1 error generated.
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting
make: *** [build/ushape_wrapper.o] Error 1
make: *** [build/ubidi_wrapper.o] Error 1
make: *** No rule to make target `install'.  Stop.
./build.sh: line 133: popd: directory stack empty
rm -rf build
rm -f index.js
mkdir -p build
/Users/p.jakobs/projects/mapbox-gl-rtl-text/emsdk_portable/emscripten/1.35.0/emcc -Oz -c src/ushape_wrapper.c -I./icu-llvm/source/common -o build/ushape_wrapper.o
WARNING:root:(Emscripten: settings file has changed, clearing cache)
INFO:root:(Emscripten: Running sanity checks)
src/ushape_wrapper.c:4:10: fatal error: 'unicode/ushape.h' file not found
#include <unicode/ushape.h>
         ^
1 error generated.
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting
make: *** [build/ushape_wrapper.o] Error 1

Arabic text not displayed correctly

Hi,

I'm using 'Mapbox gl js' 0.32.1 and 'right to left' plugin to display tiles with Arabic labels.
I downloaded, for testing, an .mbtiles from https://openmaptiles.org/downloads/#country
I noticed that the Arabic labels are either not displaying the firs character or the middle or last one.

Attached is a screenshot highlighting (red box) labels displayed incorrectly. I also attached the mapbox map for comparison. In the Mapbox map, the Arabic text is correct (reference: https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-rtl-text/)

I used .html similar to the one here: https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-rtl-text/

Could this be a data issue (mbtiles some how not storing the labels correctly) or may be I'm using the plugin incorrectly ? Any other dependency to display the Arabic text correctly ? Any way to know what is the source of the issue ?

Thanks
Noury

image

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.