add font adjust
This commit is contained in:
@@ -26,6 +26,14 @@
|
||||
<option value="1024">1024</option>
|
||||
<option value="2048">2048</option>
|
||||
</select>
|
||||
<select id="editor-bearing">
|
||||
<option value="1">左支撑10, 右支撑10</option>
|
||||
<option value="2">左支撑100, 右支撑100</option>
|
||||
</select>
|
||||
<div id="glyf-list" class="glyf-list"></div>
|
||||
</div>
|
||||
|
||||
<div class="pan-left">
|
||||
<div id="glyf-list" class="glyf-list"></div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -35,10 +35,18 @@ define(
|
||||
|
||||
currentEditor = editor.create($('#render-view').get(0));
|
||||
|
||||
currentEditor.on('save', function(e) {
|
||||
var font = e.font;
|
||||
console.log(font);
|
||||
ttfObject.glyf[font.index] = font;
|
||||
});
|
||||
|
||||
$('#glyf-list').delegate('[data-index]', 'click', function(e) {
|
||||
e.preventDefault();
|
||||
var index = +$(this).attr('data-index');
|
||||
currentEditor.setFont(lang.clone(ttfObject.glyf[index]));
|
||||
var font = lang.clone(ttfObject.glyf[index]);
|
||||
font.index = index;
|
||||
currentEditor.setFont(font);
|
||||
});
|
||||
|
||||
$('#editor-unitsperem').on('change', function(){
|
||||
@@ -46,7 +54,25 @@ define(
|
||||
currentEditor.setAxis({
|
||||
unitsPerEm: unitsPerEm
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
$('#editor-bearing').on('change', function(){
|
||||
var opt = $(this).val();
|
||||
|
||||
var setting = {
|
||||
1 : {
|
||||
leftSideBearing: 10,
|
||||
rightSideBearing: 10
|
||||
},
|
||||
2: {
|
||||
leftSideBearing: 100,
|
||||
rightSideBearing: 100
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
currentEditor.adjustFont(setting[opt]);
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user