11 string(Image *dst, Point pt, Image *src, Point sp, Font *f, char *s)
13 return _string(dst, pt, src, sp, f, s, nil, 1<<24, dst->clipr, nil, ZP, SoverD);
17 stringop(Image *dst, Point pt, Image *src, Point sp, Font *f, char *s, Drawop op)
19 return _string(dst, pt, src, sp, f, s, nil, 1<<24, dst->clipr, nil, ZP, op);
23 stringn(Image *dst, Point pt, Image *src, Point sp, Font *f, char *s, int len)
25 return _string(dst, pt, src, sp, f, s, nil, len, dst->clipr, nil, ZP, SoverD);
29 stringnop(Image *dst, Point pt, Image *src, Point sp, Font *f, char *s, int len, Drawop op)
31 return _string(dst, pt, src, sp, f, s, nil, len, dst->clipr, nil, ZP, op);
35 runestring(Image *dst, Point pt, Image *src, Point sp, Font *f, Rune *r)
37 return _string(dst, pt, src, sp, f, nil, r, 1<<24, dst->clipr, nil, ZP, SoverD);
41 runestringop(Image *dst, Point pt, Image *src, Point sp, Font *f, Rune *r, Drawop op)
43 return _string(dst, pt, src, sp, f, nil, r, 1<<24, dst->clipr, nil, ZP, op);
47 runestringn(Image *dst, Point pt, Image *src, Point sp, Font *f, Rune *r, int len)
49 return _string(dst, pt, src, sp, f, nil, r, len, dst->clipr, nil, ZP, SoverD);
53 runestringnop(Image *dst, Point pt, Image *src, Point sp, Font *f, Rune *r, int len, Drawop op)
55 return _string(dst, pt, src, sp, f, nil, r, len, dst->clipr, nil, ZP, op);
59 _string(Image *dst, Point pt, Image *src, Point sp, Font *f, char *s, Rune *r, int len, Rectangle clipr, Image *bg, Point bgp, Drawop op)
61 int m, n, wid, max, try;
62 ushort cbuf[Max], *c, *ec;
82 while((*s || *r) && len > 0){
88 if((sf=_getsubfont(f->display, subfontname)) == nil){
89 if(f->display->defaultfont == nil || f->display->defaultfont == f)
91 f = f->display->defaultfont;
94 if((n = cachechars(f, sptr, rptr, cbuf, max, &wid, &subfontname)) <= 0){
103 s += chartorune(&rune, s);
109 _setdrawop(dst->display, op);
114 b = bufimage(dst->display, m);
116 fprint(2, "string: %r\n");
123 BPLONG(b+1, dst->id);
124 BPLONG(b+5, src->id);
125 BPLONG(b+9, f->cacheimage->id);
127 BPLONG(b+17, pt.y+f->ascent);
128 BPLONG(b+21, clipr.min.x);
129 BPLONG(b+25, clipr.min.y);
130 BPLONG(b+29, clipr.max.x);
131 BPLONG(b+33, clipr.max.y);
143 for(c=cbuf; c<ec; c++, b+=2)