Edit

kc3-lang/freetype/src/autofit/afgsub.h

Branch :

  • Show log

    Commit

  • Author : Werner Lemberg
    Date : 2025-06-13 11:23:14
    Hash : cda418a4
    Message : [autofit] Speed up computation of `af_reverse_character_map_new`. (1/4) Using HarfBuzz's API functions to construct the reverse map is too slow; we have to call `hb_ot_layout_lookup_get_glyph_alternates` far too often because it can only handle a single glyph at a time. For this reason we are going to parse the GSUB table by ourselves. The new non-local functions are `af_parse_gsub` and `af_map_lookup`. * src/autofit/afgsub.c, src/autofit/afgsub.h: New files for parsing, validating, and mapping the `SingleSubst` and `AlternateSubst` subtable types of a GSUB table. * src/autofit/autofit.c, src/autofit/rules.mk (AUTOF_DRV_SRC): Updated.

  • src/autofit/afgsub.h
  • /****************************************************************************
     *
     * afgsub.h
     *
     *   Auto-fitter routines to parse the GSUB table (header).
     *
     * Copyright (C) 2025 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.
     *
     */
    
    #ifndef AFGSUB_H_
    #define AFGSUB_H_
    
    #include "afglobal.h"
    
    
    FT_BEGIN_HEADER
    
      FT_LOCAL( void )
      af_parse_gsub( AF_FaceGlobals  globals );
    
      FT_LOCAL( FT_Error )
      af_map_lookup( AF_FaceGlobals  globals,
                     FT_Hash         map,
                     FT_UInt32       lookup_offset );
    
    FT_END_HEADER
    
    #endif /* AFGSUB_H_ */
    
    /* END */