[reorg] Move OT::Layout::GPOS_impl::GPOS to OT::Layout::GPOS.

This commit is contained in:
Garret Rieger 2022-06-28 23:55:32 +00:00 committed by Behdad Esfahbod
parent 88ef3c5a9a
commit 3fbf2dece7
8 changed files with 82 additions and 28 deletions

View File

@ -119,6 +119,35 @@ HB_BASE_sources = \
OT/Layout/GSUB/SubstLookupSubTable.hh \ OT/Layout/GSUB/SubstLookupSubTable.hh \
OT/Layout/GSUB/SubstLookup.hh \ OT/Layout/GSUB/SubstLookup.hh \
OT/Layout/GSUB/GSUB.hh \ OT/Layout/GSUB/GSUB.hh \
OT/Layout/GPOS.hh \
OT/Layout/GPOS/CursivePosFormat1.hh \
OT/Layout/GPOS/MarkLigPos.hh \
OT/Layout/GPOS/PairPos.hh \
OT/Layout/GPOS/Anchor.hh \
OT/Layout/GPOS/AnchorFormat1.hh \
OT/Layout/GPOS/MarkLigPosFormat1.hh \
OT/Layout/GPOS/PairPosFormat1.hh \
OT/Layout/GPOS/ExtensionPos.hh \
OT/Layout/GPOS/ChainContextPos.hh \
OT/Layout/GPOS/Common.hh \
OT/Layout/GPOS/ValueFormat.hh \
OT/Layout/GPOS/AnchorMatrix.hh \
OT/Layout/GPOS/MarkBasePosFormat1.hh \
OT/Layout/GPOS/AnchorFormat3.hh \
OT/Layout/GPOS/PosLookup.hh \
OT/Layout/GPOS/MarkMarkPos.hh \
OT/Layout/GPOS/PairPosFormat2.hh \
OT/Layout/GPOS/MarkBasePos.hh \
OT/Layout/GPOS/MarkMarkPosFormat1.hh \
OT/Layout/GPOS/SinglePos.hh \
OT/Layout/GPOS/MarkArray.hh \
OT/Layout/GPOS/CursivePos.hh \
OT/Layout/GPOS/PosLookupSubTable.hh \
OT/Layout/GPOS/MarkRecord.hh \
OT/Layout/GPOS/AnchorFormat2.hh \
OT/Layout/GPOS/ContextPos.hh \
OT/Layout/GPOS/SinglePosFormat2.hh \
OT/Layout/GPOS/SinglePosFormat1.hh \
hb-ot-layout-gsubgpos.hh \ hb-ot-layout-gsubgpos.hh \
hb-ot-layout-jstf-table.hh \ hb-ot-layout-jstf-table.hh \
hb-ot-layout.cc \ hb-ot-layout.cc \

View File

@ -1,14 +1,13 @@
#ifndef OT_LAYOUT_GPOS_GPOS_HH #ifndef OT_LAYOUT_GPOS_HH
#define OT_LAYOUT_GPOS_GPOS_HH #define OT_LAYOUT_GPOS_HH
#include "../../../hb-ot-layout-common.hh" #include "../../hb-ot-layout-common.hh"
#include "../../../hb-ot-layout-gsubgpos.hh" #include "../../hb-ot-layout-gsubgpos.hh"
#include "Common.hh" #include "GPOS/Common.hh"
#include "PosLookup.hh" #include "GPOS/PosLookup.hh"
namespace OT { namespace OT {
namespace Layout { namespace Layout {
namespace GPOS_impl {
static void static void
propagate_attachment_offsets (hb_glyph_position_t *pos, propagate_attachment_offsets (hb_glyph_position_t *pos,
@ -26,10 +25,10 @@ struct GPOS : GSUBGPOS
{ {
static constexpr hb_tag_t tableTag = HB_OT_TAG_GPOS; static constexpr hb_tag_t tableTag = HB_OT_TAG_GPOS;
using Lookup = PosLookup; using Lookup = GPOS_impl::PosLookup;
const PosLookup& get_lookup (unsigned int i) const const GPOS_impl::PosLookup& get_lookup (unsigned int i) const
{ return static_cast<const PosLookup &> (GSUBGPOS::get_lookup (i)); } { return static_cast<const GPOS_impl::PosLookup &> (GSUBGPOS::get_lookup (i)); }
static inline void position_start (hb_font_t *font, hb_buffer_t *buffer); static inline void position_start (hb_font_t *font, hb_buffer_t *buffer);
static inline void position_finish_advances (hb_font_t *font, hb_buffer_t *buffer); static inline void position_finish_advances (hb_font_t *font, hb_buffer_t *buffer);
@ -38,11 +37,11 @@ struct GPOS : GSUBGPOS
bool subset (hb_subset_context_t *c) const bool subset (hb_subset_context_t *c) const
{ {
hb_subset_layout_context_t l (c, tableTag, c->plan->gpos_lookups, c->plan->gpos_langsys, c->plan->gpos_features); hb_subset_layout_context_t l (c, tableTag, c->plan->gpos_lookups, c->plan->gpos_langsys, c->plan->gpos_features);
return GSUBGPOS::subset<PosLookup> (&l); return GSUBGPOS::subset<GPOS_impl::PosLookup> (&l);
} }
bool sanitize (hb_sanitize_context_t *c) const bool sanitize (hb_sanitize_context_t *c) const
{ return GSUBGPOS::sanitize<PosLookup> (c); } { return GSUBGPOS::sanitize<GPOS_impl::PosLookup> (c); }
HB_INTERNAL bool is_blocklisted (hb_blob_t *blob, HB_INTERNAL bool is_blocklisted (hb_blob_t *blob,
hb_face_t *face) const; hb_face_t *face) const;
@ -52,7 +51,7 @@ struct GPOS : GSUBGPOS
for (unsigned i = 0; i < GSUBGPOS::get_lookup_count (); i++) for (unsigned i = 0; i < GSUBGPOS::get_lookup_count (); i++)
{ {
if (!c->gpos_lookups->has (i)) continue; if (!c->gpos_lookups->has (i)) continue;
const PosLookup &l = get_lookup (i); const GPOS_impl::PosLookup &l = get_lookup (i);
l.dispatch (c); l.dispatch (c);
} }
} }
@ -60,7 +59,7 @@ struct GPOS : GSUBGPOS
void closure_lookups (hb_face_t *face, void closure_lookups (hb_face_t *face,
const hb_set_t *glyphs, const hb_set_t *glyphs,
hb_set_t *lookup_indexes /* IN/OUT */) const hb_set_t *lookup_indexes /* IN/OUT */) const
{ GSUBGPOS::closure_lookups<PosLookup> (face, glyphs, lookup_indexes); } { GSUBGPOS::closure_lookups<GPOS_impl::PosLookup> (face, glyphs, lookup_indexes); }
typedef GSUBGPOS::accelerator_t<GPOS> accelerator_t; typedef GSUBGPOS::accelerator_t<GPOS> accelerator_t;
}; };
@ -90,16 +89,16 @@ propagate_attachment_offsets (hb_glyph_position_t *pos,
propagate_attachment_offsets (pos, len, j, direction, nesting_level - 1); propagate_attachment_offsets (pos, len, j, direction, nesting_level - 1);
assert (!!(type & ATTACH_TYPE_MARK) ^ !!(type & ATTACH_TYPE_CURSIVE)); assert (!!(type & GPOS_impl::ATTACH_TYPE_MARK) ^ !!(type & GPOS_impl::ATTACH_TYPE_CURSIVE));
if (type & ATTACH_TYPE_CURSIVE) if (type & GPOS_impl::ATTACH_TYPE_CURSIVE)
{ {
if (HB_DIRECTION_IS_HORIZONTAL (direction)) if (HB_DIRECTION_IS_HORIZONTAL (direction))
pos[i].y_offset += pos[j].y_offset; pos[i].y_offset += pos[j].y_offset;
else else
pos[i].x_offset += pos[j].x_offset; pos[i].x_offset += pos[j].x_offset;
} }
else /*if (type & ATTACH_TYPE_MARK)*/ else /*if (type & GPOS_impl::ATTACH_TYPE_MARK)*/
{ {
pos[i].x_offset += pos[j].x_offset; pos[i].x_offset += pos[j].x_offset;
pos[i].y_offset += pos[j].y_offset; pos[i].y_offset += pos[j].y_offset;
@ -154,15 +153,12 @@ GPOS::position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer)
} }
} }
}
} }
struct GPOS_accelerator_t : Layout::GPOS_impl::GPOS::accelerator_t { struct GPOS_accelerator_t : Layout::GPOS::accelerator_t {
GPOS_accelerator_t (hb_face_t *face) : Layout::GPOS_impl::GPOS::accelerator_t (face) {} GPOS_accelerator_t (hb_face_t *face) : Layout::GPOS::accelerator_t (face) {}
}; };
} }
#endif /* OT_LAYOUT_GPOS_HH */
#endif /* OT_LAYOUT_GSUB_GSUB_HH */

View File

@ -76,4 +76,4 @@ struct PosLookup : Lookup
} }
} }
#endif /* OT_LAYOUT_GPOS_SUBSTLOOKUP_HH */ #endif /* OT_LAYOUT_GPOS_POSLOOKUP_HH */

View File

@ -29,7 +29,7 @@
#ifndef HB_OT_LAYOUT_GPOS_TABLE_HH #ifndef HB_OT_LAYOUT_GPOS_TABLE_HH
#define HB_OT_LAYOUT_GPOS_TABLE_HH #define HB_OT_LAYOUT_GPOS_TABLE_HH
#include "OT/Layout/GPOS/GPOS.hh" #include "OT/Layout/GPOS.hh"
namespace OT { namespace OT {

View File

@ -55,7 +55,7 @@
#include "hb-aat-layout-opbd-table.hh" // Just so we compile it; unused otherwise. #include "hb-aat-layout-opbd-table.hh" // Just so we compile it; unused otherwise.
using OT::Layout::GSUB::GSUB; using OT::Layout::GSUB::GSUB;
using OT::Layout::GPOS_impl::GPOS; using OT::Layout::GPOS;
/** /**
* SECTION:hb-ot-layout * SECTION:hb-ot-layout

View File

@ -41,7 +41,7 @@
#include "hb-ot-math-table.hh" #include "hb-ot-math-table.hh"
using OT::Layout::GSUB::GSUB; using OT::Layout::GSUB::GSUB;
using OT::Layout::GPOS_impl::GPOS; using OT::Layout::GPOS;
typedef hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> script_langsys_map; typedef hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> script_langsys_map;
#ifndef HB_NO_SUBSET_CFF #ifndef HB_NO_SUBSET_CFF

View File

@ -56,7 +56,7 @@
#include "hb-repacker.hh" #include "hb-repacker.hh"
using OT::Layout::GSUB::GSUB; using OT::Layout::GSUB::GSUB;
using OT::Layout::GPOS_impl::GPOS; using OT::Layout::GPOS;
/** /**
* SECTION:hb-subset * SECTION:hb-subset

View File

@ -123,6 +123,35 @@ hb_base_sources = files(
'OT/Layout/GSUB/SubstLookupSubTable.hh', 'OT/Layout/GSUB/SubstLookupSubTable.hh',
'OT/Layout/GSUB/SubstLookup.hh', 'OT/Layout/GSUB/SubstLookup.hh',
'OT/Layout/GSUB/GSUB.hh', 'OT/Layout/GSUB/GSUB.hh',
'OT/Layout/GPOS.hh',
'OT/Layout/GPOS/CursivePosFormat1.hh',
'OT/Layout/GPOS/MarkLigPos.hh',
'OT/Layout/GPOS/PairPos.hh',
'OT/Layout/GPOS/Anchor.hh',
'OT/Layout/GPOS/AnchorFormat1.hh',
'OT/Layout/GPOS/MarkLigPosFormat1.hh',
'OT/Layout/GPOS/PairPosFormat1.hh',
'OT/Layout/GPOS/ExtensionPos.hh',
'OT/Layout/GPOS/ChainContextPos.hh',
'OT/Layout/GPOS/Common.hh',
'OT/Layout/GPOS/ValueFormat.hh',
'OT/Layout/GPOS/AnchorMatrix.hh',
'OT/Layout/GPOS/MarkBasePosFormat1.hh',
'OT/Layout/GPOS/AnchorFormat3.hh',
'OT/Layout/GPOS/PosLookup.hh',
'OT/Layout/GPOS/MarkMarkPos.hh',
'OT/Layout/GPOS/PairPosFormat2.hh',
'OT/Layout/GPOS/MarkBasePos.hh',
'OT/Layout/GPOS/MarkMarkPosFormat1.hh',
'OT/Layout/GPOS/SinglePos.hh',
'OT/Layout/GPOS/MarkArray.hh',
'OT/Layout/GPOS/CursivePos.hh',
'OT/Layout/GPOS/PosLookupSubTable.hh',
'OT/Layout/GPOS/MarkRecord.hh',
'OT/Layout/GPOS/AnchorFormat2.hh',
'OT/Layout/GPOS/ContextPos.hh',
'OT/Layout/GPOS/SinglePosFormat2.hh',
'OT/Layout/GPOS/SinglePosFormat1.hh',
'hb-ot-layout-gsubgpos.hh', 'hb-ot-layout-gsubgpos.hh',
'hb-ot-layout-jstf-table.hh', 'hb-ot-layout-jstf-table.hh',
'hb-ot-layout.cc', 'hb-ot-layout.cc',