Merge branch 'master' into var-subset

This commit is contained in:
Michiharu Ariza 2019-03-26 17:13:31 -07:00
commit bcd689bb10
8 changed files with 41 additions and 44 deletions

View File

@ -36,7 +36,7 @@ ChangeLog: $(srcdir)/ChangeLog
$(srcdir)/ChangeLog:
$(AM_V_GEN) if test -d "$(top_srcdir)/.git"; then \
(GIT_DIR=$(top_srcdir)/.git \
$(GIT) log $(CHANGELOG_RANGE) --stat) | fmt --split-only > $@.tmp \
$(GIT) log $(CHANGELOG_RANGE) --stat) > $@.tmp \
&& mv -f $@.tmp "$(srcdir)/ChangeLog" \
|| ($(RM) $@.tmp; \
echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \

View File

@ -136,6 +136,7 @@
<index id="api-index-full"><title>API Index</title><xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include></index>
<index id="deprecated-api-index" role="deprecated"><title>Index of deprecated API</title><xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include></index>
<index id="api-index-2-2-0" role="2.2.0"><title>Index of new symbols in 2.2.0</title><xi:include href="xml/api-index-2.2.0.xml"><xi:fallback /></xi:include></index>
<index id="api-index-2-1-0" role="2.1.0"><title>Index of new symbols in 2.1.0</title><xi:include href="xml/api-index-2.1.0.xml"><xi:fallback /></xi:include></index>
<index id="api-index-2-0-0" role="2.0.0"><title>Index of new symbols in 2.0.0</title><xi:include href="xml/api-index-2.0.0.xml"><xi:fallback /></xi:include></index>
<index id="api-index-1-9-0" role="1.9.0"><title>Index of new symbols in 1.9.0</title><xi:include href="xml/api-index-1.9.0.xml"><xi:fallback /></xi:include></index>

View File

@ -76,6 +76,7 @@ struct ankr
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this) &&
version == 0 &&
c->check_range (this, anchorData) &&
lookupTable.sanitize (c, this, &(this+anchorData))));
}

View File

@ -418,15 +418,11 @@ struct Lookup
} /* Close namespace. */
/* Ugly hand-coded null objects for template Lookup<> :(. */
extern HB_INTERNAL const unsigned char _hb_Null_AAT_Lookup[2];
template <>
/*static*/ inline const AAT::Lookup<OT::HBUINT16>& Null<AAT::Lookup<OT::HBUINT16> > ()
{ return *reinterpret_cast<const AAT::Lookup<OT::HBUINT16> *> (_hb_Null_AAT_Lookup); }
template <>
/*static*/ inline const AAT::Lookup<OT::HBUINT32>& Null<AAT::Lookup<OT::HBUINT32> > ()
{ return *reinterpret_cast<const AAT::Lookup<OT::HBUINT32> *> (_hb_Null_AAT_Lookup); }
template <>
/*static*/ inline const AAT::Lookup<OT::Offset<OT::HBUINT16, false> >& Null<AAT::Lookup<OT::Offset<OT::HBUINT16, false> > > ()
{ return *reinterpret_cast<const AAT::Lookup<OT::Offset<OT::HBUINT16, false> > *> (_hb_Null_AAT_Lookup); }
template <typename T>
struct Null<AAT::Lookup<T> > {
static AAT::Lookup<T> const & get_null ()
{ return *reinterpret_cast<const AAT::Lookup<T> *> (_hb_Null_AAT_Lookup); }
};
namespace AAT {
enum { DELETED_GLYPH = 0xFFFF };

View File

@ -105,15 +105,18 @@ hb_vector_size_impl_t const _hb_NullPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_
/* Generic nul-content Null objects. */
template <typename Type>
static inline Type const & Null () {
struct Null {
static Type const & get_null ()
{
static_assert (hb_null_size (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE.");
return *reinterpret_cast<Type const *> (_hb_NullPool);
}
}
};
template <typename QType>
struct NullHelper
{
typedef typename hb_remove_const (typename hb_remove_reference (QType)) Type;
static const Type & get_null () { return Null<Type> (); }
static const Type & get_null () { return Null<Type>::get_null (); }
};
#define Null(Type) NullHelper<Type>::get_null ()
@ -122,9 +125,11 @@ struct NullHelper
} /* Close namespace. */ \
extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::null_size]; \
template <> \
/*static*/ inline const Namespace::Type& Null<Namespace::Type> () { \
struct Null<Namespace::Type> { \
static Namespace::Type const & get_null () { \
return *reinterpret_cast<const Namespace::Type *> (_hb_Null_##Namespace##_##Type); \
} \
}; \
namespace Namespace { \
static_assert (true, "Just so we take semicolon after.")
#define DEFINE_NULL_NAMESPACE_BYTES(Namespace, Type) \
@ -134,10 +139,12 @@ struct NullHelper
#define DECLARE_NULL_INSTANCE(Type) \
extern HB_INTERNAL const Type _hb_Null_##Type; \
template <> \
/*static*/ inline const Type& Null<Type> () { \
struct Null<Type> { \
static Type const & get_null () { \
return _hb_Null_##Type; \
} \
static_assert (true, "Just so we take semicolon after.")
}; \
static_assert (true, "Just so we take semicolon after.")
#define DEFINE_NULL_INSTANCE(Type) \
const Type _hb_Null_##Type

View File

@ -99,8 +99,7 @@ _populate_gids_to_retain (hb_face_t *face,
const hb_set_t *input_glyphs_to_retain,
bool close_over_gsub,
hb_set_t *unicodes_to_retain,
hb_map_t *codepoint_to_glyph,
hb_vector_t<hb_codepoint_t> *glyphs)
hb_map_t *codepoint_to_glyph)
{
OT::cmap::accelerator_t cmap;
OT::glyf::accelerator_t glyf;
@ -145,10 +144,6 @@ _populate_gids_to_retain (hb_face_t *face,
_remove_invalid_gids (all_gids_to_retain, face->get_num_glyphs ());
glyphs->alloc (all_gids_to_retain->get_population ());
gid = HB_SET_VALUE_INVALID;
while (all_gids_to_retain->next (&gid))
glyphs->push (gid);
cff.fini ();
glyf.fini ();
@ -160,26 +155,29 @@ _populate_gids_to_retain (hb_face_t *face,
static void
_create_old_gid_to_new_gid_map (const hb_face_t *face,
bool retain_gids,
const hb_vector_t<hb_codepoint_t> &glyphs,
hb_set_t *all_gids_to_retain,
hb_map_t *glyph_map, /* OUT */
hb_map_t *reverse_glyph_map, /* OUT */
unsigned int *num_glyphs /* OUT */)
{
for (unsigned int i = 0; i < glyphs.length; i++) {
hb_codepoint_t gid = HB_SET_VALUE_INVALID;
unsigned int length = 0;
for (unsigned int i = 0; all_gids_to_retain->next (&gid); i++) {
if (!retain_gids)
{
glyph_map->set (glyphs[i], i);
reverse_glyph_map->set (i, glyphs[i]);
glyph_map->set (gid, i);
reverse_glyph_map->set (i, gid);
}
else
{
glyph_map->set (glyphs[i], glyphs[i]);
reverse_glyph_map->set (glyphs[i], glyphs[i]);
glyph_map->set (gid, gid);
reverse_glyph_map->set (gid, gid);
}
++length;
}
if (!retain_gids || glyphs.length == 0)
if (!retain_gids || length == 0)
{
*num_glyphs = glyphs.length;
*num_glyphs = length;
}
else
{
@ -207,7 +205,6 @@ hb_subset_plan_create (hb_face_t *face,
plan->drop_layout = input->drop_layout;
plan->desubroutinize = input->desubroutinize;
plan->unicodes = hb_set_create();
plan->glyphs_deprecated.init();
plan->source = hb_face_reference (face);
plan->dest = hb_face_builder_create ();
plan->codepoint_to_glyph = hb_map_create();
@ -218,12 +215,11 @@ hb_subset_plan_create (hb_face_t *face,
input->glyphs,
!plan->drop_layout,
plan->unicodes,
plan->codepoint_to_glyph,
&plan->glyphs_deprecated);
plan->codepoint_to_glyph);
_create_old_gid_to_new_gid_map (face,
input->retain_gids,
plan->glyphs_deprecated,
plan->_glyphset,
plan->glyph_map,
plan->reverse_glyph_map,
&plan->_num_output_glyphs);
@ -242,7 +238,6 @@ hb_subset_plan_destroy (hb_subset_plan_t *plan)
if (!hb_object_destroy (plan)) return;
hb_set_destroy (plan->unicodes);
plan->glyphs_deprecated.fini ();
hb_face_destroy (plan->source);
hb_face_destroy (plan->dest);
hb_map_destroy (plan->codepoint_to_glyph);

View File

@ -53,9 +53,6 @@ struct hb_subset_plan_t
hb_map_t *glyph_map;
hb_map_t *reverse_glyph_map;
// Deprecated members:
hb_vector_t<hb_codepoint_t> glyphs_deprecated;
// Plan is only good for a specific source/dest so keep them with it
hb_face_t *source;
hb_face_t *dest;