|
|
|
@ -29,13 +29,13 @@ |
|
|
|
|
#include "hb-machinery.hh" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const hb_shaper_entry_t all_shapers[] = { |
|
|
|
|
static const hb_shaper_entry_t _hb_all_shapers[] = { |
|
|
|
|
#define HB_SHAPER_IMPLEMENT(name) {#name, _hb_##name##_shape}, |
|
|
|
|
#include "hb-shaper-list.hh" |
|
|
|
|
#undef HB_SHAPER_IMPLEMENT |
|
|
|
|
}; |
|
|
|
|
#ifndef HB_NO_SHAPER |
|
|
|
|
static_assert (0 != ARRAY_LENGTH_CONST (all_shapers), "No shaper enabled."); |
|
|
|
|
static_assert (0 != ARRAY_LENGTH_CONST (_hb_all_shapers), "No shaper enabled."); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
static inline void free_static_shapers (); |
|
|
|
@ -49,11 +49,11 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_ |
|
|
|
|
if (!env || !*env) |
|
|
|
|
return nullptr; |
|
|
|
|
|
|
|
|
|
hb_shaper_entry_t *shapers = (hb_shaper_entry_t *) hb_calloc (1, sizeof (all_shapers)); |
|
|
|
|
hb_shaper_entry_t *shapers = (hb_shaper_entry_t *) hb_calloc (1, sizeof (_hb_all_shapers)); |
|
|
|
|
if (unlikely (!shapers)) |
|
|
|
|
return nullptr; |
|
|
|
|
|
|
|
|
|
memcpy (shapers, all_shapers, sizeof (all_shapers)); |
|
|
|
|
memcpy (shapers, _hb_all_shapers, sizeof (_hb_all_shapers)); |
|
|
|
|
|
|
|
|
|
/* Reorder shaper list to prefer requested shapers. */ |
|
|
|
|
unsigned int i = 0; |
|
|
|
@ -64,7 +64,7 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_ |
|
|
|
|
if (!end) |
|
|
|
|
end = p + strlen (p); |
|
|
|
|
|
|
|
|
|
for (unsigned int j = i; j < ARRAY_LENGTH (all_shapers); j++) |
|
|
|
|
for (unsigned int j = i; j < ARRAY_LENGTH (_hb_all_shapers); j++) |
|
|
|
|
if (end - p == (int) strlen (shapers[j].name) && |
|
|
|
|
0 == strncmp (shapers[j].name, p, end - p)) |
|
|
|
|
{ |
|
|
|
@ -86,7 +86,7 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_ |
|
|
|
|
return shapers; |
|
|
|
|
} |
|
|
|
|
static void destroy (const hb_shaper_entry_t *p) { hb_free ((void *) p); } |
|
|
|
|
static const hb_shaper_entry_t *get_null () { return all_shapers; } |
|
|
|
|
static const hb_shaper_entry_t *get_null () { return _hb_all_shapers; } |
|
|
|
|
} static_shapers; |
|
|
|
|
|
|
|
|
|
static inline |
|
|
|
|