shithub: fnt

ref: a65e44617ba1d08e011f3cee56470a0a7351ea47
dir: /test.c/

View raw version
#include <u.h>
#include <libc.h>
#include <bio.h>
#include "otf.h"

void
main(int argc, char **argv)
{
	Biobuf *out;
	Otf *o;
	int i;

	otfinit();
	out = Bfdopen(1, OWRITE);
	for(i = 1; i < argc; i++){
		Bprint(out, "%s\n", argv[i]);
		if((o = otfopen(argv[i])) == nil){
			fprint(2, "%r\n");
		}else{
			int n = otfglyfnum(o);
			for(int i = 0; i < n; i++){
				Glyf *g = otfglyf(o, i);
				if(g == nil)
					fprint(2, "%d: %r\n", i);
				else{
					Bprint(out, "\n%d:\n", i);
					print_Glyf(out, indentΔ, o, g);
				}
			}
			//otfprint(o, out, indentΔ);
		}
		otfclose(o);
	}
	Bterm(out);

	exits(nil);
}