
@rostislav.svoboda has joined the channel


DrRacket editors support images, which is probably a pain to deal with, with text in the middle.

DrRacket supports multiple keybinding styles which seems to be far from a trivial matter. It’s also multiplatform, which has to be rather painful (different GUI frameworks for different platforms). Supporting utf–8 and various (human and machine) languages doesn’t make it easier probably.

I just quickly tried out some of the examples from the <https://gankra.github.io/blah/text-hates-you/|Text Rendering Hates You> … and it looks like DrRacket has a few weak spots here.

@mflatt has joined the channel

@joel has joined the channel

Reporting bugs for those would be great

Definitely. DrRacket and the underlying drawing libraries build on Pango+Harfbuzz these days, but Pango+Harfbuzz can do better than the way DrRacket’s editor uses it.
At a lowish level, the difference is the combine?
argument to the draw-text
method of dc<%>
. The editor uses draw-text
with combining disabled, which means that it doesn’t do ligatures at all, and various other kinds of combining characters don’t combine. In other words, the editor in DrRacket embraced the “text is individual characters” approach early on.
Why disable combining characters? The original intent was to keep things simple in the sense that if you separately measure text A and and text B, then that tells you the boundary between the, in the text AB. That has all sorts of helpful implications for the data structures and algorithms used in the editor — but it was the wrong way to go in the long run.
Libraries like Pango provide APIs to help editors deal with layout and editing in the middle of text, but the editor API in DrRacket predated most of those. And no one has gotten around to adapting and rewriting the editor.

The “defniitely” above was meant to reply to “DrRacket has a few weak spots”. Bug reports are always welcome, but not dealing with combining characters (or bidirectional text) is going to be the root issue in many potential bug reports.

I think a bug report that combines all the examples from that article featuring combining characters would be useful, and definitely if there are other issues you find that are not about combining bug reports for them are also helpful.

@aowens5189 has joined the channel

@sschwarzer has joined the channel

Is there a way to locally disable formatting when using Racket
/Reindent All
? Something like a special comment before and after some lines to leave them alone?

@hoshom has joined the channel