simoncozens / Pendot

Dotter tool for Glyphs
Apache License 2.0
6 stars 0 forks source link

Pendot Designer traceback #16

Closed n7s closed 5 months ago

n7s commented 5 months ago

In Glyphs 3.3 (3307) using Python 3.11.9 (Glyphs), and the latest Dotter (d3c2445) I get the following traceback in the Macro Panel output: (No Pendot Designer dialog box shows)

Dot Size 15
Dot Spacing 15
Prevent Overlaps True
Split Paths False
Contour Source <Default>
Stroker Width 50
Stroker Height 50
Stroker Angle 0
Start Cap round
End Cap round
Join Type round
Remove External False
Remove Internal False
Segment Wise False
Dot Size 30
Traceback (most recent call last):
  File "Pendot Designer.py", line 599
    setattr(GSApplication, "_pendotdesigner", PendotDesigner())
                                              ^^^^^^^^^^^^^^^^
  File "Pendot Designer.py", line 346, in __init__
    self.on_layer_change()
  File "Pendot Designer.py", line 516, in on_layer_change
    self.reload_values()
  File "Pendot Designer.py", line 528, in reload_values
    self.reload_guidelines()
  File "Pendot Designer.py", line 473, in reload_guidelines
    [
TypeError: 'NoneType' object is not iterable
simoncozens commented 5 months ago

oops, this was fixed locally but I didn't commit it.

jvgaultney commented 5 months ago

That didn't fix it - here's the traceback:

Dot Size 15 Dot Spacing 15 Prevent Overlaps True Split Paths False Contour Source Stroker Width 50 Stroker Height 50 Stroker Angle 0 Start Cap round End Cap round Join Type round Remove External False Remove Internal False Segment Wise False Dot Size 30 Traceback (most recent call last): File "Pendot Designer.py", line 600 setattr(GSApplication, "_pendotdesigner", PendotDesigner()) ^^^^^^^^^^^^^^^^ File "Pendot Designer.py", line 346, in init self.on_layer_change() File "Pendot Designer.py", line 517, in on_layer_change self.reload_values() File "Pendot Designer.py", line 529, in reload_values self.reload_guidelines() File "Pendot Designer.py", line 479, in reload_guidelines self.create_layer_preview() File "Pendot Designer.py", line 543, in create_layer_preview effects = create_effects(Glyphs.font, instance, preview=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "init.py", line 44, in create_effects for name in effectlist: TypeError: 'NoneType' object is not iterable

simoncozens commented 5 months ago

Oops. Fixed that issue too. Pull and restart!

(The problem is that I wrote and tested the code to fill out the custom parameters before I wrote the code to use them. So writing the CPs works fine; and using them works fine, but only if you already have them in the font...)

jvgaultney commented 5 months ago

Still not working. BTW the parameters had been successfully migrated in the font AFAICT (see https://github.com/silnrsi/font-pendot-latin/commit/7734f41202cf07126bf64f9eb5ce753984c7250c), so it's not just a matter of them being missing.

Dot Size 15 Dot Spacing 15 Prevent Overlaps True Split Paths False Contour Source Stroker Width 50 Stroker Height 50 Stroker Angle 0 Start Cap round End Cap round Join Type round Remove External False Remove Internal False Segment Wise False Dot Size 30 Traceback (most recent call last): File "Pendot Designer.py", line 600 setattr(GSApplication, "_pendotdesigner", PendotDesigner()) ^^^^^^^^^^^^^^^^ File "Pendot Designer.py", line 346, in init self.on_layer_change() File "Pendot Designer.py", line 517, in on_layer_change self.reload_values() File "Pendot Designer.py", line 529, in reload_values self.reload_guidelines() File "Pendot Designer.py", line 479, in reload_guidelines self.create_layer_preview() File "Pendot Designer.py", line 543, in create_layer_preview effects = create_effects(Glyphs.font, instance, preview=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "init.py", line 40, in create_effects effectlist = instance.customParameters.get(KEY + ".effects", []) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'CustomParametersProxy' object has no attribute 'get'

jvgaultney commented 5 months ago

If I open a New Font, with nothing in it, I get:

Traceback (most recent call last): File "Pendot Designer.py", line 600 setattr(GSApplication, "_pendotdesigner", PendotDesigner()) ^^^^^^^^^^^^^^^^ File "Pendot Designer.py", line 275, in init instance = self.selectedInstance or Glyphs.font.instances[0]


  File "GlyphsApp/GlyphsApp/__init__.py", line 2087, in __getitem__
  File "GlyphsApp/GlyphsApp/__init__.py", line 567, in _validate_idx
IndexError: list index 0 out of range 0