The first issue is one of documentation. It says in <https://godoc.org/golang.org/x/image/font> that:
DrawBytes draws s at the dot and advances the dot's location. But it leaves the question of what exactly those bytes are supposed to represent. Line 132 in <https://github.com/golang/image/blob/master/font/font.go> provides some illumination, but one wonders what the idea is of passing encoded runes as bytes instead of using more direct runes for the purpose. More cryptically, how does one convert a single rune (which I happen to need "measured" in the code I'm working on) to a byte slice for the benefit of DrawBytes' (it's actually MeasureBytes, in my case)? Do I seriously need to find a utf8.RuneEncode function somewhere? The second issue is I'm sure even more due to a lack of understanding on my part. Using the "UbuntuMono-RI.ttf" file I sourced somewhere, I get a "panic: runtime error: index out of range" when executing (specifically for debugging) ``font.MeasureString(instance, "\u2502")'' where "\u2501" and lower seem to work OK. Obviously, such factors as the input from file, the generated "instance" of the font, etc. are factors here. Thing is, I have no idea where to look for this problem. I'd be grateful for any suggestions on how to approach this. It does seem a little strange that the font utilities do not supply some of the more useful details, at least from my search through the documentation, such as the highest valued rune in a font and the like. Of course, fontforge reveals that the given file (I'd better check, I'm not using the same file object) does have characters beyond 0x2501 (9473). Thanks to all. Lucio. -- 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.