3 * Copyright (C) 2001-2009 Jim Evins <evins@snaught.com>.
5 * This file is part of gLabels.
7 * gLabels 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 3 of the License, or
10 * (at your option) any later version.
12 * gLabels 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 gLabels. If not, see <http://www.gnu.org/licenses/>.
29 /****************************************************************************/
30 /* Utilities to deal with PangoAlignment types. */
31 /****************************************************************************/
33 gl_str_util_align_to_string (PangoAlignment align)
36 case PANGO_ALIGN_LEFT:
38 case PANGO_ALIGN_CENTER:
40 case PANGO_ALIGN_RIGHT:
49 gl_str_util_string_to_align (const gchar *string)
52 if (g_ascii_strcasecmp (string, "Left") == 0) {
53 return PANGO_ALIGN_LEFT;
54 } else if (g_ascii_strcasecmp (string, "Center") == 0) {
55 return PANGO_ALIGN_CENTER;
56 } else if (g_ascii_strcasecmp (string, "Right") == 0) {
57 return PANGO_ALIGN_RIGHT;
59 return PANGO_ALIGN_LEFT;
65 /****************************************************************************/
66 /* Utilities to deal with PangoWeight types */
67 /****************************************************************************/
69 gl_str_util_weight_to_string (PangoWeight weight)
72 case PANGO_WEIGHT_NORMAL:
74 case PANGO_WEIGHT_BOLD:
83 gl_str_util_string_to_weight (const gchar *string)
86 if (g_ascii_strcasecmp (string, "Regular") == 0) {
87 return PANGO_WEIGHT_NORMAL;
88 } else if (g_ascii_strcasecmp (string, "Bold") == 0) {
89 return PANGO_WEIGHT_BOLD;
91 return PANGO_WEIGHT_NORMAL;
99 * Local Variables: -- emacs
101 * c-basic-offset: 8 -- emacs
102 * tab-width: 8 -- emacs
103 * indent-tabs-mode: nil -- emacs