Skip to content

Arabic text not displayed correctly #4

Closed

Description

@nouryf

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

Activity

  1. ChrisLoer commented on Jun 8, 2017

    @ChrisLoer
    Contributor

    Hi @nouryf I'm so sorry it took me so long to respond! I missed the notification for your comment when it came in. 😓

    I downloaded the morocoo.mbtiles file, and the thing that jumped out at me is that the names in those files are trilingual: English/Berber(I think?)/Arabic. My guess is you're using a font that doesn't have glyphs for Berber, so it doesn't show up in the labels. However (and I'm guessing a lot), control characters from the Berber text could still be affecting the rest of the display. The "Anfa/أنفا" case itself looks formatted as I'd expect.

  2. nouryf commented on Jun 8, 2017

    @nouryf
    Author

    Hi @ChrisLoer, thanks for your response. Since I open this issue, things progressed in the direction you thought. It was a font issue. The used font did not seem to have all the Arabic glyphs and the displayed Arabic text has missing characters in it. This is now logged under a different project openmaptiles/openmaptiles#194

    So this is not a Mapbox GL js issue. This ticket can be closed.

  3. ELFALLAH02 commented on Dec 2, 2022

    @ELFALLAH02

    I had the same issue with Mapbox using streamlit I don't know why but the name of cities' streets ...everything in Arabic is from left to right.
    I think I use pydeck package too, but it's not responsible for the map style.
    Here is my code:

    `                st.write(pdk.Deck(
                        map_style="mapbox://styles/mapbox/light-v9",
                        initial_view_state={
                            "latitude": midpoint[0],
                            "longitude": midpoint[1],
                            "zoom": 17,
                            "pitch": 50, },
    
    
                        layers=[
                            pdk.Layer(
                                'HeatmapLayer',
                                data=m,
                                get_position=[longitude, latitude],
                                auto_highlight=True,
                                radius=30,
                                opacity=0.9,
                                extruded=True,
                                get_color=mycolor(res),
                                pickable=True,
                                elevation_scale=4,), ],))`
    

    Output
    image

  4. nouryf commented on Dec 4, 2022

    @nouryf
    Author

    Try adding the plugin that support right to left languages like Arabic:

    mapboxgl.setRTLTextPlugin(
    'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js',
    null,
    true // Lazy load the plugin
    );
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions