Skip to content

Commit

Permalink
CID work-arounds (for CFF2 fonts with multiple privatedicts)
Browse files Browse the repository at this point in the history
  • Loading branch information
skef committed May 29, 2024
1 parent 131e719 commit 75429ba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion c/addfeatures/hotconv/hot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,9 @@ const char *hotReadFont(hotCtx g, int flags, bool &isCID) {
if (top->cid.Ordering.ptr)
g->font.cid.ordering = top->cid.Ordering.ptr;
g->font.cid.supplement = top->cid.Supplement;
g->font.flags |= FI_CID;
if (!(g->font.cid.registry == "Adobe" &&
g->font.cid.ordering == "Identity"))
g->font.flags |= FI_CID;
}

g->font.unitsPerEm = top->sup.UnitsPerEm;
Expand Down
5 changes: 3 additions & 2 deletions c/shared/cffread_abs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,9 @@ static void readDICT(cfrCtx h, ctlRegion *region, int topdict) {
top->cid.Registry.ptr = sid2str(h, (SID)INDEX_INT(0));
top->cid.Ordering.ptr = sid2str(h, (SID)INDEX_INT(1));
top->cid.Supplement = INDEX_INT(2);
h->flags |= CID_FONT;
if (!(strcmp(top->cid.Registry.ptr, "Adobe") == 0 &&
strcmp(top->cid.Ordering.ptr, "Identity") == 0))
h->flags |= CID_FONT;
break;
case cff_CIDFontVersion:
CHKUFLOW(1);
Expand Down Expand Up @@ -1304,7 +1306,6 @@ static void readDICT(cfrCtx h, ctlRegion *region, int topdict) {
case cff_FDSelect:
CHKUFLOW(1);
h->region.FDSelect.begin = h->src.origin + INDEX_INT(0);
h->flags |= CID_FONT;
break;
case cff_FontName:
CHKUFLOW(1);
Expand Down
2 changes: 1 addition & 1 deletion python/afdko/makeotf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,7 @@ def checkROS(makeOTFParams):
# and we can only assume that the current directory is the starting
# point for all relative paths.
Reg, Ord, Sup = getROS(inputFontPath)
if Reg:
if Reg and not (Reg == 'Adobe' and Ord == 'Identity'):
makeOTFParams.ROS = (Reg, Ord, Sup)
featPath = getattr(makeOTFParams, kFileOptPrefix + kFeature)
foundVert = checkIfVertInFeature(featPath)
Expand Down

0 comments on commit 75429ba

Please sign in to comment.