4 * Copyright (C) 1999 Rasca, Berlin
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see <https://www.gnu.org/licenses/>.
21 #include <gnumeric-config.h>
27 font_match (GnmStyle
const *mstyle
, char const **names
)
30 char const *font_name
;
34 font_name
= gnm_style_get_font_name (mstyle
);
36 g_return_val_if_fail (names
!= NULL
, 0);
37 g_return_val_if_fail (font_name
!= NULL
, 0);
39 for (i
= 0; names
[i
]; i
++) {
40 if (g_ascii_strcasecmp (font_name
, names
[i
]) == 0)
49 font_is_monospaced (GnmStyle
const *mstyle
)
51 char const *names
[] = { "Courier", "fixed", NULL
};
53 return font_match (mstyle
, names
);
59 font_is_helvetica (GnmStyle
const *mstyle
)
61 char const *names
[] = { "Helvetica", NULL
};
63 return font_match (mstyle
, names
);
69 font_is_sansserif (GnmStyle
const *mstyle
)
71 char const *names
[] = { "helvetica", "avantgarde",
72 "neep", "blippo", "capri",
73 "clean", "fixed", NULL
};
75 return font_match (mstyle
, names
);