char copy[513];
int i;
char *p;
+ MSymbol sym;
if (name[0] != '-')
return -1;
size = atoi (field[XLFD_PIXEL]) * 10;
if (field[XLFD_FOUNDRY])
- mfont__set_property (font, MFONT_FOUNDRY, msymbol (field[XLFD_FOUNDRY]));
+ {
+ sym = msymbol (field[XLFD_FOUNDRY]);
+ if (! sym)
+ sym = msymbol ("Nil");
+ mfont__set_property (font, MFONT_FOUNDRY, sym);
+ }
if (field[XLFD_FAMILY])
- mfont__set_property (font, MFONT_FAMILY, msymbol (field[XLFD_FAMILY]));
+ {
+ sym = msymbol (field[XLFD_FAMILY]);
+ if (! sym)
+ sym = msymbol ("Nil");
+ mfont__set_property (font, MFONT_FAMILY, sym);
+ }
if (field[XLFD_WEIGHT])
mfont__set_property (font, MFONT_WEIGHT, msymbol (field[XLFD_WEIGHT]));
if (field[XLFD_SLANT])
The mfont_get_prop () function gets the value of $KEY property of
font $FONT. $KEY must be one of the following symbols:
- @c Mfamily, @c Mweight, @c Mstyle, @c Mstretch, @c Madstyle,
- @c Mregistry, @c Msize, @c Mresolution, @c Mspacing.
+ @c Mfoundry, @c Mfamily, @c Mweight, @c Mstyle, @c Mstretch,
+ @c Madstyle, @c Mregistry, @c Msize, @c Mresolution, @c Mspacing.
If $FONT is a return value of mfont_find (), $KEY can also be one
of the following symbols:
#Mfont_ascent, #Mfont_descent, #Mmax_advance.
- @return If $KEY is @c Mfamily, @c Mweight, @c Mstyle, @c Mstretch,
- @c Madstyle, @c Mregistry, or @c Mspacing, this function returns
- the corresponding value as a symbol. If the font does not have
- $KEY property, it returns @c Mnil. If $KEY is @c Msize, @c
- Mresolution, #Mfont_ascent, Mfont_descent, or #Mmax_advance, this
- function returns the corresponding value as an integer. If the
- font does not have $KEY property, it returns 0. If $KEY is
- something else, it returns @c NULL and assigns an error code to
- the external variable #merror_code. */
+ @return If $KEY is @c Mfoundry, @c Mfamily, @c Mweight, @c Mstyle,
+ @c Mstretch, @c Madstyle, @c Mregistry, or @c Mspacing, this
+ function returns the corresponding value as a symbol. If the font
+ does not have $KEY property, it returns @c Mnil. If $KEY is @c
+ Msize, @c Mresolution, #Mfont_ascent, Mfont_descent, or
+ #Mmax_advance, this function returns the corresponding value as an
+ integer. If the font does not have $KEY property, it returns 0.
+ If $KEY is something else, it returns @c NULL and assigns an error
+ code to the external variable #merror_code. */
/***ja
@brief ¥Õ¥©¥ó¥È¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÆÀ¤ë.
$KEY ¤Ç¤¢¤ë¤â¤Î¤ÎÃͤòÊÖ¤¹¡£$KEY ¤Ï°Ê²¼¤Î¥·¥ó¥Ü¥ë¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì
¤Ð¤Ê¤é¤Ê¤¤¡£
- @c Mfamily, @c Mweight, @c Mstyle, @c Mstretch,
+ @c Mfoundry, @c Mfamily, @c Mweight, @c Mstyle, @c Mstretch,
@c Madstyle, @c Mregistry, @c Msize, @c Mresolution, @c Mspacing.
- @return $KEY ¤¬ @c Mfamily, @c Mweight, @c Mstyle, @c Mstretch, @c
- Madstyle, @c Mregistry, @c Mspacing ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ì¤Ð¡¢ÁêÅö¤¹¤ëÃÍ
- ¤ò¥·¥ó¥Ü¥ë¤È¤·¤ÆÊÖ¤¹¡£¥Õ¥©¥ó¥È¤¬¤½¤Î¥×¥í¥Ñ¥Æ¥£¤ò»ý¤¿¤Ê¤¤¾ì¹ç¤Ë¤Ï
- @c Mnil ¤òÊÖ¤¹¡£$KEY ¤¬ @c Msize ¤¢¤ë¤¤¤Ï @c Mresolution ¤Î¾ì¹ç¤Ë¤Ï¡¢
- ÁêÅö¤¹¤ëÃͤò¤ÏÀ°¿ôÃͤȤ·¤ÆÊÖ¤¹¡£¥Õ¥©¥ó¥È¤¬¤½¤Î¥×¥í¥Ñ¥Æ¥£¤ò»ý¤¿¤Ê¤¤
- ¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£$KEY ¤¬¤½¤ì°Ê³°¤Î¤â¤Î¤Ç¤¢¤ì¤Ð¡¢@c NULL ¤òÊÖ¤·¡¢
- ³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
+ @return $KEY ¤¬ @c Mfoundry, @c Mfamily, @c Mweight, @c Mstyle, @c
+ Mstretch, @c Madstyle, @c Mregistry, @c Mspacing ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ì¤Ð¡¢
+ ÁêÅö¤¹¤ëÃͤò¥·¥ó¥Ü¥ë¤È¤·¤ÆÊÖ¤¹¡£¥Õ¥©¥ó¥È¤¬¤½¤Î¥×¥í¥Ñ¥Æ¥£¤ò»ý¤¿¤Ê¤¤
+ ¾ì¹ç¤Ë¤Ï@c Mnil ¤òÊÖ¤¹¡£$KEY ¤¬ @c Msize ¤¢¤ë¤¤¤Ï @c Mresolution ¤Î
+ ¾ì¹ç¤Ë¤Ï¡¢ÁêÅö¤¹¤ëÃͤò¤ÏÀ°¿ôÃͤȤ·¤ÆÊÖ¤¹¡£¥Õ¥©¥ó¥È¤¬¤½¤Î¥×¥í¥Ñ¥Æ¥£
+ ¤ò»ý¤¿¤Ê¤¤¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£$KEY ¤¬¤½¤ì°Ê³°¤Î¤â¤Î¤Ç¤¢¤ì¤Ð¡¢@c
+ NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
void *
mfont_get_prop (MFont *font, MSymbol key)
$KEY and value is $VAL to font $FONT. $KEY must be one of the
following symbols:
- @c Mfamily, @c Mweight, @c Mstyle, @c Mstretch,
+ @c Mfoundry, @c Mfamily, @c Mweight, @c Mstyle, @c Mstretch,
@c Madstyle, @c Mregistry, @c Msize, @c Mresolution.
If $KEY is @c Msize or @c Mresolution, $VAL must be an integer.
- Otherwise, $VAL must be a symbol. */
+ Otherwise, $VAL must be a symbol of a property value name. But,
+ if the name is "nil", a symbol of name "Nil" must be
+ specified. */
/***ja
@brief ¥Õ¥©¥ó¥È¤Î¥×¥í¥Ñ¥Æ¥£¤ËÃͤòÀßÄꤹ¤ë.
- ´Ø¿ô mfont_put_prop () ¤Ï¡¢¥Õ¥©¥ó¥È $FONT ¤Î¥¡¼¤¬$KEY
- ¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤ÎÃͤò $VAL ¤ËÀßÄꤹ¤ë¡£$KEY ¤Ï°Ê²¼¤Î¥·¥ó¥Ü¥ë¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£
+ ´Ø¿ô mfont_put_prop () ¤Ï¡¢¥Õ¥©¥ó¥È $FONT ¤Î¥¡¼¤¬$KEY ¤Ç¤¢¤ë¥×¥í¥Ñ
+ ¥Æ¥£¤ÎÃͤò $VAL ¤ËÀßÄꤹ¤ë¡£$KEY ¤Ï°Ê²¼¤Î¥·¥ó¥Ü¥ë¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£
- @c Mfamily, @c Mweight, @c Mstyle, @c Mstretch,
+ @c Mfoundry, @c Mfamily, @c Mweight, @c Mstyle, @c Mstretch,
@c Madstyle, @c Mregistry, @c Msize, @c Mresolution.
- $KEY ¤¬ @c Msize ¤« @c Mresolution ¤Ç¤¢¤ì¤Ð $VAL
- ¤ÏÀ°¿ôÃͤǤʤ¯¤Æ¤Ï¤é¤Ê¤¤¡£¤½¤ì°Ê³°¤Î¾ì¹ç¡¢$VAL ¤Ï¥·¥ó¥Ü¥ë¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£*/
+ $KEY ¤¬ @c Msize ¤« @c Mresolution ¤Ç¤¢¤ì¤Ð $VAL ¤ÏÀ°¿ôÃͤǤʤ¯¤Æ¤Ï
+ ¤é¤Ê¤¤¡£¤½¤ì°Ê³°¤Î¾ì¹ç¡¢$VAL ¤Ï¥×¥í¥Ñ¥Æ¥£ÃͤÎ̾Á°¤Î¥·¥ó¥Ü¥ë¤Ç¤Ê¤¯¤Æ
+ ¤Ï¤Ê¤é¤Ê¤¤¡£¤¿¤À¤·¤â¤·¤½¤Î̾Á°¤¬ "nil" ¤Î¾ì¹ç¤Ï¡¢Ì¾Á°¤¬ "Nil" ¤Î¥·
+ ¥ó¥Ü¥ë¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£*/
int
mfont_put_prop (MFont *font, MSymbol key, void *val)