{
Lisp_Object size = AREF (spec, FONT_SIZE_INDEX);
double point_size;
- int pixel_size, dpi;
+ int dpi, pixel_size;
Lisp_Object extra, val;
if (INTEGERP (size))
return XINT (size);
if (NILP (size))
- return 0;
- xassert (FLOATP (size));
+ return 0; xassert (FLOATP (size));
point_size = XFLOAT_DATA (size);
- dpi = AREF (spec, FONT_DPI_INDEX);
- if (INTEGERP (dpi))
+ val = AREF (spec, FONT_DPI_INDEX);
+ if (INTEGERP (val))
dpi = XINT (XCDR (val));
else
dpi = f->resy;
extern Lisp_Object find_font_encoding P_ ((Lisp_Object));
-EXFUN (Fassoc_string, 3);
/* Return encoding charset and repertory charset for REGISTRY in
ENCODING and REPERTORY correspondingly. If correct information for
{
int n = font_style_to_value (prop, val, 0);
- val = n >= 0 ? make_number (val) : Qerror;
+ val = n >= 0 ? make_number (n) : Qerror;
}
else
val = Qerror;
val = INTERN_FIELD (XLFD_SPACING_INDEX);
if (! NILP (val))
{
- val = font_prop_validate_spacing (FONT_SPACING_INDEX, val);
+ val = font_prop_validate_spacing (QCspacing, val);
if (! INTEGERP (val))
return -1;
ASET (font, FONT_SPACING_INDEX, val);
ASET (font, FONT_DPI_INDEX, prop[XLFD_RESY_INDEX]);
if (! NILP (prop[XLFD_SPACING_INDEX]))
{
- val = font_prop_validate_spacing (FONT_SPACING_INDEX,
+ val = font_prop_validate_spacing (QCspacing,
prop[XLFD_SPACING_INDEX]);
if (! INTEGERP (val))
return -1;
void
font_parse_family_registry (family, registry, font_spec)
- Lisp_Object family, registry;
+ Lisp_Object family, registry, font_spec;
{
int len;
char *p0, *p1;
if (INTEGERP (size))
ASET (prefer, FONT_SIZE_INDEX, size);
else if (FLOATP (size))
- ASET (prefer, FONT_SIZE_INDEX, font_pixel_size (f, spec));
+ ASET (prefer, FONT_SIZE_INDEX, make_number (font_pixel_size (f, spec)));
else
{
double pt = XINT (attrs[LFACE_HEIGHT_INDEX]);
which kind of font it is. It must be one of `font-spec', `font-entity'
`font-object'. */)
(object, extra_type)
- Lisp_Object object;
+ Lisp_Object object, extra_type;
{
if (NILP (extra_type))
return (FONTP (object) ? Qt : Qnil);
EXFUN (Fcopy_font_spec, 1);
EXFUN (Fmerge_font_spec, 2);
EXFUN (Ffont_get, 2);
+EXFUN (Ffont_put, 3);
EXFUN (Flist_fonts, 4);
EXFUN (Ffont_family_list, 1);
EXFUN (Fclear_font_cache, 0);
return NULL;
if (INTEGERP (AREF (spec, FONT_DPI_INDEX)))
- dpi = XINT (dpi);
+ dpi = XINT (AREF (spec, FONT_DPI_INDEX));
if (INTEGERP (AREF (spec, FONT_SPACING_INDEX)))
- spacing = XINT (val);
+ spacing = XINT (AREF (spec, FONT_SPACING_INDEX));
if (INTEGERP (AREF (spec, FONT_AVGWIDTH_INDEX))
&& XINT (AREF (spec, FONT_AVGWIDTH_INDEX)) == 0)
scalable = 1;
EXFUN (Feval_minibuffer, 2);
EXFUN (Fread_string, 5);
EXFUN (Fread_no_blanks_input, 3);
+EXFUN (Fassoc_string, 3);
extern Lisp_Object get_minibuffer P_ ((int));
extern void temp_echo_area_glyphs P_ ((Lisp_Object));
extern void init_minibuf_once P_ ((void));
/* Keywords symbols used for font properties. */
extern Lisp_Object QCfoundry, QCadstyle, QCregistry;
-extern QCspacing, QCsize, QCavgwidth;
+extern Lisp_Object QCspacing, QCsize, QCavgwidth;
extern Lisp_Object Qp;
/* Symbols used for attribute values. */
for (i = 0; i < 4; i++)
switch (font_sort_order[i])
{
- case XLFD_SWIDTH: font_props_for_sorting[i] = QCwidth; break;
- case XLFD_POINT_SIZE: font_props_for_sorting[i] = QCsize; break;
- case XLFD_WEIGHT: font_props_for_sorting[i] = QCweight; break;
- default: font_props_for_sorting[i] = QCslant; break;
+ case XLFD_SWIDTH:
+ font_props_for_sorting[i] = FONT_WIDTH_INDEX; break;
+ case XLFD_POINT_SIZE:
+ font_props_for_sorting[i] = FONT_SIZE_INDEX; break;
+ case XLFD_WEIGHT:
+ font_props_for_sorting[i] = FONT_WEIGHT_INDEX; break;
+ default:
+ font_props_for_sorting[i] = FONT_SLANT_INDEX; break;
}
- font_sort_order[i++] = QCfamily;
- font_sort_order[i++] = QCfoundry;
- font_sort_order[i++] = QCadstyle;
- font_sort_order[i++] = QCregistry;
+ font_props_for_sorting[i++] = FONT_FAMILY_INDEX;
+ font_props_for_sorting[i++] = FONT_FOUNDRY_INDEX;
+ font_props_for_sorting[i++] = FONT_ADSTYLE_INDEX;
+ font_props_for_sorting[i++] = FONT_REGISTRY_INDEX;
qsort (XVECTOR (vec)->contents, nfonts, sizeof (Lisp_Object),
compare_fonts_by_sort_order);
ASET (v, 0, AREF (font, FONT_FAMILY_INDEX));
ASET (v, 1, FONT_WIDTH_SYMBOLIC (font));
- point = PIXEL_TO_POINT (AREF (font, FONT_SIZE_INDEX) * 10, f->resy);
+ point = PIXEL_TO_POINT (XINT (AREF (font, FONT_SIZE_INDEX)) * 10,
+ f->resy);
ASET (v, 2, make_number (point));
ASET (v, 3, FONT_WEIGHT_SYMBOLIC (font));
ASET (v, 4, FONT_SLANT_SYMBOLIC (font));
{
struct font *font;
struct xftfont_info *xftfont_info;
- int result;
+ Lisp_Object result;
FT_Face ft_face;
CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring), font);
OTF_close (otf);
xftfont_info->maybe_otf = 0;
XftUnlockFace (xftfont_info->xftfont);
- return 0;
+ return Qnil;
}
xftfont_info->otf = otf;
}