From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <775b8d190603222358o4319c8d0o1ce4e6a8fbb3d05a@mail.gmail.com> Date: Thu, 23 Mar 2006 18:58:04 +1100 From: "Bruce Ellis" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] ttf2subf In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <27e1103209e04bfffc4889f1be149dae@quanstro.net> Topicbox-Message-UUID: 1cc58212-ead1-11e9-9d60-3106f5b1d025 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 wrote: > > /home/quanstro/cvs/plan9/ /usr/local/plan9/src/libframe/frdraw.c:14,20 = - frdraw.c:14,20 > > for(nb=3D0,b=3Df->box; nbnbox; nb++, b++){ > > _frcklinewrap(f, &pt, b); > > if(!f->noredraw && b->nrune >=3D 0) > > - string(f->b, pt, f->cols[TEXT], ZP, f->font, (cha= r *)b->ptr); > > + stringbg(f->b, pt, f->cols[TEXT], ZP, f->font, (c= har *)b->ptr, display->white, ZP); > > pt.x +=3D 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,10= 5 > > x =3D f->r.max.x; > > draw(f->b, Rect(pt.x, pt.y, x, pt.y+f->font->height), bac= k, nil, pt); > > if(b->nrune >=3D 0) > > - stringn(f->b, pt, text, ZP, f->font, ptr, nr); > > + stringnbg(f->b, pt, text, ZP, f->font, ptr, nr, d= isplay->white, ZP); > > pt.x +=3D 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 > >