字体对应表

This commit is contained in:
Donal 2020-09-11 15:56:27 +08:00
parent 78fe22cee0
commit 85731d9380
8 changed files with 21 additions and 30 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -17,7 +17,7 @@
import JsZip from 'jszip'
import {Jbig2Image} from '../utils/jbig2'
import {pipeline} from "../utils/pipeline"
import {getExtensionByPath, replaceFirstSlash, converterDpi, convertPathAbbreviatedDatatoPoint, calPathPoint, calTextPoint} from "../utils/ofd_util"
import {getFontFamily, getExtensionByPath, replaceFirstSlash, converterDpi, convertPathAbbreviatedDatatoPoint, calPathPoint, calTextPoint} from "../utils/ofd_util"
let parser = require('fast-xml-parser');
import ASN1 from '@lapo/asn1js';
import Base64 from '@lapo/asn1js/base64';
@ -221,7 +221,7 @@ export default {
}
text.setAttribute('fill', defaultStrokeColor);
text.setAttribute('fill', defaultFillColor);
text.setAttribute('style', `font-size:${size}px;font-family: ${this.fontResObj[font]};`)
text.setAttribute('style', `font-size:${size}px;font-family: ${getFontFamily(this.fontResObj[font])};`)
svg.appendChild(text);
}
@ -689,12 +689,16 @@ export default {
font-weight: 500;
font-size: 1rem;
color: white;
font-family: "楷体";
font-family: "Kai, KaiTi";
}
.mycanvas {
border: 1px solid rgb(199, 198, 198);
}
.hidden{
display: none !important;
}
</style>

View File

@ -1,6 +1,5 @@
import Vue from 'vue'
import App from './App.vue'
import './styles/index.css'
Vue.config.productionTip = false
new Vue({

View File

@ -1,28 +1,2 @@
@font-face {
font-family: "Courier New";
src: url("../assets/cour.ttf");
}
@font-face {
font-family: "黑体";
src: url("../assets/simhei.ttf");
}
@font-face {
font-family: "楷体";
src: url("../assets/simkai.ttf");
}
@font-face {
font-family: "KaiTi";
src: url("../assets/simkai.ttf");
}
@font-face {
font-family: "宋体";
src: url("../assets/simsun.ttf");
}
.hidden{
display: none !important;
}

View File

@ -194,4 +194,18 @@ export const decodeHtml = function(s){
});
};
let FONT_FAMILY = {
'楷体': '楷体, KaiTi, Kai',
'KaiTi': '楷体, KaiTi, Kai',
'Kai': '楷体, KaiTi, Kai',
'宋体': 'SimSun, Songti SC',
};
export const getFontFamily = function (font) {
if (FONT_FAMILY[font]) {
font = FONT_FAMILY[font];
}
return font;
}