modify fecs line rules
This commit is contained in:
4
src/.fecsignore
Normal file
4
src/.fecsignore
Normal file
@@ -0,0 +1,4 @@
|
||||
fonteditor/template/dialog/*
|
||||
fonteditor/template/export/*
|
||||
editor/shapes/*
|
||||
ttf/data/*
|
||||
15
src/.fecsrc
Normal file
15
src/.fecsrc
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"eslint": {
|
||||
"env": {
|
||||
"node": true,
|
||||
"browser": true
|
||||
},
|
||||
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"fecs-max-statements": 0,
|
||||
"max-params": 0,
|
||||
"max-depth": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,6 @@ define(
|
||||
}
|
||||
|
||||
|
||||
/* eslint-disable max-depth */
|
||||
/**
|
||||
* 初始化渲染器
|
||||
*/
|
||||
@@ -257,7 +256,6 @@ define(
|
||||
me.render.refresh();
|
||||
});
|
||||
}
|
||||
/* eslint-enable max-depth */
|
||||
|
||||
return initRender;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* @author mengke01(kekee000@gmail.com)
|
||||
*/
|
||||
|
||||
/* eslint-disable max-len */
|
||||
define(
|
||||
function (require) {
|
||||
return [
|
||||
@@ -34,12 +33,14 @@ define(
|
||||
},
|
||||
{
|
||||
name: 'baiduHealth.woff',
|
||||
url: 'http://vs-static.baidu.com/m-health/new-composite/20141223/asset/common/css/font/baiduHealth.woff',
|
||||
url: 'http://vs-static.baidu.com'
|
||||
+ '/m-health/new-composite/20141223/asset/common/css/font/baiduHealth.woff',
|
||||
from: '百度健康图标'
|
||||
},
|
||||
{
|
||||
name: 'fonteditor.woff',
|
||||
url: 'http://vs-static.baidu.com/m-health/med-detail/201412301413/asset/common/css/fonts/fonteditor.woff',
|
||||
url: 'http://vs-static.baidu.com'
|
||||
+ '/m-health/med-detail/201412301413/asset/common/css/fonts/fonteditor.woff',
|
||||
from: '百度健康医药馆图标'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -66,7 +66,6 @@ define(
|
||||
}
|
||||
|
||||
|
||||
/* eslint-disable max-depth */
|
||||
function downlistener(e) {
|
||||
var me = this;
|
||||
e.ctrlKey = e.ctrlKey || e.metaKey;
|
||||
@@ -134,7 +133,6 @@ define(
|
||||
}
|
||||
|
||||
}
|
||||
/* eslint-disable max-depth */
|
||||
|
||||
/**
|
||||
* 绑定dom事件
|
||||
|
||||
@@ -48,7 +48,6 @@ define(
|
||||
return path;
|
||||
}
|
||||
|
||||
/* eslint-disable fecs-max-statements, max-params */
|
||||
/**
|
||||
* 获取椭圆弧度
|
||||
*
|
||||
@@ -183,8 +182,6 @@ define(
|
||||
|
||||
return [p0, p1];
|
||||
}
|
||||
/* eslint-enable fecs-max-statements, max-params */
|
||||
|
||||
|
||||
return getArc;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ define(
|
||||
return Math.sqrt(Math.pow(p0.x - p1.x, 2) + Math.pow(p0.y - p1.y, 2));
|
||||
}
|
||||
|
||||
/* eslint-disable fecs-max-statements */
|
||||
|
||||
/* 查找轮廓中的关键点
|
||||
*
|
||||
* @param {Array} contour 轮廓点集合
|
||||
|
||||
@@ -53,7 +53,6 @@ define(
|
||||
return newContour;
|
||||
}
|
||||
|
||||
/* eslint-disable fecs-max-statements */
|
||||
/**
|
||||
* 查找轮廓集合
|
||||
* @param {Object} imageData 二值图像数据
|
||||
|
||||
@@ -417,7 +417,6 @@ define(
|
||||
}
|
||||
|
||||
|
||||
/* eslint-disable max-params */
|
||||
/**
|
||||
* 三次bezier曲线拟合
|
||||
*
|
||||
@@ -505,7 +504,6 @@ define(
|
||||
tHatCenter.y = -tHatCenter.y;
|
||||
fitCubic(points, splitPoint, last, tHatCenter, tHat2, error, result);
|
||||
}
|
||||
/* eslint-enable max-params */
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -90,7 +90,6 @@ define(
|
||||
return offsetArray;
|
||||
}
|
||||
|
||||
/* eslint-disable max-params */
|
||||
|
||||
/**
|
||||
* 在结构数组内赋值
|
||||
@@ -120,7 +119,6 @@ define(
|
||||
return false;
|
||||
}
|
||||
|
||||
/* eslint-enable max-params */
|
||||
|
||||
/**
|
||||
* 是否临近指定的点
|
||||
|
||||
@@ -16,7 +16,6 @@ define(
|
||||
var minus = matrix.minus;
|
||||
var plus = matrix.plus;
|
||||
|
||||
/* eslint-disable fecs-max-statements, max-params */
|
||||
/**
|
||||
* 求两个bezier曲线的交点
|
||||
*
|
||||
@@ -210,7 +209,7 @@ define(
|
||||
|
||||
return false;
|
||||
}
|
||||
/* eslint-enable fecs-max-statements, max-params */
|
||||
|
||||
|
||||
return isBezierCross;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ define(
|
||||
return (p.x * 31 + p.y) * 31;
|
||||
}
|
||||
|
||||
/* eslint-disable max-params */
|
||||
|
||||
/**
|
||||
* 求路径和曲线段的交点集合
|
||||
* @param {Array} path 路径
|
||||
@@ -74,7 +74,7 @@ define(
|
||||
|
||||
return joint.length ? joint : false;
|
||||
}
|
||||
/* eslint-enable max-params */
|
||||
|
||||
|
||||
return getJoint;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
define(
|
||||
function (require) {
|
||||
|
||||
/* eslint-disable max-params */
|
||||
|
||||
/**
|
||||
* 图形仿射矩阵变换
|
||||
*
|
||||
@@ -43,7 +43,7 @@ define(
|
||||
}
|
||||
return contour;
|
||||
}
|
||||
/* eslint-enable max-params */
|
||||
|
||||
|
||||
return transform;
|
||||
}
|
||||
|
||||
@@ -39,14 +39,16 @@ define(function (require) {
|
||||
|
||||
// 判断极端情况,控制点和起止点一样
|
||||
if (p1.x === c1.x && p1.y === c1.y && c2.x === p2.x && c2.y === p2.y) {
|
||||
return [[
|
||||
p1,
|
||||
{
|
||||
x: (p1.x + p2.x) / 2,
|
||||
y: (p1.y + p2.y) / 2
|
||||
},
|
||||
p2
|
||||
]];
|
||||
return [
|
||||
[
|
||||
p1,
|
||||
{
|
||||
x: (p1.x + p2.x) / 2,
|
||||
y: (p1.y + p2.y) / 2
|
||||
},
|
||||
p2
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ define(
|
||||
|
||||
var cubeEquation = require('./cubeEquation');
|
||||
|
||||
/* eslint-disable fecs-max-statements */
|
||||
/**
|
||||
* 求解四次方程
|
||||
*
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
define(
|
||||
function (require) {
|
||||
|
||||
/* eslint-disable fecs-max-statements */
|
||||
/**
|
||||
* 绘制刻度信息
|
||||
*
|
||||
@@ -131,7 +130,6 @@ define(
|
||||
ctx.restore();
|
||||
ctx.stroke();
|
||||
}
|
||||
/* eslint-enable fecs-max-statements */
|
||||
|
||||
|
||||
return drawGraduation;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
define(
|
||||
function (require) {
|
||||
|
||||
/* eslint-disable */
|
||||
return {
|
||||
"version": 1,
|
||||
"numTables": 10,
|
||||
|
||||
@@ -75,7 +75,7 @@ define(function (require) {
|
||||
return contour;
|
||||
}
|
||||
|
||||
/* eslint-disable fecs-max-statements, max-depth */
|
||||
|
||||
/**
|
||||
* svg 命令数组转轮廓
|
||||
*
|
||||
@@ -458,8 +458,6 @@ define(function (require) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* eslint-enable fecs-max-statements, max-depth */
|
||||
/**
|
||||
* svg path转轮廓
|
||||
*
|
||||
|
||||
@@ -143,11 +143,11 @@ define(
|
||||
cff.topDict = topDict;
|
||||
|
||||
// 私有字典数据
|
||||
var privateDictLength = topDict['private'][0];
|
||||
var privateDictLength = topDict.private[0];
|
||||
var privateDict = {};
|
||||
|
||||
if (privateDictLength) {
|
||||
var privateDictOffset = offset + topDict['private'][1];
|
||||
var privateDictOffset = offset + topDict.private[1];
|
||||
privateDict = parseCFFDict.parsePrivateDict(
|
||||
reader,
|
||||
privateDictOffset,
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
define(
|
||||
function (require) {
|
||||
/* eslint-disable no-console */
|
||||
|
||||
var getCFFString = require('./getCFFString');
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
define(
|
||||
function (require) {
|
||||
/* eslint-disable no-console */
|
||||
|
||||
/**
|
||||
* 解析cff encoding数据
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
|
||||
define(
|
||||
function (require) {
|
||||
/* eslint-disable no-console */
|
||||
|
||||
/* eslint-disable fecs-max-statements */
|
||||
/**
|
||||
* 解析cff字形,返回直线和三次bezier曲线点数组
|
||||
* @param {Array} code 操作码
|
||||
|
||||
@@ -6,11 +6,9 @@
|
||||
|
||||
define(
|
||||
function (require) {
|
||||
/* eslint-disable no-console */
|
||||
|
||||
var readWindowsAllCodes = require('../../util/readWindowsAllCodes');
|
||||
|
||||
/* eslint-disable fecs-max-statements */
|
||||
/**
|
||||
* 读取cmap子表
|
||||
*
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
define(
|
||||
function (require) {
|
||||
/* eslint-disable no-console */
|
||||
|
||||
var glyFlag = require('../../enum/glyFlag');
|
||||
var componentFlag = require('../../enum/componentFlag');
|
||||
@@ -14,7 +13,6 @@ define(
|
||||
var MAX_INSTRUCTION_LENGTH = 5000; // 设置instructions阈值防止读取错误
|
||||
var MAX_NUMBER_OF_COORDINATES = 20000; // 设置坐标最大个数阈值,防止glyf读取错误
|
||||
|
||||
/* eslint-disable fecs-max-statements */
|
||||
/**
|
||||
* 读取简单字形
|
||||
*
|
||||
|
||||
@@ -9,7 +9,6 @@ define(
|
||||
|
||||
var glyFlag = require('../../enum/glyFlag');
|
||||
|
||||
/* eslint-disable fecs-max-statements */
|
||||
/**
|
||||
* 获取glyf的大小
|
||||
*
|
||||
|
||||
@@ -8,7 +8,6 @@ define(
|
||||
function (require) {
|
||||
var componentFlag = require('../../enum/componentFlag');
|
||||
|
||||
/* eslint-disable fecs-max-statements */
|
||||
/**
|
||||
* 写glyf
|
||||
* @param {Object} writer 写入器
|
||||
|
||||
@@ -39,7 +39,6 @@ define(
|
||||
]
|
||||
);
|
||||
|
||||
/* eslint-disable fecs-max-statements */
|
||||
/**
|
||||
* ttf格式转换成eot字体格式
|
||||
*
|
||||
@@ -161,7 +160,6 @@ define(
|
||||
|
||||
return eotWriter.getBuffer();
|
||||
}
|
||||
/* eslint-enable fecs-max-statements */
|
||||
|
||||
return ttf2eot;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ define(
|
||||
return xml;
|
||||
}
|
||||
|
||||
/* eslint-disable fecs-max-statements */
|
||||
|
||||
/**
|
||||
* ttf格式转换成woff字体格式
|
||||
*
|
||||
@@ -301,7 +301,6 @@ define(
|
||||
|
||||
return woffWriter.getBuffer();
|
||||
}
|
||||
/* eslint-enable fecs-max-statements */
|
||||
|
||||
return ttf2woff;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ define(function (require) {
|
||||
var pathCeil = require('graphics/pathCeil');
|
||||
var computeBoundingBox = require('graphics/computeBoundingBox');
|
||||
|
||||
/* eslint-disable max-params */
|
||||
|
||||
/**
|
||||
* 简单字形的缩放和平移调整
|
||||
*
|
||||
@@ -97,7 +97,7 @@ define(function (require) {
|
||||
|
||||
return g;
|
||||
}
|
||||
/* eslint-enable max-params */
|
||||
|
||||
|
||||
return glyfAdjust;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user