diff --git a/js/symbol/shaping.js b/js/symbol/shaping.js index 64ae7f69879..c6a44d949f2 100644 --- a/js/symbol/shaping.js +++ b/js/symbol/shaping.js @@ -57,7 +57,7 @@ function shapeText(text, glyphs, maxWidth, lineHeight, horizontalAlign, vertical if (!glyph && codePoint !== newLine) continue; - if (!scriptDetection.charAllowsVerticalWritingMode(codePoint) || writingMode === WritingMode.horizontal) { + if (!scriptDetection.charHasUprightVerticalOrientation(codePoint) || writingMode === WritingMode.horizontal) { positionedGlyphs.push(new PositionedGlyph(codePoint, x, yOffset, glyph, 0)); if (glyph) x += glyph.advance + spacing; diff --git a/js/util/is_char_in_unicode_block.js b/js/util/is_char_in_unicode_block.js index 5bb8fd94371..84b825028c5 100644 --- a/js/util/is_char_in_unicode_block.js +++ b/js/util/is_char_in_unicode_block.js @@ -1,10 +1,11 @@ 'use strict'; -// Adapted from https://github.com/jessetane/unicode-blocks/blob/master/Blocks.txt +// The following table comes from . +// Keep it synchronized with . module.exports = { // 'Basic Latin': (char) => char >= 0x0000 && char <= 0x007F, - // 'Latin-1 Supplement': (char) => char >= 0x0080 && char <= 0x00FF, + 'Latin-1 Supplement': (char) => char >= 0x0080 && char <= 0x00FF, // 'Latin Extended-A': (char) => char >= 0x0100 && char <= 0x017F, // 'Latin Extended-B': (char) => char >= 0x0180 && char <= 0x024F, // 'IPA Extensions': (char) => char >= 0x0250 && char <= 0x02AF, @@ -42,7 +43,7 @@ module.exports = { // 'Ethiopic': (char) => char >= 0x1200 && char <= 0x137F, // 'Ethiopic Supplement': (char) => char >= 0x1380 && char <= 0x139F, // 'Cherokee': (char) => char >= 0x13A0 && char <= 0x13FF, - // 'Unified Canadian Aboriginal Syllabics': (char) => char >= 0x1400 && char <= 0x167F, + 'Unified Canadian Aboriginal Syllabics': (char) => char >= 0x1400 && char <= 0x167F, // 'Ogham': (char) => char >= 0x1680 && char <= 0x169F, // 'Runic': (char) => char >= 0x16A0 && char <= 0x16FF, // 'Tagalog': (char) => char >= 0x1700 && char <= 0x171F, @@ -51,7 +52,7 @@ module.exports = { // 'Tagbanwa': (char) => char >= 0x1760 && char <= 0x177F, // 'Khmer': (char) => char >= 0x1780 && char <= 0x17FF, // 'Mongolian': (char) => char >= 0x1800 && char <= 0x18AF, - // 'Unified Canadian Aboriginal Syllabics Extended': (char) => char >= 0x18B0 && char <= 0x18FF, + 'Unified Canadian Aboriginal Syllabics Extended': (char) => char >= 0x18B0 && char <= 0x18FF, // 'Limbu': (char) => char >= 0x1900 && char <= 0x194F, // 'Tai Le': (char) => char >= 0x1950 && char <= 0x197F, // 'New Tai Lue': (char) => char >= 0x1980 && char <= 0x19DF, @@ -64,6 +65,7 @@ module.exports = { // 'Batak': (char) => char >= 0x1BC0 && char <= 0x1BFF, // 'Lepcha': (char) => char >= 0x1C00 && char <= 0x1C4F, // 'Ol Chiki': (char) => char >= 0x1C50 && char <= 0x1C7F, + // 'Cyrillic Extended-C': (char) => char >= 0x1C80 && char <= 0x1C8F, // 'Sundanese Supplement': (char) => char >= 0x1CC0 && char <= 0x1CCF, // 'Vedic Extensions': (char) => char >= 0x1CD0 && char <= 0x1CFF, // 'Phonetic Extensions': (char) => char >= 0x1D00 && char <= 0x1D7F, @@ -75,18 +77,18 @@ module.exports = { // 'Superscripts and Subscripts': (char) => char >= 0x2070 && char <= 0x209F, // 'Currency Symbols': (char) => char >= 0x20A0 && char <= 0x20CF, // 'Combining Diacritical Marks for Symbols': (char) => char >= 0x20D0 && char <= 0x20FF, - // 'Letterlike Symbols': (char) => char >= 0x2100 && char <= 0x214F, - // 'Number Forms': (char) => char >= 0x2150 && char <= 0x218F, + 'Letterlike Symbols': (char) => char >= 0x2100 && char <= 0x214F, + 'Number Forms': (char) => char >= 0x2150 && char <= 0x218F, // 'Arrows': (char) => char >= 0x2190 && char <= 0x21FF, // 'Mathematical Operators': (char) => char >= 0x2200 && char <= 0x22FF, - // 'Miscellaneous Technical': (char) => char >= 0x2300 && char <= 0x23FF, - // 'Control Pictures': (char) => char >= 0x2400 && char <= 0x243F, - // 'Optical Character Recognition': (char) => char >= 0x2440 && char <= 0x245F, - // 'Enclosed Alphanumerics': (char) => char >= 0x2460 && char <= 0x24FF, + 'Miscellaneous Technical': (char) => char >= 0x2300 && char <= 0x23FF, + 'Control Pictures': (char) => char >= 0x2400 && char <= 0x243F, + 'Optical Character Recognition': (char) => char >= 0x2440 && char <= 0x245F, + 'Enclosed Alphanumerics': (char) => char >= 0x2460 && char <= 0x24FF, // 'Box Drawing': (char) => char >= 0x2500 && char <= 0x257F, // 'Block Elements': (char) => char >= 0x2580 && char <= 0x259F, - // 'Geometric Shapes': (char) => char >= 0x25A0 && char <= 0x25FF, - // 'Miscellaneous Symbols': (char) => char >= 0x2600 && char <= 0x26FF, + 'Geometric Shapes': (char) => char >= 0x25A0 && char <= 0x25FF, + 'Miscellaneous Symbols': (char) => char >= 0x2600 && char <= 0x26FF, // 'Dingbats': (char) => char >= 0x2700 && char <= 0x27BF, // 'Miscellaneous Mathematical Symbols-A': (char) => char >= 0x27C0 && char <= 0x27EF, // 'Supplemental Arrows-A': (char) => char >= 0x27F0 && char <= 0x27FF, @@ -94,7 +96,7 @@ module.exports = { // 'Supplemental Arrows-B': (char) => char >= 0x2900 && char <= 0x297F, // 'Miscellaneous Mathematical Symbols-B': (char) => char >= 0x2980 && char <= 0x29FF, // 'Supplemental Mathematical Operators': (char) => char >= 0x2A00 && char <= 0x2AFF, - // 'Miscellaneous Symbols and Arrows': (char) => char >= 0x2B00 && char <= 0x2BFF, + 'Miscellaneous Symbols and Arrows': (char) => char >= 0x2B00 && char <= 0x2BFF, // 'Glagolitic': (char) => char >= 0x2C00 && char <= 0x2C5F, // 'Latin Extended-C': (char) => char >= 0x2C60 && char <= 0x2C7F, // 'Coptic': (char) => char >= 0x2C80 && char <= 0x2CFF, @@ -118,7 +120,7 @@ module.exports = { 'Enclosed CJK Letters and Months': (char) => char >= 0x3200 && char <= 0x32FF, 'CJK Compatibility': (char) => char >= 0x3300 && char <= 0x33FF, 'CJK Unified Ideographs Extension A': (char) => char >= 0x3400 && char <= 0x4DBF, - // 'Yijing Hexagram Symbols': (char) => char >= 0x4DC0 && char <= 0x4DFF, + 'Yijing Hexagram Symbols': (char) => char >= 0x4DC0 && char <= 0x4DFF, 'CJK Unified Ideographs': (char) => char >= 0x4E00 && char <= 0x9FFF, 'Yi Syllables': (char) => char >= 0xA000 && char <= 0xA48F, 'Yi Radicals': (char) => char >= 0xA490 && char <= 0xA4CF, @@ -151,7 +153,7 @@ module.exports = { // 'High Surrogates': (char) => char >= 0xD800 && char <= 0xDB7F, // 'High Private Use Surrogates': (char) => char >= 0xDB80 && char <= 0xDBFF, // 'Low Surrogates': (char) => char >= 0xDC00 && char <= 0xDFFF, - // 'Private Use Area': (char) => char >= 0xE000 && char <= 0xF8FF, + 'Private Use Area': (char) => char >= 0xE000 && char <= 0xF8FF, 'CJK Compatibility Ideographs': (char) => char >= 0xF900 && char <= 0xFAFF, // 'Alphabetic Presentation Forms': (char) => char >= 0xFB00 && char <= 0xFB4F, // 'Arabic Presentation Forms-A': (char) => char >= 0xFB50 && char <= 0xFDFF, @@ -159,7 +161,7 @@ module.exports = { 'Vertical Forms': (char) => char >= 0xFE10 && char <= 0xFE1F, // 'Combining Half Marks': (char) => char >= 0xFE20 && char <= 0xFE2F, 'CJK Compatibility Forms': (char) => char >= 0xFE30 && char <= 0xFE4F, - // 'Small Form Variants': (char) => char >= 0xFE50 && char <= 0xFE6F, + 'Small Form Variants': (char) => char >= 0xFE50 && char <= 0xFE6F, // 'Arabic Presentation Forms-B': (char) => char >= 0xFE70 && char <= 0xFEFF, 'Halfwidth and Fullwidth Forms': (char) => char >= 0xFF00 && char <= 0xFFEF // 'Specials': (char) => char >= 0xFFF0 && char <= 0xFFFF, @@ -180,6 +182,7 @@ module.exports = { // 'Deseret': (char) => char >= 0x10400 && char <= 0x1044F, // 'Shavian': (char) => char >= 0x10450 && char <= 0x1047F, // 'Osmanya': (char) => char >= 0x10480 && char <= 0x104AF, + // 'Osage': (char) => char >= 0x104B0 && char <= 0x104FF, // 'Elbasan': (char) => char >= 0x10500 && char <= 0x1052F, // 'Caucasian Albanian': (char) => char >= 0x10530 && char <= 0x1056F, // 'Linear A': (char) => char >= 0x10600 && char <= 0x1077F, @@ -214,13 +217,17 @@ module.exports = { // 'Multani': (char) => char >= 0x11280 && char <= 0x112AF, // 'Khudawadi': (char) => char >= 0x112B0 && char <= 0x112FF, // 'Grantha': (char) => char >= 0x11300 && char <= 0x1137F, + // 'Newa': (char) => char >= 0x11400 && char <= 0x1147F, // 'Tirhuta': (char) => char >= 0x11480 && char <= 0x114DF, // 'Siddham': (char) => char >= 0x11580 && char <= 0x115FF, // 'Modi': (char) => char >= 0x11600 && char <= 0x1165F, + // 'Mongolian Supplement': (char) => char >= 0x11660 && char <= 0x1167F, // 'Takri': (char) => char >= 0x11680 && char <= 0x116CF, // 'Ahom': (char) => char >= 0x11700 && char <= 0x1173F, // 'Warang Citi': (char) => char >= 0x118A0 && char <= 0x118FF, // 'Pau Cin Hau': (char) => char >= 0x11AC0 && char <= 0x11AFF, + // 'Bhaiksuki': (char) => char >= 0x11C00 && char <= 0x11C6F, + // 'Marchen': (char) => char >= 0x11C70 && char <= 0x11CBF, // 'Cuneiform': (char) => char >= 0x12000 && char <= 0x123FF, // 'Cuneiform Numbers and Punctuation': (char) => char >= 0x12400 && char <= 0x1247F, // 'Early Dynastic Cuneiform': (char) => char >= 0x12480 && char <= 0x1254F, @@ -231,6 +238,9 @@ module.exports = { // 'Bassa Vah': (char) => char >= 0x16AD0 && char <= 0x16AFF, // 'Pahawh Hmong': (char) => char >= 0x16B00 && char <= 0x16B8F, // 'Miao': (char) => char >= 0x16F00 && char <= 0x16F9F, + // 'Ideographic Symbols and Punctuation': (char) => char >= 0x16FE0 && char <= 0x16FFF, + // 'Tangut': (char) => char >= 0x17000 && char <= 0x187FF, + // 'Tangut Components': (char) => char >= 0x18800 && char <= 0x18AFF, // 'Kana Supplement': (char) => char >= 0x1B000 && char <= 0x1B0FF, // 'Duployan': (char) => char >= 0x1BC00 && char <= 0x1BC9F, // 'Shorthand Format Controls': (char) => char >= 0x1BCA0 && char <= 0x1BCAF, @@ -241,7 +251,9 @@ module.exports = { // 'Counting Rod Numerals': (char) => char >= 0x1D360 && char <= 0x1D37F, // 'Mathematical Alphanumeric Symbols': (char) => char >= 0x1D400 && char <= 0x1D7FF, // 'Sutton SignWriting': (char) => char >= 0x1D800 && char <= 0x1DAAF, + // 'Glagolitic Supplement': (char) => char >= 0x1E000 && char <= 0x1E02F, // 'Mende Kikakui': (char) => char >= 0x1E800 && char <= 0x1E8DF, + // 'Adlam': (char) => char >= 0x1E900 && char <= 0x1E95F, // 'Arabic Mathematical Alphabetic Symbols': (char) => char >= 0x1EE00 && char <= 0x1EEFF, // 'Mahjong Tiles': (char) => char >= 0x1F000 && char <= 0x1F02F, // 'Domino Tiles': (char) => char >= 0x1F030 && char <= 0x1F09F, diff --git a/js/util/script_detection.js b/js/util/script_detection.js index 4ed6eb3365b..ad8fb597cfe 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 (exports.charAllowsVerticalWritingMode(char.charCodeAt(0))) return true; + if (exports.charHasUprightVerticalOrientation(char.charCodeAt(0))) return true; } return false; }; @@ -45,19 +45,53 @@ module.exports.charAllowsIdeographicBreaking = function(char) { return false; }; -exports.charAllowsVerticalWritingMode = function(char, includeNeutrals) { - // Return early for characters outside all ranges that allow the vertical - // writing mode. +// The following logic comes from +// . +// The data file denotes with “U” or “Tu” any codepoint that may be drawn +// upright in vertical text but does not distinguish between upright and +// “neutral” characters. + +// Blocks in the Unicode supplementary planes are excluded from this module due +// to . + +/** + * Returns true if the given Unicode codepoint identifies a character with + * upright orientation. + * + * A character has upright orientation if it is drawn upright (unrotated) + * whether the line is oriented horizontally or vertically, even if both + * adjacent characters can be rotated. For example, a Chinese character is + * always drawn upright. An uprightly oriented character causes an adjacent + * “neutral” character to be drawn upright as well. + */ +exports.charHasUprightVerticalOrientation = function(char) { + if (char === 0x02EA /* modifier letter yin departing tone mark */ || + char === 0x02EB /* modifier letter yang departing tone mark */) { + return true; + } + + // Return early for characters outside all ranges whose characters remain + // upright in vertical writing mode. if (char < 0x1100) return false; if (isChar['Bopomofo Extended'](char)) return true; if (isChar['Bopomofo'](char)) return true; - if (isChar['CJK Compatibility Forms'](char)) return true; + if (isChar['CJK Compatibility Forms'](char)) { + if (!(char >= 0xFE49 /* dashed overline */ && char <= 0xFE4F /* wavy low line */)) { + return true; + } + } if (isChar['CJK Compatibility Ideographs'](char)) return true; if (isChar['CJK Compatibility'](char)) return true; if (isChar['CJK Radicals Supplement'](char)) return true; if (isChar['CJK Strokes'](char)) return true; - if (isChar['CJK Symbols and Punctuation'](char)) return true; + if (isChar['CJK Symbols and Punctuation'](char)) { + if (!(char >= 0x3008 /* left angle bracket */ && char <= 0x3011 /* right black lenticular bracket */) && + !(char >= 0x3014 /* left tortoise shell bracket */ && char <= 0x301F /* low double prime quotation mark */) && + char !== 0x3030 /* wavy dash */) { + return true; + } + } if (isChar['CJK Unified Ideographs Extension A'](char)) return true; if (isChar['CJK Unified Ideographs'](char)) return true; if (isChar['Enclosed CJK Letters and Months'](char)) return true; @@ -71,24 +105,143 @@ exports.charAllowsVerticalWritingMode = function(char, includeNeutrals) { if (isChar['Kanbun'](char)) return true; if (isChar['Kangxi Radicals'](char)) return true; if (isChar['Katakana Phonetic Extensions'](char)) return true; - if (isChar['Katakana'](char)) return true; - if (isChar['Vertical Forms'](char)) return true; - - if (isCharFullwidthForm(char)) return true; - - if (includeNeutrals) { - if (isChar['General Punctuation'](char)) return true; + if (isChar['Katakana'](char)) { + if (char !== 0x30FC /* katakana-hiragana prolonged sound mark */) { + return true; + } } + if (isChar['Halfwidth and Fullwidth Forms'](char)) { + if (char !== 0xFF08 /* fullwidth left parenthesis */ && + char !== 0xFF09 /* fullwidth right parenthesis */ && + char !== 0xFF0D /* fullwidth hyphen-minus */ && + !(char >= 0xFF1A /* fullwidth colon */ && char <= 0xFF1E /* fullwidth greater-than sign */) && + char !== 0xFF3B /* fullwidth left square bracket */ && + char !== 0xFF3D /* fullwidth right square bracket */ && + char !== 0xFF3F /* fullwidth low line */ && + !(char >= 0xFF5B /* fullwidth left curly bracket */ && char <= 0xFFDF) && + char !== 0xFFE3 /* fullwidth macron */ && + !(char >= 0xFFE8 /* halfwidth forms light vertical */ && char <= 0xFFEF)) { + return true; + } + } + if (isChar['Small Form Variants'](char)) { + if (!(char >= 0xFE58 /* small em dash */ && char <= 0xFE5E /* small right tortoise shell bracket */) && + !(char >= 0xFE63 /* small hyphen-minus */ && char <= 0xFE66 /* small equals sign */)) { + return true; + } + } + if (isChar['Unified Canadian Aboriginal Syllabics'](char)) return true; + if (isChar['Unified Canadian Aboriginal Syllabics Extended'](char)) return true; + if (isChar['Vertical Forms'](char)) return true; + if (isChar['Yijing Hexagram Symbols'](char)) return true; + if (isChar['Yi Syllables'](char)) return true; + if (isChar['Yi Radicals'](char)) return true; return false; }; -function isCharFullwidthForm(char) { - // Fullwidth Forms: "!" to "~" - if (char >= 0xFF01 && char <= 0xFF5E) return true; +/** + * Returns true if the given Unicode codepoint identifies a character with + * neutral orientation. + * + * A character has neutral orientation if it may be drawn rotated or unrotated + * when the line is oriented vertically, depending on the orientation of the + * adjacent characters. For example, along a verticlly oriented line, the vulgar + * fraction ½ is drawn upright among Chinese characters but rotated among Latin + * letters. A neutrally oriented character does not influence whether an + * adjacent character is drawn upright or rotated. + */ +exports.charHasNeutralVerticalOrientation = function(char) { + if (isChar['Latin-1 Supplement'](char)) { + if (char === 0x00A7 /* section sign */ || + char === 0x00A9 /* copyright sign */ || + char === 0x00AE /* registered sign */ || + char === 0x00B1 /* plus-minus sign */ || + char === 0x00BC /* vulgar fraction one quarter */ || + char === 0x00BD /* vulgar fraction one half */ || + char === 0x00BE /* vulgar fraction three quarters */ || + char === 0x00D7 /* multiplication sign */ || + char === 0x00F7 /* division sign */) { + return true; + } + } + if (isChar['General Punctuation'](char)) { + if (char === 0x2016 /* double vertical line */ || + char === 0x2020 /* dagger */ || + char === 0x2021 /* double dagger */ || + char === 0x2030 /* per mille sign */ || + char === 0x2031 /* per ten thousand sign */ || + char === 0x203B /* reference mark */ || + char === 0x203C /* double exclamation mark */ || + char === 0x2042 /* asterism */ || + char === 0x2047 /* double question mark */ || + char === 0x2048 /* question exclamation mark */ || + char === 0x2049 /* exclamation question mark */ || + char === 0x2051 /* two asterisks aligned vertically */) { + return true; + } + } + if (isChar['Letterlike Symbols'](char)) return true; + if (isChar['Number Forms'](char)) return true; + if (isChar['Miscellaneous Technical'](char)) { + if ((char >= 0x2300 /* diameter sign */ && char <= 0x2307 /* wavy line */) || + (char >= 0x230C /* bottom right crop */ && char <= 0x231F /* bottom right corner */) || + (char >= 0x2324 /* up arrowhead between two horizontal bars */ && char <= 0x2328 /* keyboard */) || + char === 0x232B /* erase to the left */ || + (char >= 0x237D /* shouldered open box */ && char <= 0x239A /* clear screen symbol */) || + (char >= 0x23BE /* dentistry symbol light vertical and top right */ && char <= 0x23CD /* square foot */) || + char === 0x23CF /* eject symbol */ || + (char >= 0x23D1 /* metrical breve */ && char <= 0x23DB /* fuse */) || + (char >= 0x23E2 /* white trapezium */ && char <= 0x23FF)) { + return true; + } + } + if (isChar['Control Pictures'](char) && char !== 0x2423 /* open box */) return true; + if (isChar['Optical Character Recognition'](char)) return true; + if (isChar['Enclosed Alphanumerics'](char)) return true; + if (isChar['Geometric Shapes'](char)) return true; + if (isChar['Miscellaneous Symbols'](char)) { + if (!(char >= 0x261A /* black left pointing index */ && char <= 0x261F /* white down pointing index */)) { + return true; + } + } + if (isChar['Miscellaneous Symbols and Arrows'](char)) { + if ((char >= 0x2B12 /* square with top half black */ && char <= 0x2B2F /* white vertical ellipse */) || + (char >= 0x2B50 /* white medium star */ && char <= 0x2B59 /* heavy circled saltire */) || + (char >= 0x2BB8 /* upwards white arrow from bar with horizontal bar */ && char <= 0x2BEB)) { + return true; + } + } + if (isChar['CJK Symbols and Punctuation'](char)) return true; + if (isChar['Katakana'](char)) return true; + if (isChar['Private Use Area'](char)) return true; + if (isChar['CJK Compatibility Forms'](char)) return true; + if (isChar['Small Form Variants'](char)) return true; + if (isChar['Halfwidth and Fullwidth Forms'](char)) return true; - // Fullwidth Forms: "¢" to "₩" - if (char >= 0xFFE0 && char <= 0xFFE6) return true; + if (char === 0x221E /* infinity */ || + char === 0x2234 /* therefore */ || + char === 0x2235 /* because */ || + (char >= 0x2700 /* black safety scissors */ && char <= 0x2767 /* rotated floral heart bullet */) || + (char >= 0x2776 /* dingbat negative circled digit one */ && char <= 0x2793 /* dingbat negative circled sans-serif number ten */) || + char === 0xFFFC /* object replacement character */ || + char === 0xFFFD /* replacement character */) { + return true; + } return false; -} +}; + +/** + * Returns true if the given Unicode codepoint identifies a character with + * rotated orientation. + * + * A character has rotated orientation if it is drawn rotated when the line is + * oriented vertically, even if both adjacent characters are upright. For + * example, a Latin letter is drawn rotated along a vertical line. A rotated + * character causes an adjacent “neutral” character to be drawn rotated as well. + */ +exports.charHasRotatedVerticalOrientation = function(char) { + return !(exports.charHasUprightVerticalOrientation(char) || + exports.charHasNeutralVerticalOrientation(char)); +}; diff --git a/js/util/verticalize_punctuation.js b/js/util/verticalize_punctuation.js index f65315484bd..a330c79072a 100644 --- a/js/util/verticalize_punctuation.js +++ b/js/util/verticalize_punctuation.js @@ -10,8 +10,8 @@ module.exports = function verticalizePunctuation(input) { const prevCharCode = input.charCodeAt(i - 1) || null; const canReplacePunctuation = ( - (!nextCharCode || scriptDetection.charAllowsVerticalWritingMode(nextCharCode, true)) && - (!prevCharCode || scriptDetection.charAllowsVerticalWritingMode(prevCharCode, true)) + (!nextCharCode || !scriptDetection.charHasRotatedVerticalOrientation(nextCharCode) || module.exports.lookup[input[i + 1]]) && + (!prevCharCode || !scriptDetection.charHasRotatedVerticalOrientation(prevCharCode) || module.exports.lookup[input[i - 1]]) ); if (canReplacePunctuation && module.exports.lookup[input[i]]) { @@ -25,7 +25,7 @@ module.exports = function verticalizePunctuation(input) { }; module.exports.lookup = { - '!': '!', + '!': '︕', '#': '#', '$': '$', '%': '%', @@ -34,16 +34,16 @@ module.exports.lookup = { ')': '︶', '*': '*', '+': '+', - ',': ',', + ',': '︐', '-': '︲', '.': '・', '/': '/', - ':': ':', - ';': ';', + ':': '︓', + ';': '︔', '<': '︿', '=': '=', '>': '﹀', - '?': '?', + '?': '︖', '@': '@', '[': '﹇', '\\': '\', @@ -67,8 +67,10 @@ module.exports.lookup = { '’': '﹄', '“': '﹁', '”': '﹂', + '…': '︙', '‧': '・', '₩': '₩', + '、': '︑', '。': '︒', '〈': '︿', '〉': '﹀', @@ -82,14 +84,19 @@ module.exports.lookup = { '】': '︼', '〔': '︹', '〕': '︺', - '〘': '︹', - '〙': '︺', + '〖': '︗', + '〗': '︘', + '!': '︕', '(': '︵', ')': '︶', + ',': '︐', '-': '︲', '.': '・', + ':': '︓', + ';': '︔', '<': '︿', '>': '﹀', + '?': '︖', '[': '﹇', ']': '﹈', '_': '︳', diff --git a/package.json b/package.json index 2fe53f4fc85..3a258de94b8 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "in-publish": "^2.0.0", "jsdom": "^9.4.2", "lodash.template": "^4.4.0", - "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#7111a29c5a82c1e8e07dc7406fb422ae1bf05990", + "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#daed4f70dc47fa660f169cd52091716852aea811", "minifyify": "^7.0.1", "npm-run-all": "^3.0.0", "nyc": "^8.3.0",