freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft] Font units to pixels in line height


From: Andreas Falkenhahn
Subject: [ft] Font units to pixels in line height
Date: Sat, 31 Dec 2016 13:44:24 +0100

I want to convert the "height" value from FT_FaceRec to pixels. IIUC
this can be done like this:

     double lineHeight = (double) FT_MulFix(face->height, 
face->size->metrics.y_scale) / (double) 64;

Is that right? 

Since the value will typically be a fractional value I was also wondering
whether I should apply any rounding using floor() or ceil() here. For
example, when opening Arial in 28pt, the above formula yields 32.203125
pixels. So should I use 32 pixels or 33 pixels as the line height in this case? 

Thanks!

-- 
Best regards,
 Andreas Falkenhahn                          mailto:address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]