Skip to content
Snippets Groups Projects

Add support for BGRA glyphs and scaling

Closed Maxime Coste requested to merge mawww/libxft:bgra-glyphs into master
Files
4
+ 16
2
@@ -523,7 +523,7 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
/*
* Compute glyph load flags
*/
fi->load_flags = FT_LOAD_DEFAULT;
fi->load_flags = FT_LOAD_DEFAULT | FT_LOAD_COLOR;
#ifndef XFT_EMBEDDED_BITMAP
#define XFT_EMBEDDED_BITMAP "embeddedbitmap"
@@ -775,6 +775,7 @@ XftFontOpenInfo (Display *dpy,
FcChar32 hash_value;
FcChar32 rehash_value;
FcBool antialias;
FcBool color;
int max_glyph_memory;
int alloc_size;
int ascent, descent, height;
@@ -831,12 +832,18 @@ XftFontOpenInfo (Display *dpy,
if (!(face->face_flags & FT_FACE_FLAG_SCALABLE))
antialias = FcFalse;
color = FT_HAS_COLOR(face) ? FcTrue : FcFalse;
/*
* Find the appropriate picture format
*/
if (fi->render)
{
if (antialias)
if (color)
{
format = XRenderFindStandardFormat (dpy, PictStandardARGB32);
}
else if (antialias)
{
switch (fi->rgba) {
case FC_RGBA_RGB:
@@ -854,7+861,7 @@
{
format = XRenderFindStandardFormat (dpy, PictStandardA1);
}
if (!format)
goto bail2;
}
@@ -968,7+975,7 @@
* which doesn't happen in XftFontInfoFill
*/
font->info.antialias = antialias;
/*
* Set color value, which is only known once the
* font was loaded
*/
font->info.color = color;
/*
* bump XftFile reference count
*/
Loading