mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 01:27:26 +08:00
1 parent
28175723e6
commit
32585c6343
46 files changed
+84
-168
No files matched your search
@@ -20,6 +20,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// 字体匹配按精确、部分和模糊匹配排列,零值表示未匹配
|
||||
const (
|
||||
fontMatchNone = iota
|
||||
fontMatchExact
|
||||
@@ -27,6 +28,7 @@ const (
|
||||
fontMatchFuzzy
|
||||
)
|
||||
|
||||
// fontMatchRules 保存常用字体的名称、文件名及系统字体匹配规则
|
||||
var fontMatchRules = normalizeFontMatchRules([]fontMatchRule{
|
||||
{
|
||||
Keys: []string{"小标宋", "方正小标宋", "xiaobiaosong", "fzxiaobiaosong", "fzxbs"},
|
||||
@@ -103,6 +105,7 @@ var fontMatchRules = normalizeFontMatchRules([]fontMatchRule{
|
||||
},
|
||||
})
|
||||
|
||||
// fontNameReplacer 移除字体名称匹配时忽略的分隔符
|
||||
var fontNameReplacer = strings.NewReplacer(" ", "", "-", "", "_", "", "(", "", ")", "", "(", "", ")", "")
|
||||
|
||||
// fontMatchRule 字体匹配规则
|
||||
|
||||
Reference in new issue
Block a user