mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
This commit is contained in:
1 parent
bcb9f98f8b
commit
3959664448
52 files changed
+1864
-407
No files matched your search
+2
-2
@@ -1161,7 +1161,7 @@ func (e *Editor) prepareText(obj *TextObject) error {
|
||||
}
|
||||
code.Value = escapeOFDText(string(runes))
|
||||
}
|
||||
if strings.Trim(obj.Text(), "\n") == "" {
|
||||
if position == 0 {
|
||||
return fmt.Errorf("text codes are empty")
|
||||
}
|
||||
return missingGlyphError(obj.Font, missing)
|
||||
@@ -1296,7 +1296,7 @@ func ofdNumber(value float64) string {
|
||||
func escapeOFDText(value string) string {
|
||||
var text strings.Builder
|
||||
for _, char := range value {
|
||||
if char < ' ' || char == '\\' || char == '\ufffe' || char == '\uffff' {
|
||||
if char <= ' ' || char == '\\' || char == '\ufffe' || char == '\uffff' {
|
||||
fmt.Fprintf(&text, "\\%04X", char)
|
||||
} else {
|
||||
text.WriteRune(char)
|
||||
|
||||
Reference in new issue
Block a user