-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[buildCFF2VF] Fix support for CFF2 fonts with multiple FontDicts #279
Conversation
aka derived from CID-keyed CFF fonts.
Delete unused variables, fix whitespace.
for fdIndex in range(numFDArray): | ||
blendedPD = {} | ||
privateDictList.append(blendedPD) | ||
for i in range(numMasters): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use master_index
instead of i
if isinstance(valList[0], list): | ||
lenValueList = len(value) | ||
if lenValueList != len(valList): | ||
print("Error: the value list for key %s in the\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use backslashes; do it like in line 310
@@ -467,7 +465,6 @@ def buildMasterList(inputPaths): | |||
|
|||
# Now build MM versions. | |||
print("Reading glyph data...") | |||
bcDictList = {} | |||
blendError = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blendError
is a boolean. Change this to False
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other lines like this. Please change them all.
except KeyError: | ||
if isinstance(value, list): | ||
lenValueList = len(value) | ||
valList = [None]*lenValueList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP 8 (E226): missing whitespace around arithmetic operator
lenValueList = len(value) | ||
valList = [None]*lenValueList | ||
for j in range(lenValueList): | ||
vList = [value[j]]*numMasters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP 8 (E226): missing whitespace around arithmetic operator
valList[j] = vList | ||
blendedPD[key] = valList | ||
else: | ||
blendedPD[key] = [value]*numMasters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP 8 (E226): missing whitespace around arithmetic operator
break | ||
dataList = [] | ||
if needsBlend: | ||
prevBlendList = [0]*len(valList[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP 8 (E226): missing whitespace around arithmetic operator
for blendList in valList: | ||
# convert blend list from absolute values to relative | ||
# values from the previous blend list. | ||
relBlendList = [(val-prevBlendList[i]) for i, val in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP 8 (E226): missing whitespace around arithmetic operator
Drop use of backslash for line continuation, ensure whitespace around arithmetic operators.
Introduced bug in adding FDArray support when changing PrivateDict references by using wrong field name.
varLib.builder.buildVarData() now has a new argument 'optimize' with a default value of True. This triggers calling varLib.builder.VarData_CalculateNumShorts(). This function removes all region references that aren't referenced by a data item. Since CFF2 the VarDataStore structure has no items, all the regions get optimized away, leaving a RegionCount of 0. Work-around is to set optimize=False.
aka derived from CID-keyed CFF fonts.
varLib.builder.buildVarData() now has a new argument 'optimize' with a default value of True. This triggers calling varLib.builder.VarData_CalculateNumShorts(). This function removes all region references that aren't referenced by a data item. Since CFF2 the VarDataStore structure has no items, all the regions get optimized away, leaving a RegionCount of 0. Work-around is to set optimize=False.
ddee6ed
to
1e16efd
Compare
merging with main. Changes to support CID-keyed fonts as sources to buildFontCFFVF. |
…/afdko into FDArray-support * 'FDArray-support' of https://github.com/adobe-type-tools/afdko: [buildCFF2VF] Added work-around for bug in fonttools [buildCFF2VF] Fix support for CFF2 fonts with multiple FontDicts # Conflicts: # afdko/Tools/SharedData/FDKScripts/buildCFF2VF.py
aka derived from CID-keyed CFF fonts.