on js we used to get data via https://github.com/dy/font-measure
ascender: 0.95
capHeight: 0.89
height: (fontData.ascender - fontData.descender) * -1;//1.4
median: 0.47
but have no idea how to get those value on python tried
from PIL import ImageFont
text = 'sphinx'
H = 100
font = ImageFont.truetype(font, H, encoding='utf-8')
ascent, descent = font.getmetrics()
(width, baseline), (offset_x, offset_y) = font.font.getsize(text)
but I can't get the numbers quite right and am not sure what is what. any help on this will be appreciated.

