mirror of
https://gitee.com/Donal/ofd.js.git
synced 2024-11-30 02:48:47 +08:00
字体对应表
This commit is contained in:
parent
78fe22cee0
commit
85731d9380
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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>
|
||||
|
@ -1,6 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import './styles/index.css'
|
||||
Vue.config.productionTip = false
|
||||
|
||||
new Vue({
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user