Skip to content

Commit

Permalink
fix: fix spelling searchRenge to searchRange
Browse files Browse the repository at this point in the history
  • Loading branch information
kekee000 committed Oct 26, 2020
1 parent 9c4d224 commit da8b2d5
Show file tree
Hide file tree
Showing 22 changed files with 51 additions and 52 deletions.
5 changes: 2 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export namespace TTF {
type TTFObject = {
version: number;
numTables: number;
searchRenge: number;
searchRange: number;
entrySelector: number;
rangeShift: number;
head: Head;
Expand Down Expand Up @@ -214,7 +214,6 @@ export namespace FontEditor {
* combine svg paths to one glyph in one svg file. default true
*/
combinePath?: boolean;

}

interface FontWriteOptions {
Expand Down Expand Up @@ -302,7 +301,7 @@ export namespace FontEditor {
* write font data
* @param options write options
*/
ewrite(options: FontWriteOptions): FontOutput;
write(options: FontWriteOptions): FontOutput;

write(options: {type: 'svg'} & FontWriteOptions): string;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fonteditor-core",
"version": "2.1.3",
"version": "2.1.4",
"description": "fonts (ttf, woff, woff2, eot, svg, otf) parse, write, transform, glyph adjust.",
"keywords": [
"sfnt",
Expand Down
2 changes: 1 addition & 1 deletion src/ttf/data/empty.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
export default {
"version": 1,
"numTables": 10,
"searchRenge": 128,
"searchRange": 128,
"entrySelector": 3,
"rangeShift": 64,
"head": {
Expand Down
4 changes: 2 additions & 2 deletions src/ttf/otfreader.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export default class OTFReader {
error.raise(10302);
}

// searchRenge
font.searchRenge = reader.readUint16();
// searchRange
font.searchRange = reader.readUint16();

// entrySelector
font.entrySelector = reader.readUint16();
Expand Down
4 changes: 2 additions & 2 deletions src/ttf/ttfreader.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export default class TTFReader {
error.raise(10101);
}

// searchRenge
ttf.searchRenge = reader.readUint16();
// searchRange
ttf.searchRange = reader.readUint16();

// entrySelector
ttf.entrySelector = reader.readUint16();
Expand Down
4 changes: 2 additions & 2 deletions test/spec/common/lang.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import assert from 'assert';
import * as lang from 'fonteditor-core/common/lang';


describe('测试overwrite', function () {
describe('test overwrite', function () {

it('test normal object', function () {
let result = lang.overwrite(
Expand Down Expand Up @@ -133,7 +133,7 @@ describe('测试overwrite', function () {



describe('测试equals', function () {
describe('test equals', function () {

it('test normal object', function () {
let result = lang.equals(
Expand Down
2 changes: 1 addition & 1 deletion test/spec/graphics/computeBoundingBox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const p1 = {
onCurve: true
};

describe('计算包围盒', function () {
describe('compute bounds', function () {

it('test computeBounding', function () {

Expand Down
2 changes: 1 addition & 1 deletion test/spec/graphics/pathAdjust.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const path = [
}
];

describe('调整路径', function () {
describe('adjust path by scale, rotate, translate', function () {

it('test default', function () {

Expand Down
4 changes: 2 additions & 2 deletions test/spec/math/bezierCubic2Q2.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ const p1 = {
y: 100
};

describe('三次bezier曲线转二次', function () {
describe('Cubic bezier to quadratic bezier', function () {


it('test c0=p0, c1 = p1', function () {
it('test c0=p0, c1 = p1sa', function () {
let result = bezierCubic2Q2(p0, p0, p1, p1);
assert.deepEqual(result[0], [
{
Expand Down
2 changes: 1 addition & 1 deletion test/spec/ttf/eot2ttf.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import TTFReader from 'fonteditor-core/ttf/ttfreader';
import ttf2eot from 'fonteditor-core/ttf/ttf2eot';
import eot2ttf from 'fonteditor-core/ttf/eot2ttf';

describe('eot ttf', function () {
describe('eot to ttf', function () {

let eotBuffer = ttf2eot(readData('baiduHealth-hinting.ttf'));
let ttf = new TTFReader({
Expand Down
30 changes: 15 additions & 15 deletions test/spec/ttf/font.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {readData} from '../data';
import Font from 'fonteditor-core/ttf/font';
import main from 'fonteditor-core/main';

describe('测试 Font 对象============================', function () {
describe('test Font Class ============================', function () {

it('test create empty', function () {
let font = Font.create();
Expand All @@ -27,7 +27,7 @@ describe('测试 Font 对象============================', function () {
});
});

describe('读ttf数据', function () {
describe('read ttf buffer', function () {
let font = Font.create(readData('baiduHealth.ttf'), {
type: 'ttf'
});
Expand All @@ -37,7 +37,7 @@ describe('读ttf数据', function () {
});
});

describe('转换compound到simple', function () {
describe('transform compound to simple', function () {
let font = Font.create(readData('baiduHealth.ttf'), {
type: 'ttf',
compound2simple: true
Expand All @@ -49,19 +49,19 @@ describe('转换compound到simple', function () {
});
});

describe('读otf数据', function () {
describe('read otf buffer', function () {
let font = Font.create(readData('BalladeContour.otf'), {
type: 'otf'
});
it('test read otf', function () {
assert.equal(font.data.version, 0x1);
assert.equal(font.data.numTables, 9);
assert.equal(font.data.rangeShift, 16);
assert.equal(font.data.searchRenge, 128);
assert.equal(font.data.searchRange, 128);
});
});

describe('读取 woff 数据', function () {
describe('read woff buffer', function () {
let buffer = Font.create(readData('baiduHealth.ttf'), {
type: 'ttf'
}).write({
Expand All @@ -78,7 +78,7 @@ describe('读取 woff 数据', function () {
});
});

describe('读取 woff2 数据', function () {
describe('read woff2 buffer', function () {
this.timeout(2000);
before(function (done) {
main.woff2.init().then(() => done());
Expand All @@ -99,7 +99,7 @@ describe('读取 woff2 数据', function () {
});
});

describe('读取 eot 数据', function () {
describe('read eot buffer', function () {
let buffer = Font.create(readData('baiduHealth.ttf'), {
type: 'ttf'
}).write({
Expand All @@ -116,7 +116,7 @@ describe('读取 eot 数据', function () {
});
});

describe('读取 svg 文件', function () {
describe('read svg text', function () {
let font = Font.create(readData('iconfont-xin.svg'), {
type: 'svg'
});
Expand All @@ -128,7 +128,7 @@ describe('读取 svg 文件', function () {
});
});

describe('读取 svg 字体', function () {
describe('read svg font text', function () {
let font = Font.create(readData('icomoon.svg'), {
type: 'svg'
});
Expand All @@ -150,7 +150,7 @@ describe('读取 svg 字体', function () {



describe('写ttf数据', function () {
describe('write ttf buffer', function () {

it('test write ttf', function () {
let buffer = Font.create(readData('baiduHealth.ttf'), {
Expand Down Expand Up @@ -188,7 +188,7 @@ describe('写ttf数据', function () {
});
});

describe('写eot数据', function () {
describe('write eot buffer', function () {
let buffer = Font.create(readData('baiduHealth.ttf'), {
type: 'ttf'
}).write({
Expand All @@ -209,7 +209,7 @@ describe('写eot数据', function () {
});
});

describe('写woff数据', function () {
describe('write woff buffer', function () {
let buffer = Font.create(readData('baiduHealth.ttf'), {
type: 'ttf'
}).write({
Expand All @@ -230,7 +230,7 @@ describe('写woff数据', function () {
});
});

describe('写woff2数据', function () {
describe('write woff2 buffer', function () {
this.timeout(2000);
before(function (done) {
main.woff2.init().then(() => done());
Expand All @@ -256,7 +256,7 @@ describe('写woff2数据', function () {
});
});

describe('写svg数据', function () {
describe('write svg text', function () {
let font = Font.create(readData('baiduHealth.ttf'), {
type: 'ttf'
});
Expand Down
2 changes: 1 addition & 1 deletion test/spec/ttf/otf2ttfobject.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {readData} from '../data';
import OTFReader from 'fonteditor-core/ttf/otfreader';
import otf2ttfobject from 'fonteditor-core/ttf/otf2ttfobject';

describe('otf 转ttf object', function () {
describe('otf to ttf object', function () {

let fontObject = new OTFReader().read(readData('BalladeContour.otf'));
let numGlyphs = fontObject.maxp.numGlyphs;
Expand Down
8 changes: 4 additions & 4 deletions test/spec/ttf/otfreader.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import assert from 'assert';
import {readData} from '../data';
import OTFReader from 'fonteditor-core/ttf/otfreader';

describe('读otf数据', function () {
describe('read otf buffer', function () {

let fontObject = new OTFReader().read(readData('BalladeContour.otf'));

it('test read otf', function () {
assert.equal(fontObject.version, 'OTTO');
assert.equal(fontObject.numTables, 9);
assert.equal(fontObject.rangeShift, 16);
assert.equal(fontObject.searchRenge, 128);
assert.equal(fontObject.searchRange, 128);
});

it('test read otf head', function () {
Expand Down Expand Up @@ -77,7 +77,7 @@ describe('读otf数据', function () {

});

describe('读otf hinting GPOS kern', function () {
describe('read otf hinting GPOS kern', function () {
let fontObject = new OTFReader().read(readData('SFNSDisplayCondensed-Black.otf'));

it('test read hinting', function () {
Expand All @@ -86,7 +86,7 @@ describe('读otf hinting GPOS kern', function () {

});

describe('读错误otf数据', function () {
describe('read erro otf buffer', function () {

it('test read version error', function () {
assert.throws(function () {
Expand Down
2 changes: 1 addition & 1 deletion test/spec/ttf/reader.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import assert from 'assert';
import Writer from 'fonteditor-core/ttf/writer';
import Reader from 'fonteditor-core/ttf/reader';

describe('读数据', function () {
describe('read buffer', function () {
let buffer = new ArrayBuffer(100);
let writer = new Writer(buffer, 0, 100);
let now = Math.round(new Date().getTime() / 1000) * 1000;
Expand Down
2 changes: 1 addition & 1 deletion test/spec/ttf/ttf2eot.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import TTFReader from 'fonteditor-core/ttf/ttfreader';
import ttf2eot from 'fonteditor-core/ttf/ttf2eot';
import eot2ttf from 'fonteditor-core/ttf/eot2ttf';

describe('ttf eot', function () {
describe('ttf to eot', function () {

let eotBuffer = ttf2eot(readData('baiduHealth.ttf'));

Expand Down
2 changes: 1 addition & 1 deletion test/spec/ttf/ttf2svg.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import TTFReader from 'fonteditor-core/ttf/ttfreader';
import ttf2svg from 'fonteditor-core/ttf/ttf2svg';
import svg2ttfobject from 'fonteditor-core/ttf/svg2ttfobject';

describe('ttf svg', function () {
describe('ttf to svg', function () {

let fontObject = new TTFReader().read(readData('baiduHealth.ttf'));
let svg = ttf2svg(fontObject);
Expand Down
2 changes: 1 addition & 1 deletion test/spec/ttf/ttf2symbol.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {readData} from '../data';
import TTFReader from 'fonteditor-core/ttf/ttfreader';
import ttf2symbol from 'fonteditor-core/ttf/ttf2symbol';

describe('ttf symbol', function () {
describe('ttf to symbol', function () {

let fontObject = new TTFReader().read(readData('baiduHealth.ttf'));
let svg = ttf2symbol(fontObject);
Expand Down
4 changes: 2 additions & 2 deletions test/spec/ttf/ttf2woff.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import woff2ttf from 'fonteditor-core/ttf/woff2ttf';
import pako from 'pako';
import { fstat } from 'fs';

describe('ttf woff', function () {
describe('ttf to woff', function () {

let woffBuffer = ttf2woff(readData('baiduHealth.ttf'));

Expand Down Expand Up @@ -52,7 +52,7 @@ describe('ttf 转 woff', function () {
});


describe('ttf woff with deflate', function () {
describe('ttf to woff with deflate', function () {

let woffBuffer = ttf2woff(readData('baiduHealth.ttf'), {
deflate: pako.deflate
Expand Down
Loading

0 comments on commit da8b2d5

Please sign in to comment.