summaryrefslogtreecommitdiff
path: root/src/cairo-ft-font.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2021-09-17 06:25:07 +0930
committerAdrian Johnson <ajohnson@redneon.com>2021-09-17 06:25:07 +0930
commit23815978cc6eb3b681788ab43c4d8f5979a39869 (patch)
tree11c01b67478887699cd56c4dd444445f64abd0c2 /src/cairo-ft-font.c
parentfea24631076f74a3202ba0233be85588ae28db36 (diff)
parent4c520fea2124f1d2d200ca86045f1de138809148 (diff)
downloadcairo-23815978cc6eb3b681788ab43c4d8f5979a39869.tar.gz
Merge branch 'master' into color-font-foreground-color
Diffstat (limited to 'src/cairo-ft-font.c')
-rw-r--r--src/cairo-ft-font.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 66300dd03..683ee916d 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -93,6 +93,11 @@
#define FT_LCD_FILTER_LEGACY 16
#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
+#endif
+
#define DOUBLE_FROM_26_6(t) ((double)(t) / 64.0)
#define DOUBLE_TO_16_16(d) ((FT_Fixed)((d) * 65536.0))
#define DOUBLE_FROM_16_16(t) ((double)(t) / 65536.0)
@@ -1498,6 +1503,9 @@ _render_glyph_outline (FT_Face face,
case FT_RENDER_MODE_LIGHT:
case FT_RENDER_MODE_NORMAL:
case FT_RENDER_MODE_MAX:
+#if HAVE_FT_RENDER_MODE_SDF
+ case FT_RENDER_MODE_SDF:
+#endif
default:
format = CAIRO_FORMAT_A8;
break;
@@ -1531,6 +1539,9 @@ _render_glyph_outline (FT_Face face,
case FT_RENDER_MODE_LIGHT:
case FT_RENDER_MODE_NORMAL:
case FT_RENDER_MODE_MAX:
+#if HAVE_FT_RENDER_MODE_SDF
+ case FT_RENDER_MODE_SDF:
+#endif
default:
break;
}
@@ -3277,8 +3288,6 @@ _cairo_ft_font_face_get_implementation (void *abstract_face,
const cairo_matrix_t *ctm,
const cairo_font_options_t *options)
{
- cairo_ft_font_face_t *font_face = abstract_face;
-
/* The handling of font options is different depending on how the
* font face was created. When the user creates a font face with
* cairo_ft_font_face_create_for_ft_face(), then the load flags
@@ -3290,6 +3299,8 @@ _cairo_ft_font_face_get_implementation (void *abstract_face,
*/
#if CAIRO_HAS_FC_FONT
+ cairo_ft_font_face_t *font_face = abstract_face;
+
/* If we have an unresolved pattern, resolve it and create
* unscaled font. Otherwise, use the ones stored in font_face.
*/