Branch
Hash :
cda418a4
Author :
Date :
2025-06-13T11:23:14
[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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
/****************************************************************************
*
* 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 */