henesyinit from p9fce6d0435 years agoHistory
28 lines · 390 B · C
RawDownload
#include <libg.h> typedef unsigned short ushort; longstrwidth(Font *f, char *s){	int wid, twid, n;	enum { Max = 128 };	ushort cbuf[Max]; 	twid = 0;	while(*s){		n = 0;		while(cachechars(f, &s, cbuf, Max, &wid) <= 0)			if(++n > 10)				berror("strwidth");		agefont(f);		twid += wid;	}	return twid;} Pointstrsize(Font *f, char *s){	return Pt(strwidth(f, s), f->height);}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t