diff --git a/css/common/bootstrap.less b/css/common/bootstrap.less index c253a3e..47e744c 100644 --- a/css/common/bootstrap.less +++ b/css/common/bootstrap.less @@ -202,4 +202,22 @@ hr { background: lighten(#707781, 15%); pointer-events: none; } +} + +@media screen and (min-width:1200px) and (max-width:1400px){ + .command-groups { + >li, + >li[data-theme="ico"] { + padding: 0 8px; + } + } +} + +@media screen and (max-width:1200px){ + .command-groups { + >li, + >li[data-theme="ico"] { + padding: 0 4px; + } + } } \ No newline at end of file diff --git a/css/common/ico.less b/css/common/ico.less index 8deb738..c798588 100644 --- a/css/common/ico.less +++ b/css/common/ico.less @@ -162,4 +162,20 @@ .i-mirror { .i-ico('\e012'); +} + +.i-splitshapes { + .i-ico('\e024'); +} + +.i-joinshapes { + .i-ico('\e025'); +} + +.i-intersectshapes { + .i-ico('\e026'); +} + +.i-tangencyshapes { + .i-ico('\e027'); } \ No newline at end of file diff --git a/demo/css/editor.css b/demo/css/editor.css index c7df596..2bd7cd2 100644 --- a/demo/css/editor.css +++ b/demo/css/editor.css @@ -127,6 +127,18 @@ a:hover { .i-mirror:before { content: '\e012'; } +.i-splitshapes:before { + content: '\e024'; +} +.i-joinshapes:before { + content: '\e025'; +} +.i-intersectshapes:before { + content: '\e026'; +} +.i-tangencyshapes:before { + content: '\e027'; +} .glyf-editor { width: 100%; height: 100%; diff --git a/font/fonteditor.eot b/font/fonteditor.eot index daacee5..61073fd 100644 Binary files a/font/fonteditor.eot and b/font/fonteditor.eot differ diff --git a/font/fonteditor.svg b/font/fonteditor.svg index ad886db..01af982 100644 --- a/font/fonteditor.svg +++ b/font/fonteditor.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/font/fonteditor.ttf b/font/fonteditor.ttf index e8e0371..3d90fb3 100644 Binary files a/font/fonteditor.ttf and b/font/fonteditor.ttf differ diff --git a/font/fonteditor.woff b/font/fonteditor.woff index afc3084..75d2b24 100644 Binary files a/font/fonteditor.woff and b/font/fonteditor.woff differ diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 9c51bde..efddd24 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -255,8 +255,10 @@ define( this.graduationMarker.dispose(); this.options = this.contextMenu = this.render = null; - this.fontLayer = this.coverLayer = this.axisLayer = this.graduationLayer = null; - this.axis = this.rightSideBearing = this.graduation = this.graduationMarker = this.font = null; + this.fontLayer = this.coverLayer = this.axisLayer + = this.referenceLineLayer = this.graduationLayer = null; + this.axis = this.rightSideBearing = this.graduation + = this.graduationMarker = this.font = null; this.sorption.dispose(); this.sorption = null; diff --git a/src/fonteditor/widget/glyfeditor.js b/src/fonteditor/widget/glyfeditor.js index 5fb8ab8..1a78be0 100644 --- a/src/fonteditor/widget/glyfeditor.js +++ b/src/fonteditor/widget/glyfeditor.js @@ -25,6 +25,9 @@ define( 'horizontalalignshapes', 'verticalalignshapes', 'rotateleft', 'rotateright', 'flipshapes', 'mirrorshapes' ], + shapes2: [ + 'joinshapes', 'intersectshapes', 'tangencyshapes' + ], // 单个形状 shape: ['upshape', 'downshape', 'reversepoints'] }; @@ -72,20 +75,32 @@ define( var length = e.shapes ? e.shapes.length : 0; if (!length) { commandMenu.disableCommands(COMMAND_SUPPORT.shapes); + commandMenu.disableCommands(COMMAND_SUPPORT.shapes2); commandMenu.disableCommands(COMMAND_SUPPORT.shape); } else { commandMenu.enableCommands(COMMAND_SUPPORT.shapes); + commandMenu[length >= 2 ? 'enableCommands' : 'disableCommands'](COMMAND_SUPPORT.shapes2); commandMenu[length === 1 ? 'enableCommands' : 'disableCommands'](COMMAND_SUPPORT.shape); } }), 100); commandMenu.on('command', function(e) { + // 这里延时进行focus + setTimeout(function() { + me.focus(); + }, 20); + var command = e.command; var args = e.args; var shapes; + if (command === 'splitshapes') { + editor.setMode('split'); + return; + } + if (command === 'pasteshapes') { shapes = editor.getClipBoard(); } @@ -116,6 +131,9 @@ define( case 'copyshapes': case 'removeshapes': case 'reversepoints': + case 'joinshapes': + case 'intersectshapes': + case 'tangencyshapes': editor.execCommand(command, shapes); break; @@ -127,10 +145,6 @@ define( } } - // 这里延时进行focus - setTimeout(function() { - me.focus(); - }, 20); }); } diff --git a/src/fonteditor/widget/menu/editor.js b/src/fonteditor/widget/menu/editor.js index cdc185c..03d2187 100644 --- a/src/fonteditor/widget/menu/editor.js +++ b/src/fonteditor/widget/menu/editor.js @@ -126,7 +126,33 @@ define( title: '镜像', ico: 'mirror', disabled: true - } + }, + { + type: 'split' + }, + { + name: 'splitshapes', + title: '切割轮廓', + ico: 'splitshapes' + }, + { + name: 'joinshapes', + title: '合并轮廓', + ico: 'joinshapes', + disabled: true + }, + { + name: 'intersectshapes', + title: '相交轮廓', + ico: 'intersectshapes', + disabled: true + }, + { + name: 'tangencyshapes', + title: '相切轮廓', + ico: 'tangencyshapes', + disabled: true + }, ]; } );