Skip to content

Commit

Permalink
update read me
Browse files Browse the repository at this point in the history
  • Loading branch information
kekee000 committed Jan 5, 2016
1 parent 9d3760c commit 56c9dee
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,5 @@ sh build.sh
20. 2015-7-19 拆分fonteditor-core模块,以便于开发和维护.

21. 2015-8-9 增加按照unicode排序功能,增加菜单状态.

22. 2016-1-5 增加复合字形编辑和复制功能.
26 changes: 26 additions & 0 deletions src/fonteditor/widget/ttfmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ define(
var History = require('editor/widget/History');
var TTF = require('fonteditor-core/ttf/ttf');
var string = require('fonteditor-core/ttf/util/string');
var transformGlyfContours = require('fonteditor-core/ttf/util/transformGlyfContours');
var compound2simple = require('fonteditor-core/ttf/util/compound2simple');

/**
* 清除glyf编辑状态
Expand Down Expand Up @@ -548,6 +550,30 @@ define(
return this;
};



/**
* 获取复制的glyf对象,这里会将复合字形转换成简单字形,以便于粘贴到其他地方
*
* @param {Array=} indexList 索引列表
* @return {Array} glyflist
*/
Manager.prototype.getCopiedGlyf = function (indexList) {
var list = [];
var ttf = this.ttf.get();
for (var i = 0, l = indexList.length; i < l; ++i) {
var index = indexList[i];
var cloned = lang.clone(ttf.glyf[index]);
if (ttf.glyf[index].compound) {
compound2simple(cloned, transformGlyfContours(ttf.glyf[index], ttf));
}
list.push(cloned);
}
return list;
};



Manager.prototype.clearGlyfTag = clearGlyfTag;

/**
Expand Down

0 comments on commit 56c9dee

Please sign in to comment.