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

text-offset property is broken for CJK text in vertical writing mode #10687

Closed
zmiao opened this issue May 20, 2021 · 1 comment
Closed

text-offset property is broken for CJK text in vertical writing mode #10687

zmiao opened this issue May 20, 2021 · 1 comment
Assignees
Labels

Comments

@zmiao
Copy link
Contributor

zmiao commented May 20, 2021

text-offset property is broken for CJK text in vertical writing mode.

mapbox-gl-js version:
main branch
browser:
any

Steps to Trigger Behavior

Test with the following style:

Test style
{
    "version": 8,
    "zoom": 0,
    "center": [-14.41400, 39.09187],
    "sources": {
      "lineGeo": {
        "type": "geojson",
        "data": {
          "type": "FeatureCollection",
          "features": [
      "pointGeo": {
        "type": "geojson",
        "data": {
          "type": "FeatureCollection",
          "features": [
            {
              "type": "Feature",
              "properties": {
                "name": "新华路12号"
              },
              "geometry": {
                "type": "Point",
                "coordinates":
                  [
                    -14.414062499999998,
                    39.091699613104595
                  ]
              }
            }
          ]
        }
      }
    },
    "glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
    "layers": [
        {
            "id": "background",
            "type": "background",
            "layout": {},
            "paint": {"background-color": "hsl(38, 48%, 86%)"}
        },
      {
        "id": "lines-symbol",
        "type": "symbol",
        "source": "pointGeo",
        "layout": {
          "text-field": "天空A",
          "symbol-placement": "point",
          "symbol-spacing": 150,
          "text-font": [
            "Open Sans Semibold",
            "Arial Unicode MS Regular"
          ],
          "text-writing-mode": ["vertical"],
          "text-rotation-alignment" : "auto",
          "text-size": [
            "interpolate",
            ["linear"],
            ["zoom"],
            0,
            30,
            22,
            15
        ],
          "text-padding": 4,
          "text-allow-overlap": true,
          "text-offset": [
            3,
            -3
          ]
        },
        "paint": {
            "text-color": [
                "interpolate",
                ["linear"],
                ["zoom"],
                5,
                "hsl(0, 0%, 33%)",
                6,
                "hsl(0, 0%, 0%)"
            ],
            "text-halo-blur": 0.5,
            "text-halo-color": "hsla(0, 0%, 100%, 0.95)",
            "text-halo-width": 3,
            "text-opacity": 1
        }
      }, {
        "id": "dots",
        "type": "circle",
        "source": "pointGeo",
        "paint": {
            "circle-color": "red"
        }
      }
    ]
  }

Expected Behavior

The red dot is the anchor point
Screen Shot 2021-05-20 at 12 45 56 PM

Actual Behavior

Screen Shot 2021-05-20 at 12 26 05 PM

@asheemmamoowala
Copy link
Contributor

Fixed in #8781

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants