simplification

This commit is contained in:
Peter Williams 2018-09-18 12:18:04 +10:00
parent 39a91920e9
commit 19c2f84827

View File

@ -580,17 +580,15 @@ func newTextObject(e *Extractor, gs contentstream.GraphicsState, state *textStat
// renderText emits byte array `data` to the calling program.
func (to *textObject) renderText(data []byte) error {
text := ""
var font *model.PdfFont
if to.fontStack.empty() {
common.Log.Debug("ERROR: No font defined. Using default.")
text = string(data)
font = model.DefaultFont()
} else {
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.numMisses += numMisses
cp := to.getCp()