From ae63d5d566065c97ac339d045f06c2da5ebd66df Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Thu, 8 Dec 2016 12:05:43 +1100 Subject: [PATCH] font: add some comments for the XxxBytes methods. Change-Id: I391b539e79d7e35f80d9ee0b8c7c70c2f42e2e99 Reviewed-on: https://go-review.googlesource.com/34095 Reviewed-by: Dave Day --- font/font.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/font/font.go b/font/font.go index a0a66d2..36a1638 100644 --- a/font/font.go +++ b/font/font.go @@ -126,6 +126,8 @@ type Drawer struct { // vertical line? Should DrawString return the number of runes drawn? // DrawBytes draws s at the dot and advances the dot's location. +// +// It is equivalent to DrawString(string(s)) but may be more efficient. func (d *Drawer) DrawBytes(s []byte) { prevC := rune(-1) for len(s) > 0 { @@ -168,6 +170,8 @@ func (d *Drawer) DrawString(s string) { } // MeasureBytes returns how far dot would advance by drawing s. +// +// It is equivalent to MeasureString(string(s)) but may be more efficient. func (d *Drawer) MeasureBytes(s []byte) (advance fixed.Int26_6) { return MeasureBytes(d.Face, s) } @@ -178,6 +182,8 @@ func (d *Drawer) MeasureString(s string) (advance fixed.Int26_6) { } // MeasureBytes returns how far dot would advance by drawing s with f. +// +// It is equivalent to MeasureString(string(s)) but may be more efficient. func MeasureBytes(f Face, s []byte) (advance fixed.Int26_6) { prevC := rune(-1) for len(s) > 0 {