You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use an Emscripten port of the ICU library to provide support for bidirectional text as well as shaping for Arabic text (#3708). However, the Emscripten port ended up being so large that it would nearly double the size of the mapbox-gl.js bundle (see discussion in PR #3758). Because right-to-left support wasn't critical to all of customers, we decided to split the RTL support out into a separate RTL text plugin.
This is a sub-optimal solution: we would prefer for RTL scripts to work out of the box. Possible solutions to this problem include:
Accepting the bundle size increase and pulling the Emscriptified code into the main bundle
Making and maintaining a (hopefully more lightweight) native JS implementation of both the bidirectional algorithm and arabic shaping. A recent PR to the iD editor points in the direction we could go, but would require significant expansion to implement all of the ICU functionality. We might be able to identify some subset of current ICU functionality that can be dropped.
Finding further ways to decrease size of the transpiled ICU code, perhaps by making modifications to Emscripten
The fix for this issue will be tightly coupled to whatever decisions we make as we implement further support for complex text rendering (indic scripts, ligatures, kerning, etc.). The current plan on mapbox-gl-native is to use Harfbuzz for client-side text shaping (mapbox/mapbox-gl-native#7528). Directly porting those changes would require us to either double down on the Emscripten strategy or greatly expand the scope of any direct C++->JS port.
#4847 brings the size of the plugin down from 396KB to 273KB: not enough to bundle it in, but going in the right direction. If/when we start using Web Assembly, we could get this down even further to around ~125KB.
We use an Emscripten port of the ICU library to provide support for bidirectional text as well as shaping for Arabic text (#3708). However, the Emscripten port ended up being so large that it would nearly double the size of the
mapbox-gl.js
bundle (see discussion in PR #3758). Because right-to-left support wasn't critical to all of customers, we decided to split the RTL support out into a separate RTL text plugin.This is a sub-optimal solution: we would prefer for RTL scripts to work out of the box. Possible solutions to this problem include:
The fix for this issue will be tightly coupled to whatever decisions we make as we implement further support for complex text rendering (indic scripts, ligatures, kerning, etc.). The current plan on
mapbox-gl-native
is to use Harfbuzz for client-side text shaping (mapbox/mapbox-gl-native#7528). Directly porting those changes would require us to either double down on the Emscripten strategy or greatly expand the scope of any direct C++->JS port.cc @1ec5 @lucaswoj @pveugen
The text was updated successfully, but these errors were encountered: