[vlc-commits] freetype: replace deprecated constants

Francois Cartegnie git at videolan.org
Mon Aug 17 23:43:01 CEST 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jul 31 15:13:31 2020 +0200| [dfb628f9a57d26844361806e4a5cc7c5bbba13e0] | committer: Francois Cartegnie

freetype: replace deprecated constants

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dfb628f9a57d26844361806e4a5cc7c5bbba13e0
---

 modules/text_renderer/freetype/freetype.h    | 10 ++++++++++
 modules/text_renderer/freetype/text_layout.c |  6 +++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/modules/text_renderer/freetype/freetype.h b/modules/text_renderer/freetype/freetype.h
index f0ed9d8d7f..847616062f 100644
--- a/modules/text_renderer/freetype/freetype.h
+++ b/modules/text_renderer/freetype/freetype.h
@@ -48,6 +48,8 @@
 #include FT_STROKER_H
 
 /* Consistency between Freetype versions and platforms */
+#define MAKE_VERSION(a,b,c)     (a*0x100 | b * 0x10 | c)
+#define FREETYPE_VERSION        MAKE_VERSION(FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH)
 #define FT_FLOOR(X)     ((X & -64) >> 6)
 #define FT_CEIL(X)      (((X + 63) & -64) >> 6)
 #ifndef FT_MulFix
@@ -66,6 +68,14 @@ typedef uint32_t uni_char_t;
 # endif
 #endif
 
+#if FREETYPE_VERSION < MAKE_VERSION(2,1,5)
+  #define FT_GLYPH_BBOX_UNSCALED    ft_glyph_bbox_unscaled
+  #define FT_GLYPH_BBOX_SUBPIXELS   ft_glyph_bbox_subpixels
+  #define FT_GLYPH_BBOX_GRIDFIT     ft_glyph_bbox_gridfit
+  #define FT_GLYPH_BBOX_TRUNCATE    ft_glyph_bbox_truncate
+  #define FT_GLYPH_BBOX_PIXELS      ft_glyph_bbox_pixels
+#endif
+
 typedef struct vlc_font_select_t vlc_font_select_t;
 
 /*****************************************************************************
diff --git a/modules/text_renderer/freetype/text_layout.c b/modules/text_renderer/freetype/text_layout.c
index 989fd9fc12..c3f5072854 100644
--- a/modules/text_renderer/freetype/text_layout.c
+++ b/modules/text_renderer/freetype/text_layout.c
@@ -1233,7 +1233,7 @@ static int LayoutLine( filter_t *p_filter,
                                     &pen_shadow, 0 ) )
                 p_bitmaps->p_shadow = 0;
             else
-                FT_Glyph_Get_CBox( p_bitmaps->p_shadow, ft_glyph_bbox_pixels,
+                FT_Glyph_Get_CBox( p_bitmaps->p_shadow, FT_GLYPH_BBOX_PIXELS,
                                    &p_bitmaps->shadow_bbox );
         }
         if( p_bitmaps->p_glyph )
@@ -1249,7 +1249,7 @@ static int LayoutLine( filter_t *p_filter,
                 continue;
             }
             else
-                FT_Glyph_Get_CBox( p_bitmaps->p_glyph, ft_glyph_bbox_pixels,
+                FT_Glyph_Get_CBox( p_bitmaps->p_glyph, FT_GLYPH_BBOX_PIXELS,
                                    &p_bitmaps->glyph_bbox );
         }
         if( p_bitmaps->p_outline )
@@ -1261,7 +1261,7 @@ static int LayoutLine( filter_t *p_filter,
                 p_bitmaps->p_outline = 0;
             }
             else
-                FT_Glyph_Get_CBox( p_bitmaps->p_outline, ft_glyph_bbox_pixels,
+                FT_Glyph_Get_CBox( p_bitmaps->p_outline, FT_GLYPH_BBOX_PIXELS,
                                    &p_bitmaps->outline_bbox );
         }
 



More information about the vlc-commits mailing list