# HG changeset patch # User Jason Rumney # Date 1214303472 0 # Node ID 1c73e69fc195f9a1e257f24e6046511af9039367 # Parent c81ae89820a42bd0c0cfd7d0be752dc988c22511 (PIXEL_TO_POINT): Clarify usage in comment. diff -r c81ae89820a4 -r 1c73e69fc195 src/font.h --- a/src/font.h Tue Jun 24 08:58:45 2008 +0000 +++ b/src/font.h Tue Jun 24 10:31:12 2008 +0000 @@ -477,8 +477,11 @@ 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