]> code.delx.au - gnu-emacs/commitdiff
(PIXEL_TO_POINT): Clarify usage in comment.
authorJason Rumney <jasonr@gnu.org>
Tue, 24 Jun 2008 10:31:12 +0000 (10:31 +0000)
committerJason Rumney <jasonr@gnu.org>
Tue, 24 Jun 2008 10:31:12 +0000 (10:31 +0000)
src/font.h

index 522343255e7b413f80ec301e5f93774c5baef39c..2419e1961861ade57e410b0182696ea0d0678858 100644 (file)
@@ -477,8 +477,11 @@ struct font_bitmap
    on resolution DPI.  */
 #define POINT_TO_PIXEL(POINT, DPI) ((POINT) * (DPI) / PT_PER_INCH + 0.5)
 
-/* Return a point size (double) corresponding to POINT size (integer)
-   on resolution DPI.  */
+/* Return a point size corresponding to POINT size (integer)
+   on resolution DPI. Note that though point size is a double, we expect
+   it to be rounded to an int, so we add 0.5 here. If the desired value
+   is tenths of points (as in xfld specs), then the pixel size should
+   be multiplied BEFORE the conversion to avoid magnifying the error.  */
 #define PIXEL_TO_POINT(PIXEL, DPI) ((PIXEL) * PT_PER_INCH / (DPI) + 0.5)
 
 /* Ignore the difference of font pixel sizes less than or equal to