Skip to content

Conversation

@cjdunn
Copy link

@cjdunn cjdunn commented Apr 6, 2023

–Without pausing updates, RF becomes super slow if I want to temporarily work on a glyph without closing this window.
–Many times updating a glyph is necessary in the middle of accent building, and I donʻt want to have to always close the GlyphBuilder window and loose my place.
–Pausing updates makes it possible to switch to drawing a glyph for a while, or even switch to another typeface for a while, without RF becoming so slow itʻs unusable.
–Iʻm sure my code can be improved, and fixes are welcome! Perhaps the checkbox state becomes a preference setting that is saved for next time you open GlyphBuilder (word-o-mat does something like this)? Personally, I would leave this checked maybe 90% of the time.

Thanks @typemytype for considering the PR!

@cjdunn
Copy link
Author

cjdunn commented Apr 6, 2023

–Just tried this and found out that even running a script to addAnchors runs much faster now, almost runs instantly, with the Pause Updates box checked : )

@cjdunn
Copy link
Author

cjdunn commented Apr 6, 2023

I renamed to "Pause Observer" to avoid confusion. And I changed the unpause behavior so the window doesnʻt scroll back up to top of window, this was getting annoying

- use the checkbox label itself
- set a live updating flag and use it to reload on a font changes
- save it in the defaults
@typemytype
Copy link
Owner

good plan! only the code is really way to complex for what it should do :)

Copy link
Owner

@typemytype typemytype left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you give me write access, so I can push my changes to your PR

yPos = -20
checkBoxSize = 18
self.w.pauseOnOff = CheckBox((leftMargin, yPos, checkBoxSize, checkBoxSize), "", sizeStyle="small", callback=self.pause)
self.w.pauseLabel = TextBox((checkBoxSize+5, yPos+2, -leftMargin, checkBoxSize), "Pause Observer", sizeStyle="small")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why a label? use CheckBox(posSize, "Live Updates")

self.font = None


def pause(self, sender):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should just set a flag based on the sender.get()

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and use the flag in the fontChanged callback to reload or not

@typemytype
Copy link
Owner

could you test these changes?

implemented without fiddling around with pauseFonts + renamed it to "Live Updating"

@cjdunn
Copy link
Author

cjdunn commented Apr 7, 2023 via email

@cjdunn
Copy link
Author

cjdunn commented Apr 7, 2023

–Overall looks great, very happy with this!
–Small thing:
I noticed that when Live Updates is unchecked, if I change a contour or component and then click back to the window the Glyph Builder drawing updates when I click back to window: good!
When I move an anchor, the Glyph Builder drawing doesn't update when I click back to the window. I have to click "Refresh" to see updates from anchor changes. I would expect the anchor change behavior to match contour changes.

Thanks so much!

@typemytype
Copy link
Owner

a complete reload when the window becomes active is a good plan!

@cjdunn
Copy link
Author

cjdunn commented Apr 7, 2023

Awesome! That update matches the behavior I expected.

LGTM!

@cjdunn cjdunn closed this Apr 7, 2023
@typemytype
Copy link
Owner

why did you close it?

@typemytype typemytype reopened this Apr 10, 2023
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