[PD-dev] glist font vs. default font - how to measure?

federico mescalinum at gmail.com
Sun Sep 2 23:11:13 CEST 2007


hi all,
I re-subscribed today to this list, and now I'm learning the gui part
of pd externals.

I've almost finished my first gui external, just I don't know how to
specify the current(canvas) font with the Tk's -font option (since Tk
wants a string, while pd uses integers).

actually I'm doing that (in CLASSNAME_new()):

int font = glist_getfont(x->x_glist);
int width = sys_fontwidth(font);
int height = sys_fontheight(font);

but it seems (at least the width - perhaps it's a coincidence) that
metrics are wrong.

right now I do not pass *ANY* option to [.x%c.c create text ...].
which font is that one in glist measured by sys_font*() ?

I've checked out other externals, but I see every one picks an
arbitrary font and arbitrary sizes :S

I hope there's a better way...

best regards,
Federico




More information about the Pd-dev mailing list