wipfli / positioned-glyph-font

Postioned glyph font for MapLibre
https://wipfli.github.io/positioned-glyph-font/examples/protomaps/name-ne
MIT License
4 stars 1 forks source link

Devanagari label encodings and fonts generated are not being rendered #6

Open pankajverma04 opened 9 months ago

pankajverma04 commented 9 months ago

I am using this tool to generate encodings and fonts as well for Devanagari labels. The generation for both were successful but were not being rendered. Steps followed :

  1. Building and running docker image in the root directory.
    docker build -t positioned-glyph-font .
    docker run --rm -it -v "$(pwd)":/root/ positioned-glyph-font
  2. In container :
    cd raqm/
    ./run.sh

    raqm/labels_requiring_encoding.json used is as follows :

    [
    "Rafi Ahmed Kidwai Marg",
    "रफी अहमद किदवई मार्ग",
    "Janpath",
    "जनपथ",
    "Vijay Chok", 
    "विजय चोक",
    "Rajpath",
    "राजपथ",
    "Raisina Road",
    "रायसीना सड़क",
    "Motilal Nehru Marg",
    "मोतीलाल नेहरू मार्ग",
    "Kumaraswami Kamaraj Marg",
    "कुमारस्वामी कामराज मार्ग",
    "Rajaji Marg",
    "राजाजी मार्ग",
    "Teen Murti Marg",
    "तीन मूर्ति मार्ग",
    "Ashutosh Mukhejee Road",
    "आशुतोष मुखर्जी रोड",
    "Sarjapura Road",
    "ಸರ್ಜಾಪುರ ರಸ್ತೆ",
    "Inner Ring Road",
    "ಇನ್ನರ್ ರಿಂಗ್ ರೋಡ್"
    ]

    Generated label mapping is as follow :

    {
    "Rafi Ahmed Kidwai Marg": "Rafi Ahmed Kidwai Marg",
    "\u0930\u092b\u0940 \u0905\u0939\u092e\u0926 \u0915\u093f\u0926\u0935\u0908 \u092e\u093e\u0930\u094d\u0917": "\u0711\u070e\u0727 \u0700\u0717\u070f\u070b \u0724\u0703\u070b\u0713\u0702 \u070f\u0718\u0705\u0720",
    "Janpath": "Janpath",
    "\u091c\u0928\u092a\u0925": "\u0707\u070c\u070d\u070a",
    "Vijay Chok": "Vijay Chok",
    "\u0935\u093f\u091c\u092f \u091a\u094b\u0915": "\u0724\u0713\u0707\u0710 \u0706\u071e\u0703",
    "Rajpath": "Rajpath",
    "\u0930\u093e\u091c\u092a\u0925": "\u0711\u0718\u0707\u070d\u070a",
    "Raisina Road": "Raisina Road",
    "\u0930\u093e\u092f\u0938\u0940\u0928\u093e \u0938\u0921\u093c\u0915": "\u0711\u0718\u0710\u0716\u0719\u070c\u0718 \u0716\u071f\u0703",
    "Motilal Nehru Marg": "Motilal Nehru Marg",
    "\u092e\u094b\u0924\u0940\u0932\u093e\u0932 \u0928\u0947\u0939\u0930\u0942 \u092e\u093e\u0930\u094d\u0917": "\u070f\u071e\u0709\u0719\u0712\u0718\u0712 \u070c\u071d\u0717\u0722 \u070f\u0718\u0705\u0720",
    "Kumaraswami Kamaraj Marg": "Kumaraswami Kamaraj Marg",
    "\u0915\u0941\u092e\u093e\u0930\u0938\u094d\u0935\u093e\u092e\u0940 \u0915\u093e\u092e\u0930\u093e\u091c \u092e\u093e\u0930\u094d\u0917": "\u0703\u071a\u070f\u0718\u0711\u0721\u0713\u0718\u070f\u0719 \u0703\u0718\u070f\u0711\u0718\u0707 \u070f\u0718\u0705\u0720",
    "Rajaji Marg": "Rajaji Marg",
    "\u0930\u093e\u091c\u093e\u091c\u0940 \u092e\u093e\u0930\u094d\u0917": "\u0711\u0718\u0707\u0718\u0707\u0719 \u070f\u0718\u0705\u0720",
    "Teen Murti Marg": "Teen Murti Marg",
    "\u0924\u0940\u0928 \u092e\u0942\u0930\u094d\u0924\u093f \u092e\u093e\u0930\u094d\u0917": "\u0709\u0719\u070c \u070f\u071c\u0725\u0709\u0726 \u070f\u0718\u0705\u0720",
    "Ashutosh Mukhejee Road": "Ashutosh Mukhejee Road",
    "\u0906\u0936\u0941\u0924\u094b\u0937 \u092e\u0941\u0916\u0930\u094d\u091c\u0940 \u0930\u094b\u0921": "\u0701\u0714\u071b\u0709\u071e\u0715 \u070f\u071b\u0704\u0707\u0723 \u0711\u071e\u0708",
    "Sarjapura Road": "Sarjapura Road",
    "\u0cb8\u0cb0\u0ccd\u0c9c\u0cbe\u0caa\u0cc1\u0cb0 \u0cb0\u0cb8\u0ccd\u0ca4\u0cc6": "\u072d\u0734\u072e\u0731\u072b\u073b\u072c \u072c\u073a\u0732",
    "Inner Ring Road": "Inner Ring Road",
    "\u0c87\u0ca8\u0ccd\u0ca8\u0cb0\u0ccd \u0cb0\u0cbf\u0c82\u0c97\u0ccd \u0cb0\u0ccb\u0ca1\u0ccd": "\u0729\u072a\u0733\u0737 \u0738\u0728\u0735 \u0739\u072f\u0730\u0736"
    }

    encoded_labels.json :

    [
    "Rafi Ahmed Kidwai Marg",
    "\u0711\u070e\u0727 \u0700\u0717\u070f\u070b \u0724\u0703\u070b\u0713\u0702 \u070f\u0718\u0705\u0720",
    "Janpath",
    "\u0707\u070c\u070d\u070a",
    "Vijay Chok",
    "\u0724\u0713\u0707\u0710 \u0706\u071e\u0703",
    "Rajpath",
    "\u0711\u0718\u0707\u070d\u070a",
    "Raisina Road",
    "\u0711\u0718\u0710\u0716\u0719\u070c\u0718 \u0716\u071f\u0703",
    "Motilal Nehru Marg",
    "\u070f\u071e\u0709\u0719\u0712\u0718\u0712 \u070c\u071d\u0717\u0722 \u070f\u0718\u0705\u0720",
    "Kumaraswami Kamaraj Marg",
    "\u0703\u071a\u070f\u0718\u0711\u0721\u0713\u0718\u070f\u0719 \u0703\u0718\u070f\u0711\u0718\u0707 \u070f\u0718\u0705\u0720",
    "Rajaji Marg",
    "\u0711\u0718\u0707\u0718\u0707\u0719 \u070f\u0718\u0705\u0720",
    "Teen Murti Marg",
    "\u0709\u0719\u070c \u070f\u071c\u0725\u0709\u0726 \u070f\u0718\u0705\u0720",
    "Ashutosh Mukhejee Road",
    "\u0701\u0714\u071b\u0709\u071e\u0715 \u070f\u071b\u0704\u0707\u0723 \u0711\u071e\u0708",
    "Sarjapura Road",
    "\u072d\u0734\u072e\u0731\u072b\u073b\u072c \u072c\u073a\u0732",
    "Inner Ring Road",
    "\u0729\u072a\u0733\u0737 \u0738\u0728\u0735 \u0739\u072f\u0730\u0736"
    ]
  3. Then run ./run.sh in the font-maker directory, which generates fonts.
  4. Created a new directory in examples similar to already available examples with changes in style.json and index.html and add newly generated fonts.

The web page did not render the labels and displayed nothing.

style.json for reference :
{
    "version": 8,
    "sources": {
        "encoded-labels": {
            "type": "geojson",
            "data": {
                "type": "FeatureCollection",
                "features": [
                    {
                        "type": "Feature",
                        "properties": {
                            "A": "Rafi Ahmed Kidwai Marg: रफी अहमद किदवई मार्ग  : \u0711\u070e\u0727 \u0700\u0717\u070f\u070b \u0724\u0703\u070b\u0713\u0702 \u070f\u0718\u0705\u0720"
                        },
                        "geometry": {
                            "coordinates": [
                                76.98187363723929,
                                24.697710005924648
                            ],
                            "type": "Point"
                        }
                    }
                ]
            }
        }
    },
    "layers": [

        {
            "id": "encoded-labels",
            "source": "encoded-labels",
            "type": "symbol",
            "layout": {
                "text-field": [
                    "format",
                    ["get", "A"],
                    {}
                ],
                "text-font": ["the-name"]
            }
        }
    ],
    "glyphs": "fonts/{fontstack}/{range}.pbf"
}
wipfli commented 9 months ago

Oh sorry I need to clean this up a bit. I think you are using an outdated path. Will get back to you

wipfli commented 9 months ago

@pankajverma04 I updated the main readme. Can you have a look at it and follow the steps?

Main changes: removed the raqm folder, and added a http server which you can request to encode labels.

wipfli commented 8 months ago

Let me know if the new instructions and scripts work for you @pankajverma04