On Thu, Dec 8, 2016 at 3:32 PM, Lucio <lucio.d...@gmail.com> wrote:
>> A text editor widget might expose its text content as a []byte,
>> instead of a []rune, since in the latter representation, the
>> underlying array takes 4x the memory for ASCII text, a common case.
>>
> I would choose to err on the side of intuition by first documenting a
> MeasureRunes function, then add MeasureBytes for the undeniably useful role
> it plays and explain that as an optimisation. Perhaps I can help with that,
> if you feel this would be a positive contribution?

x/image/font/font.go already has a

// TODO: have DrawRunes(s []rune)? DrawRuneReader(io.RuneReader)?? If we take
// io.RuneReader, we can't assume that we can rewind the stream.

comment, but I'm not convinced that it's necessary yet. Using
utf8.EncodeRune should be straightforward, or just convert to string.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to