-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Zooming or changing the font size? #33
Comments
Indeed it would :) Currently changing the font size is possible only with prefs system property that requires JVM restart. |
I also wanted to reload prefs without restart, and this works for me (I did a quick search for namespaces which require (require '[vlaaad.reveal.prefs :as rp])
(defn set-prefs
"`(set-prefs {...})` to reset reveal prefs without restarting your repl"
[prefs]
(tap>
(do (alter-var-root #'rp/prefs (constantly (delay prefs)))
(require '[vlaaad.reveal.style]
'[vlaaad.reveal.font] :reload))))
(comment
(set-prefs {:font-size 20, :theme :dark})
,) The |
That seems very unreliable, I'm surprised it worked :D |
Me too, tbh. I wanted to try rewriting prefs, style, and font to use functions instead of delays, but this is working for now 🤷♂️ |
I don't quite remember why I used delays everywhere, probably wanted to make reveal AOT-compatible, and loading prefs should happen in runtime and not during compilation |
Ah, I assumed it was for performance. In that case, I might try rewrite What do you think? |
I'd prefer to keep the delay for now, since a lot of reveal code currently relies on prefs being effectively constant. |
I see :) |
You could leverage re-delay (or your custom version of it). https://github.com/aroemers/redelay Which let's you selectively invalidate the delay (and in the case of re-delay the delay dependencies as well and safely do so). I do think in general it is best to avoid side-effect at load-time. |
It be nice to be able to zoom or change the font size.
The text was updated successfully, but these errors were encountered: