p++;
else if (*p == ':')
{
- family_end = p;
- props_beg = p + 1;
+ props_beg = family_end = p;
break;
}
else if (*p == '-')
double point_size = strtod (size_beg, &size_end);
ASET (font, FONT_SIZE_INDEX, make_float (point_size));
if (*size_end == ':' && size_end[1])
- props_beg = size_end + 1;
+ props_beg = size_end;
}
if (props_beg)
{
extra, copy unknown ones to COPY. It is stored in extra slot by
the key QCfc_unknown_spec. */
char *copy_start, *copy;
+ Lisp_Object val;
copy_start = copy = alloca (name + len - props_beg + 2);
if (! copy)
return -1;
- p = props_beg;
- while (*p)
+ for (p = props_beg; *p; p = q)
{
- Lisp_Object val;
- int word_len, prop;
-
for (q = p + 1; *q && *q != '=' && *q != ':'; q++);
- word_len = q - p;
if (*q != '=')
{
/* Must be an enumerated value. */
+ int word_len;
+ p = p + 1;
+ word_len = q - p;
val = font_intern_prop (p, q - p, 1);
#define PROP_MATCH(STR,N) ((word_len == N) && memcmp (p, STR, N) == 0)
}
#undef PROP_MATCH
}
- else /* KEY=VAL pairs */
+ else
{
+ /* KEY=VAL pairs */
Lisp_Object key;
char *keyhead = p;
+ int prop;
- if (word_len == 9 && memcmp (p, "pixelsize=", 10) == 0)
+ if (q - p == 10 && memcmp (p + 1, "pixelsize", 9) == 0)
prop = FONT_SIZE_INDEX;
else
{
Ffont_put (font, key, val);
else
{
- *copy++ = ':';
bcopy (keyhead, copy, q - keyhead);
copy += q - keyhead;
}
}
}
- p = *q ? q + 1 : q;
}
if (copy_start != copy)
font_put_extra (font, QCfc_unknown_spec,