Skip to content
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

Merged
merged 13 commits into from
Mar 13, 2018

Conversation

readroberts
Copy link
Contributor

aka derived from CID-keyed CFF fonts.

Delete unused variables, fix whitespace.
@adobe-type-tools adobe-type-tools deleted a comment Mar 7, 2018
@adobe-type-tools adobe-type-tools deleted a comment Mar 7, 2018
@adobe-type-tools adobe-type-tools deleted a comment Mar 7, 2018
@readroberts readroberts self-assigned this Mar 7, 2018
for fdIndex in range(numFDArray):
blendedPD = {}
privateDictList.append(blendedPD)
for i in range(numMasters):
Copy link
Member

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\
Copy link
Member

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
Copy link
Member

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

Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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])
Copy link
Member

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
Copy link
Member

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

@adobe-type-tools adobe-type-tools deleted a comment Mar 7, 2018
@adobe-type-tools adobe-type-tools deleted a comment Mar 7, 2018
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.
@adobe-type-tools adobe-type-tools deleted a comment Mar 7, 2018
@adobe-type-tools adobe-type-tools deleted a comment Mar 7, 2018
@adobe-type-tools adobe-type-tools deleted a comment Mar 7, 2018
@adobe-type-tools adobe-type-tools deleted a comment Mar 7, 2018
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.
@readroberts
Copy link
Contributor Author

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
@readroberts readroberts merged commit dd8fdda into master Mar 13, 2018
@miguelsousa miguelsousa deleted the FDArray-support branch March 27, 2018 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants