Ligatures in coding fonts generally, and in Racket / DrRacket specifically, are a terrible idea. Even worse than `eval`.
1) In a Unicode-aware language like Racket, there's no way to visually distinguish a presentational use of a ligature from a syntactic use. For instance, these two strings would be displayed the same way: (string-append* '("m" "f" "l" "a" "t" "t")) (string-append* '("m" "fl" "a" "t" "t")) 2) Additionally, many of the ligatures being introduced in programming fonts are visually similar to real Unicode characters. So if '!=' becomes some ligaturistic '≠', how do we distinguish that from #\u2260? 3) There are a lot of ways for a given string literal, like "->", to end up in source code, and it doesn't always mean the same thing. Therefore, any global ligature substitution is guaranteed to be wrong part of the time. Sorry to yell at the clouds of progress. I once noticed a related problem in Dybvig and SICP [1]. The moral remains: prettifying code by glyph substitution is a swamp of despair. If you don't believe me, try it for 10 or 15 years. [1] http://tex.stackexchange.com/a/178779 On Sat, Jan 2, 2016 at 5:00 PM, Robby Findler <ro...@eecs.northwestern.edu> wrote: > The DC<%> layer, however, should support drawing text with ligatures. > > Robby > > > On Saturday, January 2, 2016, Matthew Flatt <mfl...@cs.utah.edu> wrote: > >> The `text%` layer currently manipulates characters individually. >> Unfortunately, I think it would be a lot of work to change that layer >> so that kerning and ligatures work in a `text%` editor --- but I >> haven't actually tried it. >> >> At Sat, 2 Jan 2016 16:18:39 -0800, Alexis King wrote: >> > This is well-timed, as I was wondering precisely the same thing myself >> just >> > yesterday. Atom recently gained support for ligatures, and I was trying >> out >> > Hasklig, since I normally use Source Code Pro as my monospace font. I >> tried it >> > out in DrRacket as well, and I was disappointed (though not surprised) >> to find >> > that the ligatures were ignored. >> > >> > I don’t know how much effort it would take to add support for this in >> Racket’s >> > text rendering engine, but I think it would be a welcome addition, >> probably >> > for a lot more than just rendering pretty code ligatures. >> > >> > Alexis >> > >> > > On Jan 2, 2016, at 4:13 PM, David Christiansen < >> da...@davidchristiansen.dk> >> > wrote: >> > > >> > > Hello all, >> > > >> > > I'm using the font Pragmata Pro to display code samples in Slideshow. >> In >> > > particular, I've developed a sort of mini-IDE for Idris that can be >> > > embedded in a slide, using the `interactive' procedure to show it. >> > > >> > > Pragmata Pro has some very nice ligatures for code punctuation. In >> > > particular, it displays => as a fat arrow, -> as a thin arrow, and /= >> as >> > > a slashed-out equals sign. I'd like to display these in my editor, but >> > > it seems to disable ligatures. I've attempted manually setting the >> > > family to 'swiss and the face to "PragmataPro", in the hope of >> avoiding >> > > the 'modern family (which at least the `text' procedure in pict >> ignores >> > > ligatures for), but this hasn't helped. >> > > >> > > I know that Racket can display the ligatures, because evaluating (text >> > > "->" "PragmataPro") at the REPL displays the ligature. >> > > >> > > Does anyone have a suggestion? >> > > >> > > Thanks! >> > > >> > > /David >> > > >> > > -- >> > > You received this message because you are subscribed to the Google >> Groups >> > "Racket Users" group. >> > > To unsubscribe from this group and stop receiving emails from it, >> send an >> > email to racket-users+unsubscr...@googlegroups.com. >> > > For more options, visit https://groups.google.com/d/optout. >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "Racket Users" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to racket-users+unsubscr...@googlegroups.com. >> > For more options, visit https://groups.google.com/d/optout. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Racket Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to racket-users+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.