Skip to content

Commit

Permalink
Fix spelling mistakes.
Browse files Browse the repository at this point in the history
  • Loading branch information
fdb committed May 15, 2017
1 parent f2189df commit 865002d
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ CmapEncoding.prototype.charToGlyphIndex = function(c) {
* @class
* @constructor
* @param {string} encoding - The encoding
* @param {Array} charset - The charcater set.
* @param {Array} charset - The character set.
*/
function CffEncoding(encoding, charset) {
this.encoding = encoding;
Expand Down
4 changes: 2 additions & 2 deletions src/font.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ Font.prototype.getPath = function(text, x, y, fontSize, options) {
};

/**
* Create an array of Path objects that represent the glyps of a given text.
* Create an array of Path objects that represent the glyphs of a given text.
* @param {string} text - The text to create.
* @param {number} [x=0] - Horizontal position of the beginning of the text.
* @param {number} [y=0] - Vertical position of the *baseline* of the text.
Expand All @@ -338,7 +338,7 @@ Font.prototype.getPaths = function(text, x, y, fontSize, options) {
* Returns the advance width of a text.
*
* This is something different than Path.getBoundingBox() as for example a
* suffixed whitespace increases the advancewidth but not the bounding box
* suffixed whitespace increases the advanceWidth but not the bounding box
* or an overhanging letter like a calligraphic 'f' might have a quite larger
* bounding box than its advance width.
*
Expand Down
6 changes: 3 additions & 3 deletions src/glyph.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function Glyph(options) {
Glyph.prototype.bindConstructorValues = function(options) {
this.index = options.index || 0;

// These three values cannnot be deferred for memory optimization:
// These three values cannot be deferred for memory optimization:
this.name = options.name || null;
this.unicode = options.unicode || undefined;
this.unicodes = options.unicodes || options.unicode !== undefined ? [options.unicode] : [];
Expand Down Expand Up @@ -116,7 +116,7 @@ Glyph.prototype.getBoundingBox = function() {
* @param {number} [x=0] - Horizontal position of the beginning of the text.
* @param {number} [y=0] - Vertical position of the *baseline* of the text.
* @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`.
* @param {Object=} options - xScale, yScale to strech the glyph.
* @param {Object=} options - xScale, yScale to stretch the glyph.
* @param {opentype.Font} if hinting is to be used, the font
* @return {opentype.Path}
*/
Expand Down Expand Up @@ -259,7 +259,7 @@ Glyph.prototype.getMetrics = function() {
* @param {number} [x=0] - Horizontal position of the beginning of the text.
* @param {number} [y=0] - Vertical position of the *baseline* of the text.
* @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`.
* @param {Object=} options - xScale, yScale to strech the glyph.
* @param {Object=} options - xScale, yScale to stretch the glyph.
*/
Glyph.prototype.draw = function(ctx, x, y, fontSize, options) {
this.getPath(x, y, fontSize, options).draw(ctx);
Expand Down
20 changes: 10 additions & 10 deletions src/hintingtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
* However, Javascript has floating point operations by default and only
* those are available. One could make a case to simulate the 1/64 accuracy
* exactly by truncating after every division operation
* (for example with << 0) to get pixel exacty results as other TrueType
* (for example with << 0) to get pixel exactly results as other TrueType
* implementations. It may make sense since some fonts are pixel optimized
* by hand using DELTAP instructions. The current implementation doesn't
* and rather uses full floating point precission.
* and rather uses full floating point precision.
*
* xScale, yScale and rotation is currently ignored.
*
Expand Down Expand Up @@ -502,7 +502,7 @@ var HPZero = Object.freeze(new HPoint(0, 0));
* The default state of the interpreter.
*
* Note: Freezing the defaultState and then deriving from it
* makes the V8 Javascript engine going akward,
* makes the V8 Javascript engine going awkward,
* so this is avoided, albeit the defaultState shouldn't
* ever change.
*/
Expand Down Expand Up @@ -727,7 +727,7 @@ function execGlyph(glyph, prepState) {
}

/*
* Executes the hinting program for a componenet of a multi-component glyph
* Executes the hinting program for a component of a multi-component glyph
* or of the glyph itself by a non-component glyph.
*/
function execComponent(glyph, state, xScale, yScale)
Expand Down Expand Up @@ -883,7 +883,7 @@ function initTZone(state)

/*
* Skips the instruction pointer ahead over an IF/ELSE block.
* handleElse .. if true breaks on mathing ELSE
* handleElse .. if true breaks on matching ELSE
*/
function skip(state, handleElse)
{
Expand Down Expand Up @@ -1237,7 +1237,7 @@ function SMD(state) {
// 0x1B
function ELSE(state) {
// This instruction has been reached by executing a then branch
// so it just skips ahead until mathing EIF.
// so it just skips ahead until matching EIF.
//
// In case the IF was negative the IF[] instruction already
// skipped forward over the ELSE[]
Expand Down Expand Up @@ -1380,7 +1380,7 @@ function CINDEX(state) {

if (exports.DEBUG) console.log(state.step, 'CINDEX[]', k);

// In case of k == 1, it copies the last element after poping
// In case of k == 1, it copies the last element after popping
// thus stack.length - k.
stack.push(stack[stack.length - k]);
}
Expand Down Expand Up @@ -2668,7 +2668,7 @@ instructionTable = [
/* 0x7C */ RUTG,
/* 0x7D */ RDTG,
/* 0x7E */ POP, // actually SANGW, supposed to do only a pop though
/* 0x7F */ POP, // actually AA, upposed to do only a pop though
/* 0x7F */ POP, // actually AA, supposed to do only a pop though
/* 0x80 */ undefined, // TODO FLIPPT
/* 0x81 */ undefined, // TODO FLIPRGON
/* 0x82 */ undefined, // TODO FLIPRGOFF
Expand Down Expand Up @@ -2802,7 +2802,7 @@ instructionTable = [
export default Hinting;

/*****************************
Mathematical Considertions
Mathematical Considerations
******************************
fv ... refers to freedom vector
Expand Down Expand Up @@ -2960,7 +2960,7 @@ option (that is avoiding 0/0 divisions) is to weight the
original distance of the other point by the sum of both distances.
If the sum of both distances is 0, then move the point by the
arithmetic average of the movement of both refererence points.
arithmetic average of the movement of both reference points.
Expand Down
4 changes: 2 additions & 2 deletions src/layout.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// The Layout object is the prototype of Substition objects, and provides
// The Layout object is the prototype of Substitution objects, and provides
// utility methods to manipulate common layout tables (GPOS, GSUB, GDEF...)

import check from './check';
Expand Down Expand Up @@ -226,7 +226,7 @@ Layout.prototype = {
var lookupTable;
var lookupListIndexes = featureTable.lookupListIndexes;
var allLookups = this.font.tables[this.tableName].lookups;
// lookupListIndexes are in no particular order, so use naïve search.
// lookupListIndexes are in no particular order, so use naive search.
for (var i = 0; i < lookupListIndexes.length; i++) {
lookupTable = allLookups[lookupListIndexes[i]];
if (lookupTable.lookupType === lookupType) {
Expand Down
4 changes: 2 additions & 2 deletions src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Parser.prototype.parseTag = function() {
Parser.prototype.parseLongDateTime = function() {
var v = getULong(this.data, this.offset + this.relativeOffset + 4);
// Subtract seconds between 01/01/1904 and 01/01/1970
// to convert Apple Mac timstamp to Standard Unix timestamp
// to convert Apple Mac timestamp to Standard Unix timestamp
v -= 2082844800;
this.relativeOffset += 8;
return v;
Expand Down Expand Up @@ -296,7 +296,7 @@ Parser.prototype.parseStruct = function(description) {

Parser.prototype.parsePointer = function(description) {
var structOffset = this.parseOffset16();
if (structOffset > 0) { // NULL offset => return indefined
if (structOffset > 0) { // NULL offset => return undefined
return new Parser(this.data, this.offset + structOffset).parseStruct(description);
}
return undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Path.prototype.getBoundingBox = function() {
prevY = startY;
break;
default:
throw new Error('Unexpected path commmand ' + cmd.type);
throw new Error('Unexpected path command ' + cmd.type);
}
}
if (box.isEmpty()) {
Expand Down
4 changes: 2 additions & 2 deletions src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ sizeOf.UTF16 = function(v) {
// Data for converting old eight-bit Macintosh encodings to Unicode.
// This representation is optimized for decoding; encoding is slower
// and needs more memory. The assumption is that all opentype.js users
// want to open fonts, but saving a font will be comperatively rare
// want to open fonts, but saving a font will be comparatively rare
// so it can be more expensive. Keyed by IANA character set name.
//
// Python script for generating these strings:
Expand Down Expand Up @@ -707,7 +707,7 @@ encode.INDEX = function(l) {
// i, v;
// Because we have to know which data type to use to encode the offsets,
// we have to go through the values twice: once to encode the data and
// calculate the offets, then again to encode the offsets using the fitting data type.
// calculate the offsets, then again to encode the offsets using the fitting data type.
var offset = 1; // First offset is always 1.
var offsets = [offset];
var data = [];
Expand Down
2 changes: 1 addition & 1 deletion test/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ describe('types.js', function() {
// words, bytes, words:
// a single byte-encodable word is more compact when encoded within the words run
assert.equal(e([0x6666, 2, 0x7777]), '42 66 66 00 02 77 77');
// multiple byte-encodable words are more compated when forming their own run
// multiple byte-encodable words are more compacted when forming their own run
assert.equal(e([0x6666, 2, 2, 0x7777]), '40 66 66 01 02 02 40 77 77');
});
});

0 comments on commit 865002d

Please sign in to comment.