huertatipografica / HTLetterspacer

HT Letterspacer is a tool for spacing fonts
https://huertatipografica.github.io/HTLetterspacer/
GNU General Public License v3.0
73 stars 16 forks source link

AttributeError: 'HTLetterpacerLib' object has no attribute 'factor' #54

Closed laerm0 closed 3 years ago

laerm0 commented 4 years ago

Hi, this was working earlier today but, upon a Glyphs restart, it stopped working. The custom parameters for HTLetterspacer were added before that restart; perhaps they have something to do with it? Thank you.

Start
Config file exists
Traceback (most recent call last):
  File "HT_LetterSpacer_lib.py", line 339, in spaceMain
    lp, rp = self.setSpace(layer, referenceLayer)
  File "HT_LetterSpacer_lib.py", line 289, in setSpace
    self.newL = math.ceil(0 - distanceL + self.calculateSBValue(lPolygon))
  File "HT_LetterSpacer_lib.py", line 250, in calculateSBValue
    whiteArea = areaUPM * self.factor * 100
AttributeError: 'HTLetterpacerLib' object has no attribute 'factor'

\f_f_i\
Using master custom parameter, paramArea: 300.0
Using master custom parameter, paramDepth: 5.0
Using master custom parameter, paramOver: 20.0

End
kemie commented 4 years ago

I'm having the same problem, but only with certain glyphs. can't figure out what the defining factor is.

andrestelex commented 4 years ago

The factor is defined by the configuration file. I guess the glyph you are running doesn't belong to any category or has a reference glyph that doesn't exist.

madig commented 3 years ago

This can happen if you try to space a glyph that is not covered by the configuration, e.g. .notdef. If you space that without spacing something else first, you will hit the error. If you space something that is covered first and then .notdef, the previously used factor will be reused (as in, a new one is not set). So the order in which you space matters :)