mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 00:32:59 +00:00
[config] Add HB_NO_OT_FONT_ADVANCE_CACHE
Part of https://github.com/harfbuzz/harfbuzz/issues/4220
This commit is contained in:
parent
8831ba7f55
commit
7e676cb4cf
2 changed files with 5 additions and 4 deletions
|
@ -190,6 +190,7 @@
|
|||
#ifdef HB_MINIMIZE_MEMORY_USAGE
|
||||
#define HB_NO_GDEF_CACHE
|
||||
#define HB_NO_OT_LAYOUT_LOOKUP_CACHE
|
||||
#define HB_NO_OT_FONT_ADVANCE_CACHE
|
||||
#define HB_NO_OT_FONT_CMAP_CACHE
|
||||
#endif
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ hb_ot_get_glyph_h_advances (hb_font_t* font, void* font_data,
|
|||
|
||||
hb_position_t *orig_first_advance = first_advance;
|
||||
|
||||
#ifndef HB_NO_VAR
|
||||
#if !defined(HB_NO_VAR) && !defined(HB_NO_OT_FONT_ADVANCE_CACHE)
|
||||
const OT::HVAR &HVAR = *hmtx.var_table;
|
||||
const OT::VariationStore &varStore = &HVAR + HVAR.varStore;
|
||||
OT::VariationStore::cache_t *varStore_cache = font->num_coords * count >= 128 ? varStore.create_cache () : nullptr;
|
||||
|
@ -274,7 +274,7 @@ hb_ot_get_glyph_h_advances (hb_font_t* font, void* font_data,
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef HB_NO_VAR
|
||||
#if !defined(HB_NO_VAR) && !defined(HB_NO_OT_FONT_ADVANCE_CACHE)
|
||||
OT::VariationStore::destroy_cache (varStore_cache);
|
||||
#endif
|
||||
|
||||
|
@ -309,7 +309,7 @@ hb_ot_get_glyph_v_advances (hb_font_t* font, void* font_data,
|
|||
|
||||
if (vmtx.has_data ())
|
||||
{
|
||||
#ifndef HB_NO_VAR
|
||||
#if !defined(HB_NO_VAR) && !defined(HB_NO_OT_FONT_ADVANCE_CACHE)
|
||||
const OT::VVAR &VVAR = *vmtx.var_table;
|
||||
const OT::VariationStore &varStore = &VVAR + VVAR.varStore;
|
||||
OT::VariationStore::cache_t *varStore_cache = font->num_coords ? varStore.create_cache () : nullptr;
|
||||
|
@ -324,7 +324,7 @@ hb_ot_get_glyph_v_advances (hb_font_t* font, void* font_data,
|
|||
first_advance = &StructAtOffsetUnaligned<hb_position_t> (first_advance, advance_stride);
|
||||
}
|
||||
|
||||
#ifndef HB_NO_VAR
|
||||
#if !defined(HB_NO_VAR) && !defined(HB_NO_OT_FONT_ADVANCE_CACHE)
|
||||
OT::VariationStore::destroy_cache (varStore_cache);
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue