mirror of
https://github.com/unidoc/unipdf.git
synced 2025-04-29 13:48:54 +08:00
simplification
This commit is contained in:
parent
39a91920e9
commit
19c2f84827
@ -580,17 +580,15 @@ func newTextObject(e *Extractor, gs contentstream.GraphicsState, state *textStat
|
|||||||
|
|
||||||
// renderText emits byte array `data` to the calling program.
|
// renderText emits byte array `data` to the calling program.
|
||||||
func (to *textObject) renderText(data []byte) error {
|
func (to *textObject) renderText(data []byte) error {
|
||||||
text := ""
|
|
||||||
var font *model.PdfFont
|
var font *model.PdfFont
|
||||||
if to.fontStack.empty() {
|
if to.fontStack.empty() {
|
||||||
common.Log.Debug("ERROR: No font defined. Using default.")
|
common.Log.Debug("ERROR: No font defined. Using default.")
|
||||||
text = string(data)
|
|
||||||
font = model.DefaultFont()
|
font = model.DefaultFont()
|
||||||
} else {
|
} else {
|
||||||
font = to.fontStack.peek()
|
font = to.fontStack.peek()
|
||||||
}
|
}
|
||||||
var numChars, numMisses int
|
|
||||||
text, numChars, numMisses = font.CharcodeBytesToUnicode(data)
|
text, numChars, numMisses := font.CharcodeBytesToUnicode(data)
|
||||||
to.State.numChars += numChars
|
to.State.numChars += numChars
|
||||||
to.State.numMisses += numMisses
|
to.State.numMisses += numMisses
|
||||||
cp := to.getCp()
|
cp := to.getCp()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user