No need to do X programming ;)
bash$ xterm -fa "Bitstream Vera Sans Mono:size=14" -geometry 40x10 \
-e 'xwininfo -id $WINDOWID | egrep "(Width|Height)" > /tmp/winfo1'
bash$ xterm -fa "Bitstream Vera Sans Mono:size=14" -geometry 80x20 \
-e 'xwininfo -id $WINDOWID | egrep "(Width|Height)" > /tmp/winfo2'
Now you have two files with dimensions in pixels, including any padding. In my case they are 444×224 and 884×444. From this one could compute the cell size of 11×22 pixels, and 4 pixels for padding.
Note this does not include any WM decorations. I think any method of finding those would be WM-specific. In my case I need to look at the grandparent window size (do xwininfo -id $something -tree | fgrep Parent
twice).