fix svg small size import

This commit is contained in:
kekee000 2015-05-03 09:33:21 +08:00
parent f77ce9a8ef
commit 27a0bb9e66
3 changed files with 5 additions and 6 deletions

View File

@ -18,8 +18,9 @@ define(
//var text = 'M269.5,102V36.3c0-8,10-15.2,18-15.2s16.6,7.2,16.6,15.2v45.9h22.5V36.3C326.5,17.4,309.799,0,291,0 c-30.1,0-42.6,17.4-42.6,36.3v67.2c-29.701,5.7-54.602,26.1-67.701,52.3 -11.4-23-32-41.4-56.8-49.5v-70C123.8,17.4,111.3,0,81.2,0 C62.4,0,45.6,17.4,45.6,36.3v45.9h22.5V36.3c0-8,8.601-15.2,16.601-15.2s18,7.2,18,15.2v65.9c-2.2-0.2-4.5-0.3-6.8-0.3 C43.8,101.9,0,145.7,0,197.8c0,52.1,43.8,94.5,95.9,94.5h169.399c52.102,0,95.9-42.4,95.9-94.5 C361.299,147.1,319.799,104.2,269.5,102z M265.299,269.8H95.9c-41.301,0-73.4-30.801-73.4-72c0-41.3,32.2-74.1,73.4-74.1 c41.3,0,74.8,32.899,74.8,74.1h19.701c0-41.3,33.6-74.1,74.799-74.1c41.301,0,73.4,32.899,73.4,74.1 C338.7,239.099,306.6,269.8,265.299,269.8z M90.6,326.3h180.5v-11.6H90.6V326.3z'
//var text = 'M216.501,199.847c-11.442,0-21.956,3.891-30.38,10.367l-86.92-52.15c0.436-2.668,0.722-5.389,0.722-8.178c0-2.793-0.286-5.509-0.722-8.177l86.92-52.153c8.424,6.478,18.938,10.368,30.38,10.368c27.589,0,49.962-22.372,49.962-49.962 C266.463,22.372,244.09,0,216.501,0c-27.59,0-49.961,22.372-49.961,49.961c0,2.792,0.286,5.511,0.728,8.178L80.349,110.29 c-8.425-6.476-18.941-10.367-30.387-10.367C22.372,99.923,0,122.295,0,149.886c0,27.59,22.372,49.961,49.962,49.961 c11.446,0,21.962-3.891,30.387-10.365l86.918,52.15c-0.441,2.666-0.728,5.383-0.728,8.178c0,27.588,22.371,49.961,49.961,49.961 c27.589,0,49.962-22.373,49.962-49.961C266.463,222.22,244.09,199.847,216.501,199.847Z'
//var text = 'M300,200 h-150 a150,150 0 1,0 150,-150 z';
var text = 'M832 1024c-35.36 0-64-28.672-64-64 0 0 0-896.032 0-896.032 0-35.328 28.64-64 64-64 35.328 0 64 28.672 64 64 0 0 0 896.032 0 896.032 0 35.328-28.672 64-64 64z'
//var text = 'M832 1024c-35.36 0-64-28.672-64-64 0 0 0-896.032 0-896.032 0-35.328 28.64-64 64-64 35.328 0 64 28.672 64 64 0 0 0 896.032 0 896.032 0 35.328-28.672 64-64 64z'
//var text = 'M647.5,1053.563c-35.36,0-64-28.672-64-64V93.532c0-35.328,28.64-64,64-64c35.327,0,64,28.672,64,64v896.031C711.5,1024.892,682.827,1053.563,647.5,1053.563z M64,1024.032c-35.36,0-64-28.672-64-64V64C0,28.672,28.64,0,64,0c35.328,0,64,28.672,64,64v896.032C128,995.36,99.328,1024.032,64,1024.032z'
var text = 'M8.376,4.84 L6,4.84 L6,4 L11.76,4 L11.76,4.84 L9.384,4.84 L9.384,11.872 L8.376,11.872 L8.376,4.84 Z M14.808,4.84 L12.432,4.84 L12.432,4 L18.192,4 L18.192,4.84 L15.816,4.84 L15.816,11.872 L14.808,11.872 L14.808,4.84 Z M19.608,4 L24.144,4 L24.144,4.84 L20.604,4.84 L20.604,7.504 L23.604,7.504 L23.604,8.344 L20.604,8.344 L20.604,11.872 L19.608,11.872 L19.608,4 Z'
var entry = {
/**

View File

@ -453,9 +453,7 @@ define(function (require) {
}
}
return contours.map(function (p) {
return reducePath(p);
});
return contours;
}
/**

View File

@ -113,8 +113,8 @@ define(
if (ttf.from === 'svgfont' && ttf.head.unitsPerEm > 128) {
ttf.glyf.forEach(function (g) {
if (g.contours) {
reduceGlyf(g);
glyfAdjust(g);
reduceGlyf(g);
}
});
}
@ -127,7 +127,6 @@ define(
ttf.glyf.forEach(function (g) {
if (g.contours) {
reduceGlyf(g);
var bound = computeBoundingBox.computePathBox.apply(null, g.contours);
if (bound) {
xMin = Math.min(xMin, bound.x);
@ -143,6 +142,7 @@ define(
ttf.glyf.forEach(function (g) {
glyfAdjust(g, scale, scale);
reduceGlyf(g);
});
ttf.head.unitsPerEm = 1024;
}