Commit b780f169 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Avoid segfaults when 'find-font' is invoked for a TTY frame

* src/font.c (font_pixel_size): Don't call GUI functions if F is a
text-mode frame.  (Bug#26646)
parent 513d000c
......@@ -306,18 +306,20 @@ font_pixel_size (struct frame *f, Lisp_Object spec)
return XINT (size);
if (NILP (size))
return 0;
eassert (FLOATP (size));
point_size = XFLOAT_DATA (size);
val = AREF (spec, FONT_DPI_INDEX);
if (INTEGERP (val))
dpi = XINT (val);
else
dpi = FRAME_RES_Y (f);
pixel_size = POINT_TO_PIXEL (point_size, dpi);
return pixel_size;
#else
return 1;
if (FRAME_WINDOW_P (f))
{
eassert (FLOATP (size));
point_size = XFLOAT_DATA (size);
val = AREF (spec, FONT_DPI_INDEX);
if (INTEGERP (val))
dpi = XINT (val);
else
dpi = FRAME_RES_Y (f);
pixel_size = POINT_TO_PIXEL (point_size, dpi);
return pixel_size;
}
#endif
return 1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment