kateliev / TypeRig

Proxy API and Font Development Toolkit for FontLab
https://kateliev.github.io/TypeRig/
BSD 3-Clause "New" or "Revised" License
48 stars 3 forks source link

Smart Corners #16

Closed insignedesign closed 5 years ago

insignedesign commented 5 years ago

I'm having difficulty with the smart corners. I click Apply Smart Corner but I get:

ERROR: Please specify a Glyph with suitable Shape Builder (Smart corner) first! Traceback (most recent call last): File "C:/TypeRig-master/Scripts/TypeRig GUI\Filter\Corner.py", line 106, in self.btn_apply_smartCorner.clicked.connect(lambda: self.apply_SmartCorner(False)) File "C:/TypeRig-master/Scripts/TypeRig GUI\Filter\Corner.py", line 377, in apply_SmartCorner active_preset = self.getPreset() File "C:/TypeRig-master/Scripts/TypeRig GUI\Filter\Corner.py", line 210, in getPreset active_preset_index = self.tab_presets.selectionModel().selectedIndexes[0].row() IndexError: tuple index out of range DONE: Update/Snapshot for glyphs: _469

I prepared a short video here: https://www.twitch.tv/videos/453177892

kateliev commented 5 years ago

In short: Currently the API does not give us a way to create Smart Corner from scratch, so we have to clone it from somewhere. In order to do that, you need to:

That is all. From here on you can create as many Smart Corners as you wish with custom parameters of your choosing as long as the "Builder" (ShapeBuilder) is properly set.

insignedesign commented 5 years ago

I believe I have followed your instructions properly, but I am getting this error:

Traceback (most recent call last): File "C:/TypeRig-master/Scripts/TypeRig GUI\Filter\Corner.py", line 106, in self.btn_apply_smartCorner.clicked.connect(lambda: self.apply_SmartCorner(False)) File "C:/TypeRig-master/Scripts/TypeRig GUI\Filter\Corner.py", line 377, in apply_SmartCorner active_preset = self.getPreset() File "C:/TypeRig-master/Scripts/TypeRig GUI\Filter\Corner.py", line 210, in getPreset active_preset_index = self.tab_presets.selectionModel().selectedIndexes[0].row() IndexError: tuple index out of range

image

kateliev commented 5 years ago

Did you try entering smart corner radius in the appropriate preset filed. For it to work, you have to give the radius for each master as a preset, select that preset and execute the command from then on, the filter panel will remember your last choice and will apply the corner, until you select another preset.

The given error indicates that no preset was selected. Also as I see you have both radii set to 0.

insignedesign commented 5 years ago

Fantastic, it works. this is a definite improvement. Any word on when this could do both masters at the same time (instead of having to switch to the layer and click the button again)? Or, do I have something mis-configured?