Skip to content

Commit

Permalink
init fonteditor-core
Browse files Browse the repository at this point in the history
  • Loading branch information
kekee000 committed Jul 19, 2015
0 parents commit bf2a9c2
Show file tree
Hide file tree
Showing 224 changed files with 30,431 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .fecsignore
@@ -0,0 +1,8 @@
src/ttf/data/*
demo/*
node_modules
release
test
edp-build-config.js
edp-build-config-node.js
edp-webserver-config.js
16 changes: 16 additions & 0 deletions .fecsrc
@@ -0,0 +1,16 @@
{
"eslint": {
"env": {
"node": true,
"browser": true
},

"rules": {
"no-console": 0,
"fecs-max-statements": 0,
"max-params": 0,
"max-depth": 0,
"fecs-camelcase": 0
}
}
}
15 changes: 15 additions & 0 deletions .gitignore
@@ -0,0 +1,15 @@
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
*.tmp
.DS_Store
pids
logs
results
release
npm-debug.log
node_modules
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 ecomfe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 15 additions & 0 deletions README.md
@@ -0,0 +1,15 @@
fonteditor ttf相关函数库
==========

提供ttf、woff、eot、svg、otf格式字体的读取、生成和转换

提供ttf字形调整相关函数

提供otf转ttf相关函数

提供svg转字形相关函数


在线编辑器开源项目: [fonteditor](https://github.com/ecomfe/fonteditor)

在线编辑器: [fonteditor](http://font.baidu.com/)
7 changes: 7 additions & 0 deletions build-node.sh
@@ -0,0 +1,7 @@
#!/bin/bash

# ttf 模块node端组件导出程序

edp build --config ./edp-build-config-node.js --force

echo "asset path:../fonteditor-ttf/lib"
54 changes: 54 additions & 0 deletions demo/bezierCubic2Q2.html
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>三次贝塞尔转二次</title>
<script src="http://s1.bdstatic.com/r/www/cache/ecom/esl/2-0-4/esl.js"></script>
<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
<style>
body {
margin: 0;
padding: 0;
}
.point {
position: absolute;
width: 9px;
height: 9px;
margin-left: -5px;
margin-top: -5px;
border: 1px solid red;
}

#start-point {
border-color: green;
}

#end-point {
border-color: black;
}

#control-point {
border-color: blue;
}

</style>
</head>
<body>
<div id="start-point" class="point" data-index="0"></div>
<div id="end-point" class="point" data-index="1"></div>
<div id="control-point" class="point" data-index="2"></div>
<div class="point" data-index="3"></div>
<canvas id="canvas" width="800" height="800"></canvas>
<script>
require.config({
baseUrl: '../src',
paths: {
demo: '../demo/js',
}
});
define('jquery', $);
</script>

<script>require(['demo/bezierCubic2Q2'])</script>
</body>
</html>
255 changes: 255 additions & 0 deletions demo/css/editor.css
@@ -0,0 +1,255 @@
* {
margin: 0;
padding: 0;
}
ul {
list-style: none;
}
a {
color: #03C;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.hide {
display: none;
}
@font-face {
font-family: 'fonteditor';
src: url('../font/fonteditor.ttf') format('truetype');
}
.ico {
display: inline-block;
}
.ico:before,
.ico:after {
font-family: 'fonteditor';
font-style: normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.1px;
}
.i-leave:before {
content: '\e00c';
}
.i-edit,
.i-del,
.i-leave {
font-size: 12px;
}
.i-edit:hover,
.i-del:hover,
.i-leave:hover {
cursor: pointer;
color: #4A90E2;
}
.i-edit,
.i-del {
color: #76abe9;
}
.i-edit:before {
content: '\e021';
}
.i-del:before {
content: '\e020';
}
.i-github:before {
content: '\e01e';
}
.i-help:before {
content: '\e016';
}
.i-new:before {
content: '\e019';
}
.i-open:before {
content: '\e01A';
}
.i-add:before {
content: '\e003';
}
.i-undo:before {
content: '\e001';
}
.i-redo:before {
content: '\e002';
}
.i-down:before {
content: '\e00e';
}
.i-left:before {
content: '\e00a';
}
.i-ttf:before {
content: '\e00f';
}
.i-woff:before {
content: '\e010';
}
.i-zip:before {
content: '\e011';
}
.i-save:before {
content: '\e022';
}
.i-upshape:before {
content: '\e014';
}
.i-downshape:before {
content: '\e00b';
}
.i-reversepoints:before {
content: '\e00d';
}
.i-alignleft:before {
content: '\e006';
}
.i-aligncenter:before {
content: '\e004';
}
.i-alignright:before {
content: '\e007';
}
.i-aligntop:before {
content: '\e008';
}
.i-alignmiddle:before {
content: '\e005';
}
.i-aligndescent:before {
content: '\e009';
}
.i-alignbaseline:before {
content: '\e009';
}
.i-rotateleft:before {
content: '\e01c';
}
.i-rotateright:before {
content: '\e01d';
}
.i-flip:before {
content: '\e013';
}
.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';
}
.i-rangemode:before {
content: '\e029';
}
.i-pointmode:before {
content: '\e028';
}
.glyf-editor {
width: 100%;
height: 100%;
font-size: 12px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
display: none;
}
.glyf-editor .marker-x,
.glyf-editor .marker-y {
position: absolute;
width: 0;
height: 0;
z-index: 60;
pointer-events: none;
}
.glyf-editor .marker-x {
width: 20px;
border-top: 1px dashed #000;
}
.glyf-editor .marker-y {
height: 20px;
border-left: 1px dashed #000;
}
.editor-contextmenu {
color: #333;
width: 150px;
border: 1px solid #999;
background: #FEFEFE;
line-height: 24px;
padding: 0 4px;
box-shadow: 1px 1px 1px #CCC;
position: absolute;
}
.editor-contextmenu li {
padding-left: 4px;
cursor: pointer;
border-bottom: 1px solid #CCC;
}
.editor-contextmenu li > ul {
display: none;
color: #333;
width: 150px;
border: 1px solid #999;
background: #FEFEFE;
line-height: 24px;
padding: 0 4px;
box-shadow: 1px 1px 1px #CCC;
position: absolute;
margin-left: 130px;
}
.editor-contextmenu > li[data-sub] {
color: #4A90E2;
}
.editor-contextmenu > li[data-sub]:after {
content: '>';
margin-right: 10px;
float: right;
font-family: 'Simsun';
}
.editor-contextmenu li[data-tag="selected"] {
display: inline-block;
display: block;
}
.editor-contextmenu li[data-tag="selected"]:before,
.editor-contextmenu li[data-tag="selected"]:after {
font-family: 'fonteditor';
font-style: normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.1px;
}
.editor-contextmenu li[data-tag="selected"]:after {
content: '\e01f';
}
.editor-contextmenu li[data-tag="selected"]:after {
float: right;
margin-right: 4px;
color: #4A90E2;
}
.editor-contextmenu li:hover {
background: #EEE;
}
.editor-contextmenu li:hover > ul {
display: block;
}
.editor-contextmenu li:last-child {
border-bottom: none;
}
body,
html {
height: 100%;
}
#render-view {
font-size: 12px;
width: 100%;
height: 100%;
position: relative;
-webkit-text-size-adjust: none;
display: block;
}

0 comments on commit bf2a9c2

Please sign in to comment.