freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] wl/freetype-demos-support-ot-svg-glyphs-new d7b5b8d 3/


From: Werner Lemberg
Subject: [freetype2-demos] wl/freetype-demos-support-ot-svg-glyphs-new d7b5b8d 3/5: Werner's suggestions
Date: Mon, 3 Jan 2022 13:30:22 -0500 (EST)

branch: wl/freetype-demos-support-ot-svg-glyphs-new
commit d7b5b8d21d08d64a630a2fc879939dd135f7e847
Author: Moazin Khatti <moazinkhatri@gmail.com>
Commit: Werner Lemberg <wl@gnu.org>

    Werner's suggestions
---
 Makefile        |  4 ++--
 src/ftcommon.c  | 14 +++++++-------
 src/rsvg-port.h |  2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 36da010..287328b 100644
--- a/Makefile
+++ b/Makefile
@@ -358,12 +358,12 @@ else
 
   $(OBJ_DIR_2)/ftcommon.$(SO): $(SRC_DIR)/ftcommon.c $(SRC_DIR)/ftcommon.h
          $(COMPILE) $(GRAPH_INCLUDES:%=$I%) \
-                                                                               
 $(LIBRSVG_INCLUDES) \
+                     $(LIBRSVG_INCLUDES) \
                      $T$(subst /,$(COMPILER_SEP),$@ $<)
 
   $(OBJ_DIR_2)/rsvg-port.$(SO): $(SRC_DIR)/rsvg-port.c $(SRC_DIR)/rsvg-port.h
          $(COMPILE) $(GRAPH_INCLUDES:%=$I%) \
-                                                                               
 $(LIBRSVG_INCLUDES) \
+                     $(LIBRSVG_INCLUDES) \
                      $T$(subst /,$(COMPILER_SEP),$@ $<)
 
   $(OBJ_DIR_2)/ftpngout.$(SO): $(SRC_DIR)/ftpngout.c $(SRC_DIR)/ftcommon.h
diff --git a/src/ftcommon.c b/src/ftcommon.c
index 23068b0..a9929a4 100644
--- a/src/ftcommon.c
+++ b/src/ftcommon.c
@@ -29,7 +29,7 @@
 #include FT_FONT_FORMATS_H
 #include FT_OTSVG_H
 
-#include <rsvg_port.h>
+#include <rsvg-port.h>
 
   /* error messages */
 #undef FTERRORS_H_
@@ -340,6 +340,10 @@
   {
     FTDemo_Handle*  handle;
 
+    SVG_RendererHooks  hooks = {(SVG_Lib_Init_Func)rsvg_port_init,
+                                (SVG_Lib_Free_Func)rsvg_port_free,
+                                (SVG_Lib_Render_Func)rsvg_port_render,
+                                
(SVG_Lib_Preset_Slot_Func)rsvg_port_preset_slot};
 
     handle = (FTDemo_Handle *)malloc( sizeof ( FTDemo_Handle ) );
     if ( !handle )
@@ -351,11 +355,6 @@
     if ( error )
       PanicZ( "could not initialize FreeType" );
 
-    SVG_RendererHooks  hooks;
-    hooks.init_svg        = (SVG_Lib_Init_Func)rsvg_port_init;
-    hooks.free_svg        = (SVG_Lib_Free_Func)rsvg_port_free;
-    hooks.render_svg      = (SVG_Lib_Render_Func)rsvg_port_render;
-    hooks.preset_slot     = (SVG_Lib_Preset_Slot_Func)rsvg_port_preset_slot;
     FT_Property_Set( handle->library, "ot-svg", "svg_hooks", &hooks );
 
     error = FTC_Manager_New( handle->library, 0, 0, 0,
@@ -1341,7 +1340,8 @@
 
     error = FT_Err_Ok;
 
-    if ( glyf->format == FT_GLYPH_FORMAT_OUTLINE || glyf->format == 
FT_GLYPH_FORMAT_SVG )
+    if ( glyf->format == FT_GLYPH_FORMAT_OUTLINE ||
+         glyf->format == FT_GLYPH_FORMAT_SVG     )
     {
       FT_Render_Mode  render_mode;
 
diff --git a/src/rsvg-port.h b/src/rsvg-port.h
index 2d6ff25..7d3bcfb 100644
--- a/src/rsvg-port.h
+++ b/src/rsvg-port.h
@@ -24,7 +24,7 @@
 #include <freetype/freetype.h>
 
   /* Different hook functions can persist data by creating a state structure
-   * and putting its address in `library->svg_renderer_state'. Functions can
+   * and putting its address in `library->svg_renderer_state`.  Functions can
    * store and retrieve data from this structure
    */
   typedef struct Rsvg_Port_StateRec_



reply via email to

[Prev in Thread] Current Thread [Next in Thread]