3 commits - meson.build src/cairo-fontconfig-private.h src/cairo-ft-font.c src/cairo-png.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun May 26 23:09:55 UTC 2024


 meson.build                    |    4 +++-
 src/cairo-fontconfig-private.h |   26 --------------------------
 src/cairo-ft-font.c            |   34 +---------------------------------
 src/cairo-png.c                |    7 +------
 4 files changed, 5 insertions(+), 66 deletions(-)

New commits:
commit 09779a7e5852ba522d911ba97e887f56cd926307
Merge: 9fcfdce21 b3656ed59
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sun May 26 23:09:52 2024 +0000

    Merge branch 'update-fontconfig-and-libpng' into 'master'
    
    Update fontconfig and libpng versions
    
    See merge request cairo/cairo!558

commit b3656ed5962d944c6921209fa238f5e62c6e364c
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sat May 25 10:25:51 2024 +0930

    Update required libpng version

diff --git a/meson.build b/meson.build
index 54e34d6bc..501087b86 100644
--- a/meson.build
+++ b/meson.build
@@ -8,6 +8,7 @@ project('cairo', 'c', 'cpp',
 freetype_required_version = '>= 23.0.17' # Release version 2.10
 freetype_colrv1_required_version = '>= 25.0.19' # Release version 2.13
 fontconfig_required_version = '>= 2.13.0'
+libpng_required_version = '>= 1.4.0'
 xrender_required_version = '>= 0.6'
 xcb_required_version = '>= 1.6'
 xcb_render_required_version = '>= 1.6'
@@ -234,6 +235,7 @@ endif
 
 png_dep = dependency('libpng',
   required: get_option('png'),
+  version: libpng_required_version,
   fallback: ['libpng', 'libpng_dep']
 )
 if png_dep.found()
diff --git a/src/cairo-png.c b/src/cairo-png.c
index 63e3c4cdb..287f70545 100644
--- a/src/cairo-png.c
+++ b/src/cairo-png.c
@@ -730,13 +730,8 @@ read_png (struct png_read_closure_t *png_closure)
         png_set_palette_to_rgb (png);
 
     /* expand gray bit depth if needed */
-    if (color_type == PNG_COLOR_TYPE_GRAY) {
-#if PNG_LIBPNG_VER >= 10209
+    if (color_type == PNG_COLOR_TYPE_GRAY)
         png_set_expand_gray_1_2_4_to_8 (png);
-#else
-        png_set_gray_1_2_4_to_8 (png);
-#endif
-    }
 
     /* transform transparency to alpha */
     if (png_get_valid (png, info, PNG_INFO_tRNS))
commit bc4dfe51d2a01285b883b5672df34113bfb923c5
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sat May 25 10:19:30 2024 +0930

    Update required fontconfig version

diff --git a/meson.build b/meson.build
index 3a5820640..54e34d6bc 100644
--- a/meson.build
+++ b/meson.build
@@ -7,7 +7,7 @@ project('cairo', 'c', 'cpp',
 
 freetype_required_version = '>= 23.0.17' # Release version 2.10
 freetype_colrv1_required_version = '>= 25.0.19' # Release version 2.13
-fontconfig_required_version = '>= 2.2.95'
+fontconfig_required_version = '>= 2.13.0'
 xrender_required_version = '>= 0.6'
 xcb_required_version = '>= 1.6'
 xcb_render_required_version = '>= 1.6'
diff --git a/src/cairo-fontconfig-private.h b/src/cairo-fontconfig-private.h
index ea873abe7..15dc03281 100644
--- a/src/cairo-fontconfig-private.h
+++ b/src/cairo-fontconfig-private.h
@@ -49,30 +49,4 @@
 #include <fontconfig/fcfreetype.h>
 #endif
 
-/* sub-pixel order */
-#ifndef FC_RGBA_UNKNOWN
-#define FC_RGBA_UNKNOWN	    0
-#define FC_RGBA_RGB	    1
-#define FC_RGBA_BGR	    2
-#define FC_RGBA_VRGB	    3
-#define FC_RGBA_VBGR	    4
-#define FC_RGBA_NONE	    5
-#endif
-
-/* hinting style */
-#ifndef FC_HINT_NONE
-#define FC_HINT_NONE        0
-#define FC_HINT_SLIGHT      1
-#define FC_HINT_MEDIUM      2
-#define FC_HINT_FULL        3
-#endif
-
-/* LCD filter */
-#ifndef FC_LCD_NONE
-#define FC_LCD_NONE	    0
-#define FC_LCD_DEFAULT	    1
-#define FC_LCD_LIGHT	    2
-#define FC_LCD_LEGACY	    3
-#endif
-
 #endif /* _CAIRO_FONTCONFIG_PRIVATE_H */
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index fd573bf35..2c446a5d6 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -75,18 +75,6 @@
 #define access(p, m) 0
 #endif
 
-/* Fontconfig version older than 2.6 didn't have these options */
-#ifndef FC_LCD_FILTER
-#define FC_LCD_FILTER	"lcdfilter"
-#endif
-/* Some Ubuntu versions defined FC_LCD_FILTER without defining the following */
-#ifndef FC_LCD_NONE
-#define FC_LCD_NONE	0
-#define FC_LCD_DEFAULT	1
-#define FC_LCD_LIGHT	2
-#define FC_LCD_LEGACY	3
-#endif
-
 /*  FreeType version older than 2.11 does not have the FT_RENDER_MODE_SDF enum value in FT_Render_Mode */
 #if FREETYPE_MAJOR > 2 || (FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11)
 #define HAVE_FT_RENDER_MODE_SDF 1
@@ -1781,19 +1769,13 @@ _get_pattern_ft_options (FcPattern *pattern, cairo_ft_options_t *ret)
     FcBool antialias, vertical_layout, hinting, autohint, bitmap, embolden;
     cairo_ft_options_t ft_options;
     int rgba;
-#ifdef FC_HINT_STYLE
     int hintstyle;
-#endif
     char *variations;
 
     _cairo_font_options_init_default (&ft_options.base);
     ft_options.load_flags = FT_LOAD_DEFAULT;
     ft_options.synth_flags = 0;
 
-#ifndef FC_EMBEDDED_BITMAP
-#define FC_EMBEDDED_BITMAP "embeddedbitmap"
-#endif
-
     /* Check whether to force use of embedded bitmaps */
     if (FcPatternGetBool (pattern,
 			  FC_EMBEDDED_BITMAP, 0, &bitmap) != FcResultMatch)
@@ -1803,7 +1785,7 @@ _get_pattern_ft_options (FcPattern *pattern, cairo_ft_options_t *ret)
     if (FcPatternGetBool (pattern,
 			  FC_ANTIALIAS, 0, &antialias) != FcResultMatch)
 	antialias = FcTrue;
-    
+
     if (antialias) {
 	cairo_subpixel_order_t subpixel_order;
 	int lcd_filter;
@@ -1861,7 +1843,6 @@ _get_pattern_ft_options (FcPattern *pattern, cairo_ft_options_t *ret)
 	    }
 	}
 
-#ifdef FC_HINT_STYLE
 	if (FcPatternGetInteger (pattern,
 				 FC_HINT_STYLE, 0, &hintstyle) != FcResultMatch)
 	    hintstyle = FC_HINT_FULL;
@@ -1884,11 +1865,6 @@ _get_pattern_ft_options (FcPattern *pattern, cairo_ft_options_t *ret)
 	    ft_options.base.hint_style = CAIRO_HINT_STYLE_FULL;
 	    break;
 	}
-#else /* !FC_HINT_STYLE */
-	if (!hinting) {
-	    ft_options.base.hint_style = CAIRO_HINT_STYLE_NONE;
-	}
-#endif /* FC_HINT_STYLE */
 
 	/* Force embedded bitmaps off if no hinting requested */
 	if (ft_options.base.hint_style == CAIRO_HINT_STYLE_NONE)
@@ -1916,9 +1892,6 @@ _get_pattern_ft_options (FcPattern *pattern, cairo_ft_options_t *ret)
     if (vertical_layout)
 	ft_options.load_flags |= FT_LOAD_VERTICAL_LAYOUT;
 
-#ifndef FC_EMBOLDEN
-#define FC_EMBOLDEN "embolden"
-#endif
     if (FcPatternGetBool (pattern,
 			  FC_EMBOLDEN, 0, &embolden) != FcResultMatch)
 	embolden = FcFalse;
@@ -1926,9 +1899,6 @@ _get_pattern_ft_options (FcPattern *pattern, cairo_ft_options_t *ret)
     if (embolden)
 	ft_options.synth_flags |= CAIRO_FT_SYNTHESIZE_BOLD;
 
-#ifndef FC_FONT_VARIATIONS
-#define FC_FONT_VARIATIONS "fontvariations"
-#endif
     if (FcPatternGetString (pattern, FC_FONT_VARIATIONS, 0, (FcChar8 **) &variations) == FcResultMatch) {
       ft_options.base.variations = strdup (variations);
     }
@@ -4251,7 +4221,6 @@ _cairo_ft_font_options_substitute (const cairo_font_options_t *options,
 		return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 	}
 
-#ifdef FC_HINT_STYLE
 	if (FcPatternGet (pattern, FC_HINT_STYLE, 0, &v) == FcResultNoMatch)
 	{
 	    int hint_style;
@@ -4276,7 +4245,6 @@ _cairo_ft_font_options_substitute (const cairo_font_options_t *options,
 	    if (! FcPatternAddInteger (pattern, FC_HINT_STYLE, hint_style))
 		return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 	}
-#endif
     }
 
     return CAIRO_STATUS_SUCCESS;


More information about the cairo-commit mailing list