added CFF1 Expert Encoding subset test & bug fixes
This commit is contained in:
parent
b64ef69b9e
commit
9228db06f4
|
@ -1121,7 +1121,13 @@ struct cff1
|
|||
|
||||
const OT::cff1 *cff = this->blob->as<OT::cff1> ();
|
||||
encoding = &Null(Encoding);
|
||||
charset = &StructAtOffsetOrNull<Charset> (cff, topDict.CharsetOffset);
|
||||
if (is_predef_charset ())
|
||||
charset = &Null(Charset);
|
||||
else
|
||||
{
|
||||
charset = &StructAtOffsetOrNull<Charset> (cff, topDict.CharsetOffset);
|
||||
if (unlikely ((charset == &Null (Charset)) || !charset->sanitize (&sc))) { fini (); return; }
|
||||
}
|
||||
if (is_CID ())
|
||||
{
|
||||
if (unlikely (charset == &Null(Charset))) { fini (); return; }
|
||||
|
|
|
@ -615,12 +615,18 @@ struct cff_subset_plan {
|
|||
final_size += offsets.globalSubrsInfo.size;
|
||||
|
||||
/* Encoding */
|
||||
offsets.encodingOffset = final_size;
|
||||
if (!subset_encoding && acc.is_predef_charset ())
|
||||
offsets.encodingOffset = acc.topDict.EncodingOffset;
|
||||
else
|
||||
offsets.encodingOffset = final_size;
|
||||
if (subset_encoding)
|
||||
final_size += plan_subset_encoding (acc, plan);
|
||||
|
||||
/* Charset */
|
||||
offsets.charsetInfo.offset = final_size;
|
||||
if (!subset_charset && acc.is_predef_charset ())
|
||||
offsets.charsetInfo.offset = acc.topDict.CharsetOffset;
|
||||
else
|
||||
offsets.charsetInfo.offset = final_size;
|
||||
final_size += offsets.charsetInfo.size;
|
||||
|
||||
/* FDSelect */
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -111,6 +111,26 @@ test_subset_cff1_j (void)
|
|||
hb_face_destroy (face_41_4c2e);
|
||||
}
|
||||
|
||||
static void
|
||||
test_subset_cff1_expert (void)
|
||||
{
|
||||
hb_face_t *face = hb_subset_test_open_font ("fonts/cff1_expert.otf");
|
||||
hb_face_t *face_subset = hb_subset_test_open_font ("fonts/cff1_expert.2D,F6E9,FB00.otf");
|
||||
|
||||
hb_set_t *codepoints = hb_set_create ();
|
||||
hb_set_add (codepoints, 0x2D);
|
||||
hb_set_add (codepoints, 0xF6E9);
|
||||
hb_set_add (codepoints, 0xFB00);
|
||||
hb_face_t *face_test = hb_subset_test_create_subset (face, hb_subset_test_create_input (codepoints));
|
||||
hb_set_destroy (codepoints);
|
||||
|
||||
hb_subset_test_check (face_subset, face_test, HB_TAG ('C','F','F',' '));
|
||||
|
||||
hb_face_destroy (face_test);
|
||||
hb_face_destroy (face_subset);
|
||||
hb_face_destroy (face);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
|
@ -120,6 +140,7 @@ main (int argc, char **argv)
|
|||
hb_test_add (test_subset_cff1);
|
||||
hb_test_add (test_subset_cff1_strip_hints);
|
||||
hb_test_add (test_subset_cff1_j);
|
||||
hb_test_add (test_subset_cff1_expert);
|
||||
|
||||
return hb_test_run ();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue