-#ifdef USE_PANGO
- /* printf("\n\n%s\n\n",fontstring);
- FcPatternPrint(match); */
-
- out->pango_font_description = pango_font_description_new();
-
- if (FcPatternGetString(match, "family", 0, &tmp_string) != FcResultTypeMismatch) {
- pango_font_description_set_family(out->pango_font_description, tmp_string);
- tmp_string = NULL;
- }
- if (FcPatternGetString(match, "style", 0, &tmp_string) != FcResultTypeMismatch) {
- /* Bold ? */
- if (!strcasecmp("bold", tmp_string)) {
- pango_font_description_set_weight(out->pango_font_description, PANGO_WEIGHT_BOLD);
- }
- /* Italic ? */
- else if (!strcasecmp("italic", tmp_string)) {
- pango_font_description_set_style(out->pango_font_description, PANGO_STYLE_ITALIC);
- }
- tmp_string = NULL;
+ out->font_desc = pango_font_description_new();
+ out->layout = pango_layout_new(inst->pango);
+
+ /* get the data from the parsed xft string */
+
+ /* get the family */
+ if (FcPatternGetString(pat, "family", 0,
+ (FcChar8**)&sval) == FcResultMatch)
+ pango_font_description_set_family(out->font_desc, sval);
+
+ /* get the weight */
+ if (FcPatternGetInteger(pat, "weight", 0, &ival) == FcResultMatch) {
+ if (ival == FC_WEIGHT_LIGHT)
+ pango_font_description_set_weight(out->font_desc,
+ PANGO_WEIGHT_LIGHT);
+ else if (ival == FC_WEIGHT_DEMIBOLD)
+ pango_font_description_set_weight(out->font_desc,
+ PANGO_WEIGHT_SEMIBOLD);
+ else if (ival == FC_WEIGHT_BOLD)
+ pango_font_description_set_weight(out->font_desc,
+ PANGO_WEIGHT_BOLD);
+ else if (ival == FC_WEIGHT_BLACK)
+ pango_font_description_set_weight(out->font_desc,
+ PANGO_WEIGHT_ULTRABOLD);