PangoFontDescription *desc = pango_font_description_new();
pango_font_description_set_family(desc, font->name);
pango_font_description_set_size(desc, font->size * PANGO_SCALE);
- if (font->slant == FONT_SLANT_ITALIC) {
- pango_font_description_set_style(desc, PANGO_STYLE_ITALIC);
- }
- if (font->slant == FONT_SLANT_OBLIQUE) {
- pango_font_description_set_style(desc, PANGO_STYLE_OBLIQUE);
- }
+ pango_font_description_set_style(desc, font->slant);
pango_font_description_set_weight(desc, font->weight);
return desc;
}
font->size = atoi(content);
} else if (!strcmp(nodename, "slant")) {
if (!strcasecmp(content, "italic")) {
- font->slant = FONT_SLANT_ITALIC;
+ font->slant = PANGO_STYLE_ITALIC;
} else if (!strcasecmp(content, "oblique")) {
- font->slant = FONT_SLANT_OBLIQUE;
+ font->slant = PANGO_STYLE_OBLIQUE;
} else {
- font->slant = FONT_SLANT_NORMAL;
+ font->slant = PANGO_STYLE_NORMAL;
}
} else if (!strcmp(nodename, "weight")) {
if (!strcasecmp(content, "thin")) {
init_font_defaults(struct font *font)
{
font->size = 10;
- font->slant = FONT_SLANT_NORMAL;
+ font->slant = PANGO_STYLE_NORMAL;
font->weight = PANGO_WEIGHT_NORMAL;
}