aboutsummaryrefslogtreecommitdiffstats
path: root/src/font.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/font.c b/src/font.c
index e2414582f67..50ec39a9a49 100644
--- a/src/font.c
+++ b/src/font.c
@@ -1289,8 +1289,9 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
1289 1 + DBL_MAX_10_EXP + 1)]; 1289 1 + DBL_MAX_10_EXP + 1)];
1290 if (INTEGERP (val)) 1290 if (INTEGERP (val))
1291 { 1291 {
1292 intmax_t v = FIXNUMP (val) ? XFIXNUM (val) : bignum_to_intmax (val); 1292 intmax_t v;
1293 if (! (0 < v && v <= TYPE_MAXIMUM (uprintmax_t))) 1293 if (! (integer_to_intmax (val, &v)
1294 && 0 < v && v <= TYPE_MAXIMUM (uprintmax_t)))
1294 v = pixel_size; 1295 v = pixel_size;
1295 if (v > 0) 1296 if (v > 0)
1296 { 1297 {
@@ -4747,16 +4748,10 @@ DEFUN ("open-font", Fopen_font, Sopen_font, 1, 3, 0,
4747 else 4748 else
4748 { 4749 {
4749 CHECK_NUMBER (size); 4750 CHECK_NUMBER (size);
4750 if (BIGNUMP (size)) 4751 if (FLOATP (size))
4751 { 4752 isize = POINT_TO_PIXEL (XFLOAT_DATA (size), FRAME_RES_Y (f));
4752 isize = bignum_to_intmax (size); 4753 else if (! integer_to_intmax (size, &isize))
4753 if (isize == 0) 4754 args_out_of_range (font_entity, size);
4754 args_out_of_range (font_entity, size);
4755 }
4756 else
4757 isize = (FLOATP (size)
4758 ? POINT_TO_PIXEL (XFLOAT_DATA (size), FRAME_RES_Y (f))
4759 : XFIXNUM (size));
4760 if (! (INT_MIN <= isize && isize <= INT_MAX)) 4755 if (! (INT_MIN <= isize && isize <= INT_MAX))
4761 args_out_of_range (font_entity, size); 4756 args_out_of_range (font_entity, size);
4762 if (isize == 0) 4757 if (isize == 0)