Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions Kernkraft.glyphsPlugin/Contents/Resources/KernKraftModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(self, Glyphs, thisFont, mID):

# Kerning Strings
#----------------
self.kenringStrings = KK.KerningStrings().customKenringStrings
self.kerningStrings = KK.KerningStrings().customKerningStrings

# Defaults
#---------
Expand Down Expand Up @@ -319,21 +319,23 @@ def caseFromGSCase(self, case):
def stringMaker(self, inputGlyphName, inputGlyphScript, itrGlyphName, itrGlyphCase, removeUIGlyphAtSide=None):
''' GENERATE THE STRING ACCORDING TO THE GIVEN PREREQUISITES '''
try:
category = self.thisFont.glyphs[inputGlyphName].category
subCategory = self.thisFont.glyphs[inputGlyphName].subCategory
glyph = self.thisFont.glyphs[inputGlyphName]
category = glyph.category
subCategory = glyph.subCategory

if Glyphs.versionNumber >= 3.0:
case = self.caseFromGSCase(self.thisFont.glyphs[inputGlyphName].case)
if not subCategory:
subCategory = case
if not subCategory and Glyphs.versionNumber >= 3.0:
subCategory = self.caseFromGSCase(glyph.case)

if subCategory is None:
subCategory = "Other"

if inputGlyphScript == "hebrew":
self.writingDirection = 1 # RTL

tailFallback = "/n/n"

try:
gCat = self.kenringStrings[inputGlyphScript][category]
gCat = self.kerningStrings[inputGlyphScript][category]
except:
gCat = None
gCatError = "__NOTE: Input Glyph '%s' did not find a nice kerning string. Will use a default string." % inputGlyphName
Expand Down Expand Up @@ -641,8 +643,8 @@ def generateTabOutput(self, inputGlyphName, showLetterCategoryOnly=False):
for idx, itrG in enumerate(glyphsList): # excluding prohibited categories

itrG_Name = itrG.name # iteratedGlyphName
itrG_LKG = itrG.leftKerningGroup # iteratedGlyphLeftKenringGroup
itrG_RKG = itrG.rightKerningGroup # iteratedGlyphRightKenringGroup
itrG_LKG = itrG.leftKerningGroup # iteratedGlyphLeftKerningGroup
itrG_RKG = itrG.rightKerningGroup # iteratedGlyphRightKerningGroup
itrG_Script = itrG.script # iteratedGlyphScript
itrG_Cat = itrG.category # iteratedGlyphCategory
itrG_SubCat = itrG.subCategory # iteratedGlyphSubCategory
Expand Down
2 changes: 1 addition & 1 deletion Kernkraft.glyphsPlugin/Contents/Resources/kernKit.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class KerningStrings:
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# CUSTOMIZABLE DATABASE
customKenringStrings = {
customKerningStrings = {

# STRUCTURE:
# [`script`]
Expand Down