
I don’t know what would cause that, but maybe @mflatt or @greg would know.

When I (browse-syntax #'(module racket/base (displayln "hello")))
in an Emacs REPL the resulting frame text is nearly the same size as in DrRacket.

It’s definitely not something like a 2X difference, which if it were would suggest I’m seeing a HiDPI issue. So it seems to “just work” for me on Ubuntu 18.04 with Emacs 25.2.

Note that I have the “Text Scale” thing in Ubuntui tweaks set to 1.5, which is how most HiDPI things work OK-ish for me.

But IIRC @rntz you’re using Ubuntu 22.04, and probably a newer Emacs, too.

You might even be on Wayland instead of X.

So I’m not sure what HiDPI advice to give?

ISTR there is some env var that racket/gui
looks for, which might affect 2X scaling; maybe ensuring that’s set in Emacs, would fix this?? (wild guess theory)

@rntz Had trouble finding this, probably needs an index tag like “HiDPI”, but here it is: PLT_DISPLAY_BACKING_SCALE
: https://docs.racket-lang.org/gui/windowing-overview.html#%28idx._%28gentag._13._%28lib._scribblings%2Fgui%2Fgui..scrbl%29%29%29

So for example $ PLT_DISPLAY_BACKING_SCALE=3.0 drracket
gives you a DrRacket scaled quite large. Now how to make this work in Emacs launching a syntax browser? I think something like setenv
in Emacs, then (re)start the Racket Mode back end (which is the process supporting your user program and REPL)? Trying that…

Bingo. That works for me.

M-x eval-expression
and enter(setenv "PLT_DISPLAY_BACKING_SCALE" "3.0")
.M-x racket-start-back-end
.- Start a REPL and do
(require macro-debugger/syntax-browser)
and(browse-syntax #'(module racket/base (displayln "hello")))
and you should get larger text.

But why would it be different when starting from Emacs in the first place? When PLT_DISPLAY_BACKING_SCALE
is not set, racket/gui
consults Gtk to get the scale; is it possible that GDK_SCALE
or GDK_DPI_SCALE
is getting set?

@rntz Does that work for you? If so, then move step 1 to your Emacs init file.

@mflatt AFAICT it’s not different for me, on my older Ubuntu system.

Hopefully @rntz can get you some details for a deeper fix if possible, on their end (??) or in racket/gui
(??). (But meanwhile/instead I think the work-around I suggested could work.)

Racket is a procedural language organized into modules. Go is close to being a domain specific language that Thompson made for Google to solve their systems programming needs.