Hi.
Disclaimer: I'm just guessing..
Image resolution, as the name suggests, is measured in pixels per inch, not just in pixels. So, if vertical resolution of your image is VR (px/inch) and H is the given height in pixels, then H / VR is height in inches. Now, if you measure
font size in points (1 inch is about 72 points), then maximum font size, which will fit in the given height H (pixels) is H/VR*72 (points).