renamed OT::cff to OT::cff1 for consistency

along with HB_OT_TAG_cff1
This commit is contained in:
Michiharu Ariza 2018-08-16 00:25:57 -07:00
parent fdbfa1848b
commit e67bb3fbcf
3 changed files with 17 additions and 17 deletions

View File

@ -36,7 +36,7 @@ namespace CFF {
* CFF -- Compact Font Format (CFF) * CFF -- Compact Font Format (CFF)
* http://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5176.CFF.pdf * http://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5176.CFF.pdf
*/ */
#define HB_OT_TAG_cff HB_TAG('C','F','F',' ') #define HB_OT_TAG_cff1 HB_TAG('C','F','F',' ')
typedef Index<HBUINT16> CFF1Index; typedef Index<HBUINT16> CFF1Index;
template <typename Type> struct CFF1IndexOf : IndexOf<HBUINT16, Type> {}; template <typename Type> struct CFF1IndexOf : IndexOf<HBUINT16, Type> {};
@ -679,9 +679,9 @@ namespace OT {
using namespace CFF; using namespace CFF;
struct cff struct cff1
{ {
static const hb_tag_t tableTag = HB_OT_TAG_cff; static const hb_tag_t tableTag = HB_OT_TAG_cff1;
inline bool sanitize (hb_sanitize_context_t *c) const inline bool sanitize (hb_sanitize_context_t *c) const
{ {
@ -701,15 +701,15 @@ struct cff
fontDicts.init (); fontDicts.init ();
privateDicts.init (); privateDicts.init ();
this->blob = sc.reference_table<cff> (face); this->blob = sc.reference_table<cff1> (face);
/* setup for run-time santization */ /* setup for run-time santization */
sc.init (this->blob); sc.init (this->blob);
sc.start_processing (); sc.start_processing ();
const OT::cff *cff = this->blob->template as<OT::cff> (); const OT::cff1 *cff = this->blob->template as<OT::cff1> ();
if (cff == &Null(OT::cff)) if (cff == &Null(OT::cff1))
{ fini (); return; } { fini (); return; }
nameIndex = &cff->nameIndex (cff); nameIndex = &cff->nameIndex (cff);
@ -875,7 +875,7 @@ struct cff
bool success = true; bool success = true;
if (hb_subset_cff1 (plan, &cff_prime)) { if (hb_subset_cff1 (plan, &cff_prime)) {
success = success && plan->add_table (HB_OT_TAG_cff, cff_prime); success = success && plan->add_table (HB_OT_TAG_cff1, cff_prime);
} else { } else {
success = false; success = false;
} }

View File

@ -239,14 +239,14 @@ struct cff_subset_plan {
subrRefMaps.fini (); subrRefMaps.fini ();
} }
inline bool create (const OT::cff::accelerator_subset_t &acc, inline bool create (const OT::cff1::accelerator_subset_t &acc,
hb_subset_plan_t *plan) hb_subset_plan_t *plan)
{ {
final_size = 0; final_size = 0;
orig_fdcount = acc.fdCount; orig_fdcount = acc.fdCount;
/* CFF header */ /* CFF header */
final_size += OT::cff::static_size; final_size += OT::cff1::static_size;
/* Name INDEX */ /* Name INDEX */
offsets.nameIndexOffset = final_size; offsets.nameIndexOffset = final_size;
@ -267,7 +267,7 @@ struct cff_subset_plan {
/* Subset global & local subrs */ /* Subset global & local subrs */
{ {
SubrSubsetter<const OT::cff::accelerator_subset_t, CFF1CSInterpEnv, CFF1CSOpSet_SubrSubset> subsetter(acc, plan->glyphs); SubrSubsetter<const OT::cff1::accelerator_subset_t, CFF1CSInterpEnv, CFF1CSOpSet_SubrSubset> subsetter(acc, plan->glyphs);
if (!subsetter.collect_refs (subrRefMaps)) if (!subsetter.collect_refs (subrRefMaps))
return false; return false;
@ -374,7 +374,7 @@ struct cff_subset_plan {
}; };
static inline bool _write_cff1 (const cff_subset_plan &plan, static inline bool _write_cff1 (const cff_subset_plan &plan,
const OT::cff::accelerator_subset_t &acc, const OT::cff1::accelerator_subset_t &acc,
const hb_vector_t<hb_codepoint_t>& glyphs, const hb_vector_t<hb_codepoint_t>& glyphs,
unsigned int dest_sz, unsigned int dest_sz,
void *dest) void *dest)
@ -384,7 +384,7 @@ static inline bool _write_cff1 (const cff_subset_plan &plan,
char RETURN_OP[1] = { OpCode_return }; char RETURN_OP[1] = { OpCode_return };
const ByteStr NULL_SUBR (RETURN_OP, 1); const ByteStr NULL_SUBR (RETURN_OP, 1);
OT::cff *cff = c.start_serialize<OT::cff> (); OT::cff1 *cff = c.start_serialize<OT::cff1> ();
if (unlikely (!c.extend_min (*cff))) if (unlikely (!c.extend_min (*cff)))
return false; return false;
@ -561,7 +561,7 @@ static inline bool _write_cff1 (const cff_subset_plan &plan,
} }
static bool static bool
_hb_subset_cff1 (const OT::cff::accelerator_subset_t &acc, _hb_subset_cff1 (const OT::cff1::accelerator_subset_t &acc,
const char *data, const char *data,
hb_subset_plan_t *plan, hb_subset_plan_t *plan,
hb_blob_t **prime /* OUT */) hb_blob_t **prime /* OUT */)
@ -602,10 +602,10 @@ bool
hb_subset_cff1 (hb_subset_plan_t *plan, hb_subset_cff1 (hb_subset_plan_t *plan,
hb_blob_t **prime /* OUT */) hb_blob_t **prime /* OUT */)
{ {
hb_blob_t *cff_blob = hb_sanitize_context_t().reference_table<CFF::cff> (plan->source); hb_blob_t *cff_blob = hb_sanitize_context_t().reference_table<CFF::cff1> (plan->source);
const char *data = hb_blob_get_data(cff_blob, nullptr); const char *data = hb_blob_get_data(cff_blob, nullptr);
OT::cff::accelerator_subset_t acc; OT::cff1::accelerator_subset_t acc;
acc.init(plan->source); acc.init(plan->source);
bool result = likely (acc.is_valid ()) && bool result = likely (acc.is_valid ()) &&
_hb_subset_cff1 (acc, data, plan, prime); _hb_subset_cff1 (acc, data, plan, prime);

View File

@ -272,8 +272,8 @@ _subset_table (hb_subset_plan_t *plan,
case HB_OT_TAG_post: case HB_OT_TAG_post:
result = _subset<const OT::post> (plan); result = _subset<const OT::post> (plan);
break; break;
case HB_OT_TAG_cff: case HB_OT_TAG_cff1:
result = _subset<const OT::cff> (plan); result = _subset<const OT::cff1> (plan);
break; break;
case HB_OT_TAG_cff2: case HB_OT_TAG_cff2:
result = _subset<const OT::cff2> (plan); result = _subset<const OT::cff2> (plan);