godot/thirdparty/freetype/src/autofit/afmodule.c

/****************************************************************************
 *
 * afmodule.c
 *
 *   Auto-fitter module implementation (body).
 *
 * Copyright (C) 2003-2023 by
 * David Turner, Robert Wilhelm, and Werner Lemberg.
 *
 * 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 "afglobal.h"
#include "afmodule.h"
#include "afloader.h"
#include "aferrors.h"

#ifdef FT_DEBUG_AUTOFIT

#ifndef FT_MAKE_OPTION_SINGLE_OBJECT

#ifdef __cplusplus
  extern "C" {
#endif
  extern void
  af_glyph_hints_dump_segments( AF_GlyphHints  hints,
                                FT_Bool        to_stdout );
  extern void
  af_glyph_hints_dump_points( AF_GlyphHints  hints,
                              FT_Bool        to_stdout );
  extern void
  af_glyph_hints_dump_edges( AF_GlyphHints  hints,
                             FT_Bool        to_stdout );
#ifdef __cplusplus
  }
#endif

#endif

  int  af_debug_disable_horz_hints_;
  int  af_debug_disable_vert_hints_;
  int  af_debug_disable_blue_hints_;

  /* we use a global object instead of a local one for debugging */
  static AF_GlyphHintsRec  af_debug_hints_rec_[1];

  void*  af_debug_hints_ = af_debug_hints_rec_;
#endif

#include <freetype/internal/ftobjs.h>
#include <freetype/internal/ftdebug.h>
#include <freetype/ftdriver.h>
#include <freetype/internal/services/svprop.h>


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


  static FT_Error
  af_property_get_face_globals( FT_Face          face,
                                AF_FaceGlobals*  aglobals,
                                AF_Module        module )
  {}


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


  static FT_Error
  af_property_get( FT_Module    ft_module,
                   const char*  property_name,
                   void*        value )
  {}


  FT_DEFINE_SERVICE_PROPERTIESREC(
    af_service_properties,

    af_property_set,  /* FT_Properties_SetFunc set_property */
    af_property_get   /* FT_Properties_GetFunc get_property */
  )


  FT_DEFINE_SERVICEDESCREC1(
    af_services,

    FT_SERVICE_ID_PROPERTIES, &af_service_properties )


  FT_CALLBACK_DEF( FT_Module_Interface )
  af_get_interface( FT_Module    module,
                    const char*  module_interface )
  {}


  FT_CALLBACK_DEF( FT_Error )
  af_autofitter_init( FT_Module  ft_module )      /* AF_Module */
  {}


  FT_CALLBACK_DEF( void )
  af_autofitter_done( FT_Module  ft_module )      /* AF_Module */
  {}


  FT_CALLBACK_DEF( FT_Error )
  af_autofitter_load_glyph( FT_AutoHinter  module_,
                            FT_GlyphSlot   slot,
                            FT_Size        size,
                            FT_UInt        glyph_index,
                            FT_Int32       load_flags )
  {}


  FT_DEFINE_AUTOHINTER_INTERFACE(
    af_autofitter_interface,

    NULL,                     /* FT_AutoHinter_GlobalResetFunc reset_face        */
    NULL,                     /* FT_AutoHinter_GlobalGetFunc   get_global_hints  */
    NULL,                     /* FT_AutoHinter_GlobalDoneFunc  done_global_hints */
    af_autofitter_load_glyph  /* FT_AutoHinter_GlyphLoadFunc   load_glyph        */
  )

  FT_DEFINE_MODULE(
    autofit_module_class,

    FT_MODULE_HINTER,
    sizeof ( AF_ModuleRec ),

    "autofitter",
    0x10000L,   /* version 1.0 of the autofitter  */
    0x20000L,   /* requires FreeType 2.0 or above */

    (const void*)&af_autofitter_interface,

    af_autofitter_init,  /* FT_Module_Constructor module_init   */
    af_autofitter_done,  /* FT_Module_Destructor  module_done   */
    af_get_interface     /* FT_Module_Requester   get_interface */
  )


/* END */