--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
People don't use Lucida Sans when writing code in Go
Oh really? Sorry. I rephrase "most people".
I disagree. You usually use your language in string constants that are supposed to be read by human. In particular if you don't speak other language that's the only thing you can do.
--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
It's not a goal of this proposal to make gofmt work with proportional fonts or characters whose width is not multiples of the fixed-width character.The coding environment that Courier, whose character size is 3/5 of a full-width character, is used with a fixed-width CJK font is hypothetical -- it's a bad combination of fixed-width and proportional. Most programmers are (still) using editors on which a full-width characters are rendered as double-width of a fixed-width Latin character. I strongly believe this proposal fix the actual problem.
The Unicode standard does not say that the full-width character is 5/3x. I don't understand why you think it's the requirement of a standard. It says Latin fonts like Courier is 3/5x. It doesn't mean Latin characters in other fonts has to be 5/3x, either.
When displaying data, (my interpretation of) the Recommendations are1. Wide characters (such as Chinese characters) take up 1 em in fixed-pitch fonts2. Half-width characters (such as half-width katakanas) take up 1/2 em in fixed-pitch fonts3. Narrow characters (which includes Latin/ASCII charset as defined in the #11 table) takes up 1/2 em in East Asian fixed-pitch fonts
On Tue, Jun 24, 2014 at 3:33 PM, Rui Ueyama <ru...@google.com> wrote:When displaying data, (my interpretation of) the Recommendations are1. Wide characters (such as Chinese characters) take up 1 em in fixed-pitch fonts2. Half-width characters (such as half-width katakanas) take up 1/2 em in fixed-pitch fonts3. Narrow characters (which includes Latin/ASCII charset as defined in the #11 table) takes up 1/2 em in East Asian fixed-pitch fonts#3 is limits itself to East Asian fixed-pitch fonts. But "most programmers" are using Latin fixed-pitch fonts capable of displaying East Asian characters. And many of those fonts (like the ones Marcel described) do not follow the 2x rule (a fact mentioned on the same page and already discussed here).
If there were any change to godoc, I could imagine something less controversial might be to say if any line in a literal like this contains wide characters, just give up on lining things up and use a single space after the colon instead.
On Tue, Jun 24, 2014 at 3:33 PM, Rui Ueyama <ru...@google.com> wrote:
When displaying data, (my interpretation of) the Recommendations are1. Wide characters (such as Chinese characters) take up 1 em in fixed-pitch fonts2. Half-width characters (such as half-width katakanas) take up 1/2 em in fixed-pitch fonts3. Narrow characters (which includes Latin/ASCII charset as defined in the #11 table) takes up 1/2 em in East Asian fixed-pitch fonts#3 is limits itself to East Asian fixed-pitch fonts. But "most programmers" are using Latin fixed-pitch fonts capable of displaying East Asian characters. And many of those fonts (like the ones Marcel described) do not follow the 2x rule (a fact mentioned on the same page and already discussed here).
On Tue, Jun 24, 2014 at 3:33 PM, Rui Ueyama <ru...@google.com> wrote:When displaying data, (my interpretation of) the Recommendations are1. Wide characters (such as Chinese characters) take up 1 em in fixed-pitch fonts2. Half-width characters (such as half-width katakanas) take up 1/2 em in fixed-pitch fonts3. Narrow characters (which includes Latin/ASCII charset as defined in the #11 table) takes up 1/2 em in East Asian fixed-pitch fonts#3 is limits itself to East Asian fixed-pitch fonts. But "most programmers" are using Latin fixed-pitch fonts capable of displaying East Asian characters. And many of those fonts (like the ones Marcel described) do not follow the 2x rule (a fact mentioned on the same page and already discussed here).
My point is that I don't see TR11 justifying this change, which makes it more of an ad-hoc "fixes my editor settings" change.
Russ
On Tue, Jun 24, 2014 at 1:15 PM, Russ Cox <r...@golang.org> wrote:
On Tue, Jun 24, 2014 at 3:33 PM, Rui Ueyama <ru...@google.com> wrote:When displaying data, (my interpretation of) the Recommendations are1. Wide characters (such as Chinese characters) take up 1 em in fixed-pitch fonts2. Half-width characters (such as half-width katakanas) take up 1/2 em in fixed-pitch fonts3. Narrow characters (which includes Latin/ASCII charset as defined in the #11 table) takes up 1/2 em in East Asian fixed-pitch fonts#3 is limits itself to East Asian fixed-pitch fonts. But "most programmers" are using Latin fixed-pitch fonts capable of displaying East Asian characters. And many of those fonts (like the ones Marcel described) do not follow the 2x rule (a fact mentioned on the same page and already discussed here).
If there were any change to godoc, I could imagine something less controversial might be to say if any line in a literal like this contains wide characters, just give up on lining things up and use a single space after the colon instead.
That's even worse. We are *removing* options from gofmt, not adding them.
The whole point of gofmt is to have one standard and not local rules.
After discussing this a bit more w/ Rob, I'm not convinced anymore that Brad's suggestion would be "good enough" in the sense that it would make a worthwhile difference:The command-line gofmt should not depend on the character widths of the specific font used, only the Unicode characters in the source. Thus, Brad's proposal would only work if we could very broadly assume that _some_ Unicode characters always have a different width then "most" others for a given fixed width font. And not just any such fixed width font, but all (most) of them. If that were true, we could abandon alignment in those cases because not aligning might look better than aligning the wrong way. But I am very skeptical that we can identify such characters, and in any case we are always at the mercy of the specific font used. So I'm not sure it's worth the effort.
Aren't there entire Unicode classes for this sort of thing? But failing that, the heuristic of non-ASCII is probably enough. As demonstrated earlier, we already mess up even Latin with diacritics, so saying non-ASCII wouldn't be worse.
OK, so this topic seems well discussed, and it's unlikely that I can convince you guys.I hope you understand this was not an unreasonable proposal. If you did field research on the CJK programmers there I think you'd find it makes sense. That being said, if there's no other strong supporter, I have to withdraw this proposal because of the lack of support.