9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] ttf2subf
Date: Wed, 22 Mar 2006 23:36:29 -0500	[thread overview]
Message-ID: <b8f0bb447a690d8ba21820f49d48e8a7@swtch.com> (raw)
In-Reply-To: <27e1103209e04bfffc4889f1be149dae@quanstro.net>

> /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



  reply	other threads:[~2006-03-23  4:36 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 [this message]
2006-03-23  7:58   ` Bruce Ellis
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=b8f0bb447a690d8ba21820f49d48e8a7@swtch.com \
    --to=rsc@swtch.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).