godot/thirdparty/freetype/src/svg/ftsvg.c

/****************************************************************************
 *
 * ftsvg.c
 *
 *   The FreeType SVG renderer interface (body).
 *
 * Copyright (C) 2022-2023 by
 * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
 *
 * This file is part of the FreeType project, and may only be used,
 * modified, and distributed under the terms of the FreeType project
 * license, LICENSE.TXT.  By continuing to use, modify, or distribute
 * this file you indicate that you have read the license and
 * understand and accept it fully.
 *
 */

#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftserv.h>
#include <freetype/internal/services/svprop.h>
#include <freetype/otsvg.h>
#include <freetype/internal/svginterface.h>
#include <freetype/ftbbox.h>

#include "ftsvg.h"
#include "svgtypes.h"


  /**************************************************************************
   *
   * The macro FT_COMPONENT is used in trace mode.  It is an implicit
   * parameter of the FT_TRACE() and FT_ERROR() macros, usued to print/log
   * messages during execution.
   */
#undef  FT_COMPONENT
#define FT_COMPONENT


#ifdef FT_CONFIG_OPTION_SVG

  /* ft_svg_init */
  static FT_Error
  ft_svg_init( FT_Module  module )
  {}


  static void
  ft_svg_done( FT_Module  module )
  {}


  static FT_Error
  ft_svg_preset_slot( FT_Module     module,
                      FT_GlyphSlot  slot,
                      FT_Bool       cache )
  {}


  static FT_Error
  ft_svg_render( FT_Renderer       renderer,
                 FT_GlyphSlot      slot,
                 FT_Render_Mode    mode,
                 const FT_Vector*  origin )
  {}


  static const SVG_Interface  svg_interface =;


  static FT_Error
  ft_svg_property_set( FT_Module    module,
                       const char*  property_name,
                       const void*  value,
                       FT_Bool      value_is_string )
  {}


  static FT_Error
  ft_svg_property_get( FT_Module    module,
                       const char*  property_name,
                       void*        value )
  {}


  FT_DEFINE_SERVICE_PROPERTIESREC(
    ft_svg_service_properties,

    ft_svg_property_set,  /* FT_Properties_SetFunc set_property */
    ft_svg_property_get   /* FT_Properties_GetFunc get_property */
  )


  FT_DEFINE_SERVICEDESCREC1(
    ft_svg_services,
    FT_SERVICE_ID_PROPERTIES, &ft_svg_service_properties )


  FT_CALLBACK_DEF( FT_Module_Interface )
  ft_svg_get_interface( FT_Module    module,
                        const char*  ft_svg_interface )
  {}


  static FT_Error
  ft_svg_transform( FT_Renderer       renderer,
                    FT_GlyphSlot      slot,
                    const FT_Matrix*  _matrix,
                    const FT_Vector*  _delta )
  {}

#endif /* FT_CONFIG_OPTION_SVG */


#ifdef FT_CONFIG_OPTION_SVG
#define PUT_SVG_MODULE( a )
#define SVG_GLYPH_FORMAT
#else
#define PUT_SVG_MODULE
#define SVG_GLYPH_FORMAT
#endif


  FT_DEFINE_RENDERER(
    ft_svg_renderer_class,

      FT_MODULE_RENDERER,
      sizeof ( SVG_RendererRec ),

      "ot-svg",
      0x10000L,
      0x20000L,

      (const void*)PUT_SVG_MODULE( &svg_interface ), /* module specific interface */

      PUT_SVG_MODULE( ft_svg_init ),           /* FT_Module_Constructor module_init   */
      PUT_SVG_MODULE( ft_svg_done ),           /* FT_Module_Destructor  module_done   */
      PUT_SVG_MODULE( ft_svg_get_interface ),  /* FT_Module_Requester   get_interface */

      SVG_GLYPH_FORMAT,

      PUT_SVG_MODULE( ft_svg_render ),     /* FT_Renderer_RenderFunc    render_glyph    */
      PUT_SVG_MODULE( ft_svg_transform ),  /* FT_Renderer_TransformFunc transform_glyph */
      NULL,                                /* FT_Renderer_GetCBoxFunc   get_glyph_cbox  */
      NULL,                                /* FT_Renderer_SetModeFunc   set_mode        */
      NULL                                 /* FT_Raster_Funcs*          raster_class    */
  )


/* END */