Introspection fix
[gnumeric.git] / plugins / html / font.c
blob2fe9b9eec1cd5e4164c4178742b36475d9bd1535
1 /*
2 * font.c
4 * Copyright (C) 1999 Rasca, Berlin
5 * EMail: thron@gmx.de
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>
22 #include <gnumeric.h>
23 #include "font.h"
24 #include <style.h>
26 static int
27 font_match (GnmStyle const *mstyle, char const **names)
29 int i;
30 char const *font_name;
32 if (!mstyle)
33 return 0;
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)
41 return 1;
43 return 0;
48 int
49 font_is_monospaced (GnmStyle const *mstyle)
51 char const *names[] = { "Courier", "fixed", NULL };
53 return font_match (mstyle, names);
58 int
59 font_is_helvetica (GnmStyle const *mstyle)
61 char const *names [] = { "Helvetica", NULL };
63 return font_match (mstyle, names);
68 int
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);