Skip to content

Commit

Permalink
Fixed linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Wojciechowski committed Nov 9, 2016
1 parent d0e0e5c commit d8aa197
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 42 deletions.
2 changes: 1 addition & 1 deletion js/symbol/glyph_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class GlyphSource {
}
missing[range].push(glyphID);
}
}
};

for (let i = 0; i < glyphIDs.length; i++) {
const glyphID = glyphIDs[i];
Expand Down
8 changes: 4 additions & 4 deletions js/symbol/quads.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ function getGlyphQuads(anchor, shaping, boxScale, line, layer, alongLine) {

const center = new Point(positionedGlyph.x, glyph.advance / 2);

let otl = new Point(x1, y1);
let otr = new Point(x2, y1);
let obl = new Point(x1, y2);
let obr = new Point(x2, y2);
const otl = new Point(x1, y1);
const otr = new Point(x2, y1);
const obl = new Point(x1, y2);
const obr = new Point(x2, y2);

if (positionedGlyph.angle !== 0) {
otl._sub(center)._rotate(positionedGlyph.angle)._add(center);
Expand Down
1 change: 0 additions & 1 deletion js/symbol/shaping.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const scriptDetection = require('../util/script_detection');
const verticalizePunctuation = require('../util/verticalize_punctuation');
const isCharInUnicodeBlock = require('../util/is_char_in_unicode_block');


const WritingMode = {
Expand Down
2 changes: 1 addition & 1 deletion js/util/script_detection.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ exports.charAllowsVerticalWritingMode = function(char, includeNeutrals) {
}

return false;
}
};

function isCharFullwidthForm(char) {
// Fullwidth Forms: "!" to "~"
Expand Down
69 changes: 34 additions & 35 deletions js/util/verticalize_punctuation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,44 @@

const scriptDetection = require('./script_detection');

const lookup = module.exports.lookup = {
'。': '︒',
'—': '︱',
'–': '︲',
'_': '︳',
'(': '︵',
')': '︶',
'{': '︷',
'}': '︸',
'〔': '︹',
'〕': '︺',
'〘': '︹',
'〙': '︺',
'【': '︻',
'】': '︼',
'《': '︽',
'》': '︾',
'〈': '︿',
'〉': '﹀',
'「': '﹁',
'」': '﹂',
'『': '﹃',
'』': '﹄',
'「': '﹁',
'」': '﹂',
'[': '﹇',
']': '﹈',
'“': '﹁',
'”': '﹂',
'‘': '﹃',
'’': '﹄',
'.': '・'
};

module.exports = function verticalizePunctuation(input) {
let output = '';

for (let i = 0; i < input.length; i++) {
const charCode = input.charCodeAt(i);
const nextCharCode = input.charCodeAt(i + 1) || null;
const prevCharCode = input.charCodeAt(i - 1) || null;

Expand All @@ -23,38 +56,4 @@ module.exports = function verticalizePunctuation(input) {
}

return output;
}

const lookup = module.exports.lookup = {
'。': '︒',
'—': '︱',
'–': '︲',
'_': '︳',
'(': '︵',
')': '︶',
'{': '︷',
'}': '︸',
'〔': '︹',
'〕': '︺',
'〘': '︹',
'〙': '︺',
'【': '︻',
'】': '︼',
'《': '︽',
'》': '︾',
'〈': '︿',
'〉': '﹀',
'「': '﹁',
'」': '﹂',
'『': '﹃',
'』': '﹄',
'「': '﹁',
'」': '﹂',
'[': '﹇',
']': '﹈',
'“': '﹁',
'”': '﹂',
'‘': '﹃',
'’': '﹄',
'.': '・'
};

0 comments on commit d8aa197

Please sign in to comment.