+
+ /* get the size */
+ if (FcPatternGetInteger(pat, "size", 0, &ival) == FcResultMatch)
+ pango_font_description_set_size(out->font_desc, ival * PANGO_SCALE);
+ else if (FcPatternGetInteger(pat, "pixelsize", 0, &ival) == FcResultMatch)
+ pango_font_description_set_absolute_size(out->font_desc,
+ ival * PANGO_SCALE);
+ else
+ pango_font_description_set_size(out->font_desc, 8 * PANGO_SCALE);
+
+ if (FcPatternGetBool(pat, OB_SHADOW, 0, &out->shadow) != FcResultMatch)
+ out->shadow = FALSE;
+
+ if (FcPatternGetInteger(pat, OB_SHADOW_OFFSET, 0, &out->offset) !=
+ FcResultMatch)
+ out->offset = 1;
+
+ if (FcPatternGetInteger(pat, OB_SHADOW_ALPHA, 0, &tint) != FcResultMatch)
+ tint = 25;
+ if (tint > 100) tint = 100;
+ else if (tint < -100) tint = -100;
+ out->tint = tint;
+
+ /* setup the layout */
+ pango_layout_set_font_description(out->layout, out->font_desc);
+ pango_layout_set_single_paragraph_mode(out->layout, TRUE);
+ pango_layout_set_ellipsize(out->layout, PANGO_ELLIPSIZE_MIDDLE);
+
+ /* get the ascent and descent */
+ measure_font(inst, out);
+
+ return out;
+}
+
+RrFont *RrFontOpen(const RrInstance *inst, gchar *fontstring)
+{
+ RrFont *out;
+
+ if (!started) {
+ font_startup();
+ started = TRUE;
+ }
+
+ if ((out = openfont(inst, fontstring)))
+ return out;