Discussion:
[9fans] acme fonts
(too old to reply)
David Presotto
2003-10-13 16:50:43 UTC
Permalink
Several of us have given up on the variable width font completely
in acme. While it gives you a bit of screen space, it totally
fucks up formatting. I'm not sure I like a special purpose hack
just for .[ch]. Just say no to variable width. If the screen
gets tight, use a smaller font.
Fco.J.Ballesteros
2003-10-13 16:58:48 UTC
Permalink
To be sincere, we were suspecting smtp problems here and just couldnt
find a machine outside our network where to try direct mail to our
server. Our first bet was to send something not fully useless to
9fans. Sorry :-)

Anyway, I'm using var fonts because I like lucida ones to read mails
and the like, but as you say, they mess up formatting. I found that
by instructing Acme to use fixed fonts for all the file names were I
care about formatting, my screen looks nicer to me.

But I'm happy to see the trend. Probably it's better just to say no
Thanks for your answer.
v***@infernopark.com
2003-10-13 17:47:13 UTC
Permalink
Post by David Presotto
Several of us have given up on the variable width font completely
in acme. While it gives you a bit of screen space, it totally
fucks up formatting.
how do Sam and rio (rc) manage? they use fixed font or variable font?
Post by David Presotto
I'm not sure I like a special purpose hack
just for .[ch]. Just say no to variable width. If the screen
gets tight, use a smaller font.
yes, i think the problem is more generic than that (definitely win is one
candidate, mainly due to the output of programs).

thanks
dharani
Dan Cross
2003-10-13 19:36:46 UTC
Permalink
Post by v***@infernopark.com
Post by David Presotto
Several of us have given up on the variable width font completely
in acme. While it gives you a bit of screen space, it totally
fucks up formatting.
how do Sam and rio (rc) manage? they use fixed font or variable font?
Sam and rio use fixed width fonts.
Post by v***@infernopark.com
Post by David Presotto
I'm not sure I like a special purpose hack
just for .[ch]. Just say no to variable width. If the screen
gets tight, use a smaller font.
yes, i think the problem is more generic than that (definitely win is one
candidate, mainly due to the output of programs).
I don't like the idea of just giving up on variable width fonts;
they're easier on the eyes for some things (like mail). I wouldn't
mind being able to set a regular expression that would match tags
of windows that automatically get fixed-width font treatment, the
rest defaulting to variable width.

- Dan C.
rob pike, esq.
2003-10-14 00:05:49 UTC
Permalink
we changed acme to use fixed font for anything named *.[ch...]
and var font otherwise. Just to let you know. If anyone gets
interested I can send a diff of our kludge.
but code looks so much prettier in proportionally spaced fonts!
Fco.J.Ballesteros
2003-10-15 07:30:49 UTC
Permalink
Post by rob pike, esq.
but code looks so much prettier in proportionally spaced fonts!
Agree. It's just tabs. Probably doing what other has suggested,
i.e., making tab width to calculate xpos as if it were constant width,
could fix that.
Charles Forsyth
2003-10-14 08:09:46 UTC
Permalink
in acme. While [proportional typeface] gives you a bit of screen space, ...
actually, i use it because it looks good, is easier to read, and i
think contributes to the overall good look of a plan 9 screen.
perhaps it increases the amount of text on the screen but i was never
particularly worred about that.
(if i worried about screen space, i suppose i'd write less,
or switch to sms-style. u no t mx sns.)
if i started to worry about formatting, i'd stop writing assembler!
actually, even by the time of QED, assembly source code didn't bother
lining up the comments, just tabbed over and said what there was to say.
not that it was chatty, even then...
Rob Pike
2003-10-14 08:14:42 UTC
Permalink
Post by Charles Forsyth
actually, even by the time of QED, assembly source code didn't bother
lining up the comments, just tabbed over and said what there was to say.
not that it was chatty, even then...
it would be frightening to estimate how much time programmers have
wasted
formatting their text so comments line up and other such idiocies.
proportional
fronts are liberating because you get back all that time. if your
program needs
to be laid out with vertical alignment to be understood, rewrite it.

-rob
David Presotto
2003-10-14 11:18:44 UTC
Permalink
I feel so liberated...

#include <u.h> #include <libc.h> void cat(int f, char *s) { char buf[8192]; long n; while((n=read(f, buf, (long)sizeof buf))>0) if(write(1, buf, n)!=n) sysfatal("write error copying %s: %r", s); if(n < 0) sysfatal("error reading %s: %r", s); } void main(int argc, char *argv[]) { int f, i; argv0 = "cat"; if(argc == 1) cat(0, "<stdin>"); else for(i=1; i<argc; i++){ f = open(argv[i], OREAD); if(f < 0) sysfatal("can't open %s: %r", argv[i]); else{ cat(f, argv[i]); close(f); } } exits(0); }
George Michaelson
2003-10-14 23:46:52 UTC
Permalink
Post by Rob Pike
Post by Charles Forsyth
actually, even by the time of QED, assembly source code didn't bother
lining up the comments, just tabbed over and said what there was to say.
not that it was chatty, even then...
it would be frightening to estimate how much time programmers have
wasted formatting their text so comments line up and other such idiocies.
proportional fronts are liberating because you get back all that time. if
your program needs to be laid out with vertical alignment to be understood,
rewrite it.
-rob
Proportional fronts? I thought D'Arcy Thompson showed that all fronds are
proportional, on Fibonnaci series?

-George

PS There are texts which it makes sense
to lay out in fixed indents

Lest by typography
you ruin their orthography
--
George Michaelson | APNIC
Email: ***@apnic.net | PO Box 2131 Milton QLD 4064
Phone: +61 7 3367 0490 | Australia
Fax: +61 7 3367 0482 | http://www.apnic.net
Charles Forsyth
2003-10-15 05:30:39 UTC
Permalink
tabs indent code consistently for me and i use a range of typefaces
(depending where i am and what i'm using for display). if the size
set for space is relatively small, i suppose there might well be a problem.

ah. but what about
int fred;
long jim;
or
static int fred;
extern long jim;

perhaps i just write

static int fred;
extern long jim;

or i put the tabs in for old times' sake but don't fuss. the things don't line
up if you use different tab settings anyway, so what's the point. worst is
the code that uses a mixture of tabs and spaces, but that's not usual in Plan 9 source.

for me, easily the most useful thing to improve being able to read and
write C would be to eliminate that annoying need for forward
declaration of functions when compilers slurp in the whole thing.
ugh.
Brantley Coile
2003-10-15 10:29:38 UTC
Permalink
Post by Charles Forsyth
for me, easily the most useful thing to improve being able to read and
write C would be to eliminate that annoying need for forward
declaration of functions when compilers slurp in the whole thing.
And it's not like we haven't learned to do two passes on things.

Brantley

v***@infernopark.com
2003-10-14 18:12:48 UTC
Permalink
Post by Charles Forsyth
in acme. While [proportional typeface] gives you a bit of screen space, ...
actually, i use it because it looks good, is easier to read, and i
think contributes to the overall good look of a plan 9 screen.
the main problem is when you have to use the code in other platforms or
tools. The code becomes a bit messy when you have to use vi or even sam (if
I am right, because i dont use sam though i want to try it sometime).

this was a constant problem for me and at one time i decided to stick to
acme (with euro.8) and format my code accordingly. i get into trouble off
and on (like when writing the code to print formatted output or seeing the
output) at which time i temporarily switching to fixed font.

now that presotto said how they use use acme, i am trying to use fixed
font. not too good but it definitely solves the problem.

i am surprised how this problem has been in everyone's mind but pretty much
not discussed so far (if i am right). sure, this is a catch-22 kind of a
situation.

thanks
dharani
Charles Forsyth
2003-10-15 05:41:34 UTC
Permalink
Post by v***@infernopark.com
i am surprised how this problem has been in everyone's mind but pretty much
not discussed so far (if i am right). sure, this is a catch-22 kind of a
i'd wondered instead whether everyone was suddenly approaching an
age where reading glasses often start to be prescribed(!)
my optometrist has been disappointed so far (``hmm. we'll see what happens next time.''),
but i suppose it might not be long. i could practise on my OED.
David Presotto
2003-10-14 12:18:39 UTC
Permalink
Proportionally spaced fonts could be liberating, but don't
seem so in practice. I find that all of the code lines up
nicely when I use the same font as the author (Rob included).
Perhaps we just need more time to liberate ourselves.

Formatting style goes hand in hand with programming style.
You format to make picking out elements of a program
visually easy. While ignoring conventions can be liberating, it
can also jarring.

That said, I still think that it is incorrect to have the tools
force everyone to use a constant width font for programming.
Just as I, with my lousy vision, find constant width easier to
read, others prefer the caligraphic beauty of proportional
fonts. If I wanted all things to line up as the original
author intended, I'ld rather people just put a comment
in their code saying what font it was written in. It would
be nice if acme just let me point to a font name on the
screen and make executing it (button 2) mean change that window
to that font (or some such mechanism). Then at least I
could keep tables looking like tables.

Of course, we could instead write programs in a Word/Brutus-like
editor whose output was xml with formatting inserted. I
find that also way over the top but actually perferable
to forcing constant width fonts on everyone.
Rob Pike
2003-10-14 15:52:40 UTC
Permalink
ridicule away, i stand by my point. industrial code is usually
commented in
rectilinear glory because that's how the programmers think the code
should
look to be professional. if that much attention was spent on the code
itself
we might have better software. often, in-house rules require such
attention
be paid, which is even crazier.

presotto: acme can change the font in a window, pretty much as you
described. were you suggesting it be done differently?

-rob
david presotto
2003-10-15 03:36:38 UTC
Permalink
No, I didn't even realize it was that easy.
----- Original Message -----
From: "Rob Pike" <***@mightycheese.com>
To: <***@cse.psu.edu>
Sent: Tuesday, October 14, 2003 11:51 AM
Subject: Re: [9fans] acme fonts
Post by Rob Pike
ridicule away, i stand by my point. industrial code is usually
commented in
rectilinear glory because that's how the programmers think the code
should
look to be professional. if that much attention was spent on the code
itself
we might have better software. often, in-house rules require such
attention
be paid, which is even crazier.
presotto: acme can change the font in a window, pretty much as you
described. were you suggesting it be done differently?
-rob
c***@hollis-locke.com
2003-10-14 16:05:34 UTC
Permalink
Post by David Presotto
Proportionally spaced fonts could be liberating, but don't
seem so in practice. I find that all of the code lines up
nicely when I use the same font as the author (Rob included).
Perhaps we just need more time to liberate ourselves.
The main problem I've seen here is how acme handles tabs.
Obviously there are other bits of code layout that will line up
in a CW font that wont in a VW font but for the most part I use
tabs for alignment. Most important to me is 'leading edge' alignment
I am not too bothered about ragged trailing edges.

Maybe something like:
When doing tab calculation dont use the current character pos,
instead treat every preceeding char on the line as width 1em even
if it is less. Set your tab width to 4em and I think you'll get
quite nice results irrespective of CW/VW font.

Obviously this only goes for newly written code - those extra tabs
to line up old code under the old tabbing scheme will throw it out,
but once prettied up, it will stay prettied up for everyone.
Loading...