diff --git a/js/symbol/shaping.js b/js/symbol/shaping.js index 40d74961a0b..109a072bcab 100644 --- a/js/symbol/shaping.js +++ b/js/symbol/shaping.js @@ -54,7 +54,7 @@ function shapeText(text, glyphs, maxWidth, lineHeight, horizontalAlign, vertical if (!glyph && codePoint !== newLine) continue; - if (writingMode === WritingMode.horizontal) { + if (!scriptDetection.charAllowsVerticalWritingMode(text[i]) || writingMode === WritingMode.horizontal) { positionedGlyphs.push(new PositionedGlyph(codePoint, x, yOffset, glyph, 0)); if (glyph) x += glyph.advance + spacing; diff --git a/js/util/script_detection.js b/js/util/script_detection.js index cc760c387b6..b393017716d 100644 --- a/js/util/script_detection.js +++ b/js/util/script_detection.js @@ -12,7 +12,7 @@ module.exports.allowsIdeographicBreaking = function(chars) { module.exports.allowsVerticalWritingMode = function(chars) { for (const char of chars) { - if (charAllowsVerticalWritingMode(char.charCodeAt(0))) return true; + if (exports.charAllowsVerticalWritingMode(char.charCodeAt(0))) return true; } return false; }; @@ -45,7 +45,7 @@ module.exports.charAllowsIdeographicBreaking = function(char) { return false; }; -function charAllowsVerticalWritingMode(char) { +exports.charAllowsVerticalWritingMode = function(char) { // Return early for characters outside all ranges that allow the vertical // writing mode. if (char < 0x1100) return false; diff --git a/package.json b/package.json index 950bcd1f7da..dba87cdb160 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "highlight.js": "9.3.0", "jsdom": "^9.4.2", "lodash.template": "^4.4.0", - "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#20289f25516b28d5f5af4f5813659c2d8139fa6d", + "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#3462d7e88372be4df11e1ef8c1991bcf3e31aa93", "minifyify": "^7.0.1", "npm-run-all": "^3.0.0", "nyc": "^8.3.0",