Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
zmiao committed Jun 7, 2021
1 parent cf8627c commit d02ec2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/symbol/shaping.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ class TaggedString {
return this.text.charCodeAt(index);
}

verticalizePunctuation(skipChontextChecking: boolean) {
this.text = verticalizePunctuation(this.text, skipChontextChecking);
verticalizePunctuation(skipContextChecking: boolean) {
this.text = verticalizePunctuation(this.text, skipContextChecking);
}

trim() {
Expand Down Expand Up @@ -478,7 +478,7 @@ function leastBadBreaks(lastLineBreak: ?Break): Array<number> {
function determineLineBreaks(logicalInput: TaggedString,
spacing: number,
maxWidth: number,
glyphMap: {[string]: {glyphs: {[number]: ?StyleGlyph}, ascender?: number, descender?: number}},
glyphMap: {[_: string]: {glyphs: {[_: number]: ?StyleGlyph}, ascender?: number, descender?: number}},
imagePositions: {[_: string]: ImagePosition},
symbolPlacement: string,
layoutTextSize: number): Array<number> {
Expand Down Expand Up @@ -653,7 +653,7 @@ function shapeLines(shaping: Shaping,
verticalAdvance = codePoint !== 0x200b ? ONE_EM : 0;

// In order to make different fonts aligned, they must share a general baseline that aligns with every
// font's real baseline. Glyph's offset is counted from the top left corner, where is the ascender line
// font's real baseline. Glyph's offset is counted from the top left corner, where the ascender line
// starts.
// First of all, each glyph's baseline lies on the center line of the shaping line. Since ascender
// is above the baseline, the glyphOffset is the negative shift. Then, in order to make glyphs fit in
Expand Down
4 changes: 2 additions & 2 deletions src/util/verticalize_punctuation.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ export const verticalizedCharacterMap = {
'」': '﹂'
};

export default function verticalizePunctuation(input: string, skipChontextChecking: boolean) {
export default function verticalizePunctuation(input: string, skipContextChecking: boolean) {
let output = '';

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

const canReplacePunctuation = skipChontextChecking || (
const canReplacePunctuation = skipContextChecking || (
(!nextCharCode || !charHasRotatedVerticalOrientation(nextCharCode) || verticalizedCharacterMap[input[i + 1]]) &&
(!prevCharCode || !charHasRotatedVerticalOrientation(prevCharCode) || verticalizedCharacterMap[input[i - 1]])
);
Expand Down

0 comments on commit d02ec2d

Please sign in to comment.