2017-07-05 23:10:57 +00:00
|
|
|
/*
|
|
|
|
* This file is subject to the terms and conditions defined in
|
|
|
|
* file 'LICENSE.md', which is part of this source code package.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package textencoding
|
|
|
|
|
|
|
|
import "github.com/unidoc/unidoc/pdf/core"
|
|
|
|
|
|
|
|
type TextEncoder interface {
|
2017-09-01 13:20:51 +00:00
|
|
|
// Convert a raw utf8 string (series of runes) to an encoded string (series of bytes) to be used in PDF.
|
2017-07-05 23:10:57 +00:00
|
|
|
Encode(raw string) string
|
2017-07-10 15:17:46 +00:00
|
|
|
|
|
|
|
// Conversion between character code and glyph name.
|
|
|
|
// The bool return flag is true if there was a match, and false otherwise.
|
2017-09-01 13:20:51 +00:00
|
|
|
CharcodeToGlyph(code uint16) (string, bool)
|
2017-07-10 15:17:46 +00:00
|
|
|
|
|
|
|
// Conversion between glyph name and character code.
|
|
|
|
// The bool return flag is true if there was a match, and false otherwise.
|
2017-09-01 13:20:51 +00:00
|
|
|
GlyphToCharcode(glyph string) (uint16, bool)
|
2017-07-10 15:17:46 +00:00
|
|
|
|
|
|
|
// Convert rune to character code.
|
|
|
|
// The bool return flag is true if there was a match, and false otherwise.
|
2017-09-01 13:20:51 +00:00
|
|
|
RuneToCharcode(val rune) (uint16, bool)
|
2017-07-10 15:17:46 +00:00
|
|
|
|
|
|
|
// Convert character code to rune.
|
|
|
|
// The bool return flag is true if there was a match, and false otherwise.
|
2017-09-01 13:20:51 +00:00
|
|
|
CharcodeToRune(charcode uint16) (rune, bool)
|
2017-07-10 15:17:46 +00:00
|
|
|
|
|
|
|
// Convert rune to glyph name.
|
|
|
|
// The bool return flag is true if there was a match, and false otherwise.
|
|
|
|
RuneToGlyph(val rune) (string, bool)
|
|
|
|
|
|
|
|
// Convert glyph to rune.
|
|
|
|
// The bool return flag is true if there was a match, and false otherwise.
|
|
|
|
GlyphToRune(glyph string) (rune, bool)
|
|
|
|
|
2017-07-05 23:10:57 +00:00
|
|
|
ToPdfObject() core.PdfObject
|
|
|
|
}
|