Commit 3b9196c4673534a44df6e56e4ab51a137e48f482

Anuj Verma 2020-08-16T09:06:59

[base] Allow renderers of different formats. * src/base/ftobjs.c (FT_Render_Glyph_Internal): Do not return if the glyph's slot format is `FT_GLYPH_FORMAT_BITMAP`. The forthcoming 'bsdf' renderer will require bitmaps for processing. * src/base/ftobjs.c (ft_add_renderer, ft_remove_renderer): Remove renderer's glyph format check before adding and removing them. The 'bsdf' renderer will have a format `FT_GLYPH_FORMAT_BITMAP`.

diff --git a/ChangeLog b/ChangeLog
index 6cc94fd..007d833 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2020-08-16  Anuj Verma  <anujv@iitbhilai.ac.in>
+
+	[base] Allow renderers of different formats.
+
+	* src/base/ftobjs.c (FT_Render_Glyph_Internal): Do not return if the
+	glyph's slot format is `FT_GLYPH_FORMAT_BITMAP`.  The forthcoming
+	'bsdf' renderer will require bitmaps for processing.
+
+	* src/base/ftobjs.c (ft_add_renderer, ft_remove_renderer): Remove
+	renderer's glyph format check before adding and removing them.  The
+	'bsdf' renderer will have a format `FT_GLYPH_FORMAT_BITMAP`.
+
 2020-12-23  Werner Lemberg  <wl@gnu.org>
 
 	* builds/windows/detect.mk (COPY): Make it work with `shell`.
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 83351ad..4566203 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -4412,8 +4412,7 @@
       render->glyph_format = clazz->glyph_format;
 
       /* allocate raster object if needed */
-      if ( clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE &&
-           clazz->raster_class->raster_new                )
+      if ( clazz->raster_class->raster_new )
       {
         error = clazz->raster_class->raster_new( memory, &render->raster );
         if ( error )
@@ -4460,8 +4459,7 @@
 
 
       /* release raster object, if any */
-      if ( render->clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE &&
-           render->raster                                         )
+      if ( render->raster )
         render->clazz->raster_class->raster_done( render->raster );
 
       /* remove from list */
@@ -4556,9 +4554,6 @@
 
     switch ( slot->format )
     {
-    case FT_GLYPH_FORMAT_BITMAP:   /* already a bitmap, don't do anything */
-      break;
-
     default:
       if ( slot->internal->load_flags & FT_LOAD_COLOR )
       {