Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function readeot() {
ajaxFile({
type: 'binary',
url: './test/fonteditor.eot',
onSuccess(buffer) {
let ttfBuffer = eot2ttf(buffer);
let ttfReader = new TTFReader();
let ttfData = ttfReader.read(ttfBuffer);
let base64str = ttf2base64(ttfBuffer);
setFont(base64str);
showTTFGlyf(ttfData);
},
onError() {
console.error('error read file');
}
function write() {
ajaxFile({
type: 'binary',
url: 'test/fonteditor.woff',
onSuccess(buffer) {
let ttfBuffer = woff2ttf(buffer, {
inflate
});
let saveBtn = $('.saveas');
saveBtn.attr('href', ttf2base64(ttfBuffer));
saveBtn.attr('download', 'save.woff');
let ttfReader = new TTFReader();
let ttfData = ttfReader.read(ttfBuffer);
console.log(ttfData);
},
onError() {
function write() {
ajaxFile({
type: 'binary',
url: './test/fonteditor.ttf',
onSuccess(buffer) {
let woffBuffer = ttf2woff(buffer, ttf2woffoptions);
let base64str = woff2base64(woffBuffer);
setFont(base64str);
let saveBtn = $('.saveas');
saveBtn.attr('href', base64str);
saveBtn.attr('download', 'save.woff');
function write() {
ajaxFile({
type: 'binary',
url: './test/fonteditor.ttf',
onSuccess(buffer) {
let svgBuffer = ttf2svg(buffer, {
metadata: 'fonteditor V0.1'
});
let base64str = svg2base64(svgBuffer);
setFont(base64str);
let saveBtn = $('.saveas');
saveBtn.attr('href', base64str);
saveBtn.attr('download', 'save.svg');