add Text.WriteByte

This commit is contained in:
faiface 2017-05-03 23:55:10 +02:00
parent 0d3fd03a40
commit e112598b5c
1 changed files with 5 additions and 0 deletions

View File

@ -141,6 +141,11 @@ func (txt *Text) WriteString(s string) (n int, err error) {
return len(s), nil
}
func (txt *Text) WriteByte(c byte) error {
_, err := txt.WriteRune(rune(c))
return err
}
func (txt *Text) WriteRune(r rune) (n int, err error) {
n, err = utf8.RuneLen(r), nil // always returns this