mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
This commit is contained in:
1 parent
e9d9ba0add
commit
cfcf1939d1
9 files changed
+503
-99
No files matched your search
+2
-9
@@ -204,15 +204,8 @@ func foldText(text string) string {
|
||||
// 入参: obj 文本对象
|
||||
// 返回: *TextRun 文本及待填充的字符区域
|
||||
func (p *PageText) addRun(obj TextObject) *TextRun {
|
||||
var text strings.Builder
|
||||
for _, code := range obj.TextCode {
|
||||
if code.Index == "" {
|
||||
text.WriteString(string(textCodeRunes(code.Value)))
|
||||
} else {
|
||||
text.WriteRune('\uFFFC')
|
||||
}
|
||||
}
|
||||
p.Runs = append(p.Runs, TextRun{ID: obj.ID, Text: text.String(), Boxes: make([]Box, utf8.RuneCountInString(text.String()))})
|
||||
text := obj.Text()
|
||||
p.Runs = append(p.Runs, TextRun{ID: obj.ID, Text: text, Boxes: make([]Box, utf8.RuneCountInString(text))})
|
||||
return &p.Runs[len(p.Runs)-1]
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user