Commit 2f652379 authored by 罗超's avatar 罗超

优化字体解析

parent 6f4f0bab
...@@ -116,12 +116,14 @@ export const ResolveText = (item: any, index: number,offsetLeft:number,offsetTop ...@@ -116,12 +116,14 @@ export const ResolveText = (item: any, index: number,offsetLeft:number,offsetTop
domLeft -= 10 //+((leading-1)*fontSize/2) domLeft -= 10 //+((leading-1)*fontSize/2)
let fontName = names.filter((x:any)=>x.indexOf('Adobe')==-1) let fontName = names.filter((x:any)=>x.indexOf('Adobe')==-1)
console.log(fontName)
if(fontName && fontName.length>0){ if(fontName && fontName.length>0){
for (let i = 0; i < fontName.length; i++) { for (let i = 0; i < fontName.length; i++) {
let x = fontName[i]; let x = fontName[i];
if(/^\d+/.test(x)){ if(/^\d+/.test(x)){
x=x.replace(/[0-9]/ig,"") //x=x.replace(/[0-9]/ig,"")
x=x.replace('-','') x='aa'+x
x=x.replaceAll('-','')
} }
fontName[i]=x fontName[i]=x
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment