Merge branch 'ft-no-fc' into 'master'

Fix FreeType build failure when Fontconfig is disabled

See merge request cairo/cairo!564
This commit is contained in:
Adrian Johnson 2024-06-11 21:39:10 +00:00
commit 0700bb78a2
2 changed files with 8 additions and 7 deletions

View file

@ -271,7 +271,8 @@ mingw-32 build:
script:
- mkdir builddir
- cd builddir
- mingw32-meson --default-library=both
# Test building with FreeType enabled and Fontconfig disabled
- mingw32-meson --default-library=both -Dfontconfig=disabled
- ninja install
artifacts:
expire_in: "7 days"

View file

@ -1417,7 +1417,7 @@ _render_glyph_outline (FT_Face face,
cairo_font_options_t *font_options,
cairo_image_surface_t **surface)
{
int rgba = FC_RGBA_UNKNOWN;
cairo_subpixel_order_t rgba = CAIRO_SUBPIXEL_ORDER_DEFAULT;
int lcd_filter = FT_LCD_FILTER_DEFAULT;
FT_GlyphSlot glyphslot = face->glyph;
FT_Outline *outline = &glyphslot->outline;
@ -1518,16 +1518,16 @@ _render_glyph_outline (FT_Face face,
switch (render_mode) {
case FT_RENDER_MODE_LCD:
if (font_options->subpixel_order == CAIRO_SUBPIXEL_ORDER_BGR)
rgba = FC_RGBA_BGR;
rgba = CAIRO_SUBPIXEL_ORDER_BGR;
else
rgba = FC_RGBA_RGB;
rgba = CAIRO_SUBPIXEL_ORDER_RGB;
break;
case FT_RENDER_MODE_LCD_V:
if (font_options->subpixel_order == CAIRO_SUBPIXEL_ORDER_VBGR)
rgba = FC_RGBA_VBGR;
rgba = CAIRO_SUBPIXEL_ORDER_VBGR;
else
rgba = FC_RGBA_VRGB;
rgba = CAIRO_SUBPIXEL_ORDER_VRGB;
break;
case FT_RENDER_MODE_MONO:
@ -1559,7 +1559,7 @@ _render_glyph_outline (FT_Face face,
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
_fill_xrender_bitmap (&bitmap, face->glyph, render_mode,
(rgba == FC_RGBA_BGR || rgba == FC_RGBA_VBGR));
(rgba == CAIRO_SUBPIXEL_ORDER_BGR || rgba == CAIRO_SUBPIXEL_ORDER_VBGR));
/* Note:
* _get_bitmap_surface will free bitmap.buffer if there is an error