From: "Bruce Ellis" <bruce.ellis@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] ttf2subf
Date: Thu, 23 Mar 2006 18:58:04 +1100 [thread overview]
Message-ID: <775b8d190603222358o4319c8d0o1ce4e6a8fbb3d05a@mail.gmail.com> (raw)
In-Reply-To: <b8f0bb447a690d8ba21820f49d48e8a7@swtch.com>
i wrote a ttf renderer in limbo. worked good on well designed fonts and
the others just look shitty at say 9 point.
it's a bit like html though in that fonts are often malformed and you
have to cope with the mistakes.
brucee
On 3/23/06, Russ Cox <rsc@swtch.com> wrote:
> > /home/quanstro/cvs/plan9/ /usr/local/plan9/src/libframe/frdraw.c:14,20 - frdraw.c:14,20
> > for(nb=0,b=f->box; nb<f->nbox; nb++, b++){
> > _frcklinewrap(f, &pt, b);
> > if(!f->noredraw && b->nrune >= 0)
> > - string(f->b, pt, f->cols[TEXT], ZP, f->font, (char *)b->ptr);
> > + stringbg(f->b, pt, f->cols[TEXT], ZP, f->font, (char *)b->ptr, display->white, ZP);
> > pt.x += b->wid;
> > }
> > }
>
> who says the background is white?
> frinsert, the only caller of _frredraw in the library,
> does appear to draw the background first, at least
> the beginning of it.
>
> > /home/quanstro/cvs/plan9//src/libframe/frdraw.c:99,105 - frdraw.c:99,105
> > x = f->r.max.x;
> > draw(f->b, Rect(pt.x, pt.y, x, pt.y+f->font->height), back, nil, pt);
> > if(b->nrune >= 0)
> > - stringn(f->b, pt, text, ZP, f->font, ptr, nr);
> > + stringnbg(f->b, pt, text, ZP, f->font, ptr, nr, display->white, ZP);
> > pt.x += w;
> > Continue:
> > b++;
>
> this one shouldn't be necessary. the draw call above
> just drew the background, which again might not be white.
>
> the right fix is to edit 9term's wrepaint. it should draw
> the background before calling _frredraw.
>
> it's possible that frinsert needs to be edited a little
> too, to make sure only to _frredraw the part whose
> background it just filled in with frselectpaint.
>
> i leave all this as an exercise to the interested reader.
>
> russ
>
>
next prev parent reply other threads:[~2006-03-23 7:58 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-23 3:57 erik quanstrom
2006-03-23 4:36 ` Russ Cox
2006-03-23 7:58 ` Bruce Ellis [this message]
2006-03-23 11:38 ` erik quanstrom
2006-03-23 14:32 ` Russ Cox
-- strict thread matches above, loose matches on Subject: below --
2006-03-23 3:20 erik quanstrom
2006-03-23 3:33 ` Russ Cox
2006-03-23 2:51 erik quanstrom
2006-03-23 2:57 ` Russ Cox
2006-03-23 2:34 erik quanstrom
2006-03-23 4:31 ` Latchesar Ionkov
2006-03-23 2:29 erik quanstrom
2006-03-23 2:35 ` andrey mirtchovski
2006-03-23 2:38 ` Russ Cox
2006-03-23 2:52 ` geoff
2006-03-23 3:00 ` andrey mirtchovski
2006-03-23 3:06 ` andrey mirtchovski
2006-03-23 10:40 ` Arvindh Rajesh Tamilmani
2006-03-23 2:03 erik quanstrom
2006-03-23 2:27 ` Latchesar Ionkov
2006-03-23 10:18 ` Charles Forsyth
2006-03-23 21:38 ` Tim Wiess
2006-03-23 0:12 erik quanstrom
2006-03-23 0:45 ` andrey mirtchovski
2006-03-23 2:25 ` Russ Cox
2006-03-23 2:33 ` Latchesar Ionkov
2005-05-05 3:06 andrey mirtchovski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=775b8d190603222358o4319c8d0o1ce4e6a8fbb3d05a@mail.gmail.com \
--to=bruce.ellis@gmail.com \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).