reveal

Docs: https://vlaaad.github.io/reveal/ Source: https://github.com/vlaaad/reveal
onetom 2020-07-22T17:24:36.001300Z

I see reveal has now supports the slash and the F key for search, but the README is still referring the previous version, which doesn't. https://github.com/vlaaad/reveal/commit/18e197151374ccdb9863b548f41eb0f6793a60c8#diff-0e526e66087bcd1211d489821e83b36dR193-R198

onetom 2020-07-22T17:33:19.006200Z

I see that the clojars badge shows the latest version, but since it's not possible to copy from there, I usually pick the version from somewhere else in the README. Since your README do mention it elsewhere, I just copied that command:

clj \
-Sdeps '{:deps {vlaaad/reveal {:mvn/version "0.1.0-ea22"} nrepl {:mvn/version "0.6.0"}}}' \
-m nrepl.cmdline --middleware '[vlaaad.reveal.nrepl/middleware]'
It's awesome that you provided this, because I could very easily try it. It took a bit more effort to figure out how to make it work from Cursive, by adding the middleware to a .nrepl.edn file:
{:bind "0.0.0.0"
 :port 5555
 :middleware
       [vlaaad.reveal.nrepl/middleware]}
maybe it would worth mentioning this in the README too, just broaden the pool of ppl who can try reveal with the lowest possible effort. @vlaaad while you are at it, maybe you can upgrade the nREPL version to 0.7.0 if reveal works with it, since it came out on 2020-03-28 already

vlaaad 2020-07-22T17:45:36.009300Z

hi @onetom! I'm planning to release reveal 1.0 soonish and I'll update all the readmes for that occasion. By the way, I use socket repl in cursive (I create run with clojure.main instead of nrepl, it works just as fine, but simpler). Anyway, thanks for example for people that use nrepl with cursive, I'll add it to the readme closer to 1.0 release.

onetom 2020-07-22T17:46:42.011Z

ah, okay then. thx for getting back to me. it's very exciting! πŸ™‚

onetom 2020-07-22T17:47:16.012100Z

i think the only reason im using the nrepl with cursive is the test integration support, which doesnt work over a socket repl

vlaaad 2020-07-22T17:47:24.012400Z

why do you think I should update to nrepl 0.7.0? nrepl is a runtime dependency, it's not mentioned at all in published artifacts, and is accessed only when requiring vlaaad.reveal.nrepl namespace

onetom 2020-07-22T17:48:13.012900Z

i just meant to upgrade it here:

clj \
-Sdeps '{:deps {vlaaad/reveal {:mvn/version "0.1.0-ea22"} nrepl {:mvn/version "0.7.0"}}}' \
-m nrepl.cmdline --middleware '[vlaaad.reveal.nrepl/middleware]'

vlaaad 2020-07-22T17:48:25.013200Z

ah, yes, that makes sense!

vlaaad 2020-07-22T17:48:41.013800Z

thanks, I'll do that for initial release

onetom 2020-07-22T17:48:43.013900Z

i haven't noticed any other reference to nrepl πŸ™‚

onetom 2020-07-22T17:50:04.014700Z

i also filed this issue: https://github.com/vlaaad/reveal/issues/6 i was not sure if it's better to ask here or have an issue for it, though it's not a bug

πŸ‘ 1
onetom 2020-07-22T18:52:54.016800Z

oh, the latest version number seems odd: 0.0.1-ea23 was it not supposed to be 0.1.0-ea23?

onetom 2020-07-22T19:04:57.019200Z

@vlaaad do you have any plans for limiting the number of elements printed? cursive has just recently introduced a way to interrupt not just the evaluation of the latest expression but also the printing of it too. it would be great to have something like that. alternatively - since reveal runs in the application's process, unlike cursive - you have access to the *print-length* dynamic var and maybe you can use that to limit the number of printed elements.

onetom 2020-07-22T19:05:57.019800Z

then it's not so important to support the interruption of printing

onetom 2020-07-22T19:48:46.023900Z

hmm... i can't turn off antialiasing 😞 im using a 2K display and 16px https://github.com/kika/fixedsys looks absolutely sharp and very readable, because it's also quite a bold typeface, but i can't seem to convince javafx not to do antialiasing. i've added the following to style.clj:

(css/register ::main
    {".text" {:-fx-font-smoothing-type "lcd"}
     ".reveal"
and also specified -Dprism.lcdtext=false as some stackoverflow articles were recommending. in font.clj i changed this too:
(.getStrike BaseTransform/IDENTITY_TRANSFORM FontResource/AA_LCD)
but I guess it doesn't matter, since it's just getting the width of the "a" character.

vlaaad 2020-07-22T20:03:34.024100Z

it was a mistake

vlaaad 2020-07-22T20:03:46.024300Z

it should be 0.1.0-ea23

onetom 2020-07-22T20:09:01.025Z

just to give some idea of the kind of blurriness im talking about, here is a little screenshot

vlaaad 2020-07-22T20:10:55.025800Z

I think style.clj applies only for ui like popup, output panel is hand-crafted

onetom 2020-07-22T20:11:36.026500Z

i have the fear that this might not be supported at all, based on this recent comment on a related issue after 6 years: https://bugs.openjdk.java.net/browse/JDK-8092207?focusedCommentId=14293616&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14293616

onetom 2020-07-22T20:12:16.027200Z

intellij allows turning off antialiasing as it can be seen on my screenshot, but i have the feeling that they are still using swing probably

onetom 2020-07-22T20:13:10.028Z

i remember i was trying the nightcode dude's embeddable vim clone and it suffered from the same blurriness issue. i think he was also using javafx

onetom 2020-07-22T20:14:33.029400Z

but in his case the whole scene was also configured to do some smoothing. i read it somewhere that the trick to get sharp is to apply a 0.5px 45degree translation to the whole scene

onetom 2020-07-22T20:16:13.030200Z

this reference documentation doesn't seem to have anything about turning antialiasing off either: https://openjfx.io/javadoc/11/javafx.graphics/javafx/scene/doc-files/cssref.html

vlaaad 2020-07-22T20:16:52.031100Z

Just checked the way I draw output (using javafx canvas) β€” it has option for text anti-aliasing, which is the same FontSmoothingType and also can't be turned off

😞 1
onetom 2020-07-22T20:18:39.032Z

i found 1 thing which allows disabling some kind of smoothing, but not sure where and how could i hook this in: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/SceneAntialiasing.html

vlaaad 2020-07-22T20:20:42.033300Z

hmm, it says that's about 3d shapes

onetom 2020-07-22T20:20:45.033400Z

@vlaaad but tell me, am I unreasonable to expect this to work? based on my screenshot, isn't the difference immediately obvious and annoying?

onetom 2020-07-22T20:22:28.035Z

i have a 5k display at work; maybe on that one i wouldnt care, but the 27" 2K display and the 32" 4K i have at home, the pixels are visible by the naked eye and i would rather have sharp font even at the cost of shape fidelity

vlaaad 2020-07-22T20:22:54.035200Z

It's super annoying!

vlaaad 2020-07-22T20:27:27.035700Z

it strange javafx devs decided to not implement it

onetom 2020-07-22T20:28:53.036900Z

have u found any more solid proof of that, other than that bug comment above?

vlaaad 2020-07-22T20:32:36.038Z

well, the FontSmoothingType enum has only LCD and GRAY values, and Canvas docs say tht setting smoothing to null is ignored

onetom 2020-07-22T20:36:11.038300Z

https://bugs.openjdk.java.net/browse/JDK-8220150?jql=project%20%3D%20JDK%20AND%20affectedVersion%20%3D%20"14"%20AND%20text%20~%20"font%20anti-aliasing%20off"

onetom 2020-07-22T20:39:32.039500Z

> The component that has the problem is displaying the text using B&W (aliased) font rendering. > No one uses this any more. Swing L&Fs have since 2006 picked up the desktop settings for font smoothing. ... > This does need a fix i can't really make sense of this conversation yet πŸ™‚

vlaaad 2020-07-22T20:40:15.039800Z

it says it's fixed in javafx version 15

vlaaad 2020-07-22T20:40:56.040700Z

you will need java 11 for that... you cna try setting javafx versions explicitly to 15

vlaaad 2020-07-22T20:41:54.041200Z

current version (14 for java 11) is picked up from cljfx

onetom 2020-07-22T20:44:04.041700Z

aaah, i see! thanks, i will give it a try!

onetom 2020-07-22T20:58:15.044500Z

I had that setting mentioned in the bug report:

defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO
...probably left over from Mojave. If i remove it with defaults delete -g CGFontRenderingFontSmoothingDisabled, i get a lot less blurry result. I've upgraded cljfx to 1.7.4 but that probably doesn't make a difference.

onetom 2020-07-22T20:58:45.045300Z

it's usable enough now; thanks a lot for the debugging!

vlaaad 2020-07-22T20:59:06.045500Z

np!

onetom 2020-07-22T21:04:25.045900Z

btw, u forgot to push your tags probably: https://github.com/cljfx/cljfx/commit/1.7.4

vlaaad 2020-07-23T07:47:25.047800Z

I don’t know why clojars shows that link :thinking_face:

onetom 2020-07-22T21:06:02.046700Z

hmm no, it's there on github, but the url is different: https://github.com/cljfx/cljfx/tree/1.7.4

onetom 2020-07-22T21:06:50.047400Z

the 1st url is what i got from https://clojars.org/cljfx when i clicked on ":GitHub: cljfx/cljfx"