Skip to content
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

Various unicode symbols fail to display anywhere in the application after being displayed in italics #607

Open
Nesuniken opened this issue Feb 21, 2023 · 16 comments

Comments

@Nesuniken
Copy link

Nesuniken commented Feb 21, 2023

Tested on Windows 11 with Racket 8.8

Steps to reproduce:

  1. Open DrRacket
  2. Create a new racket file
  3. Paste 𝕣 into it

Once this is done, every 𝕣 character within the current window, as well as any 𝕣 characters displayed in new windows, will experience the bug until the application is completely restarted.

To confirm that italics are specifically the cause, you can reproduce the bug with comments if you change their style settings. Conversely, you can eliminate the bug from the REPL if you change it to not italicize errors.

Originally I encountered this problem just with the less conventional double struck letters (i.e everything but ℂ, ℍ, ℕ, ℙ, ℚ, ℝ, and ℤ), but looking into it further it seems to affect other characters like ⟜⌾◶⎉⍟⎊⥊⌽⍉⍋⍒⍷. They're all mathematical so far, but that could just be because I haven't tested much else. As for how broken italics breaks every other instance of the character, that's still a complete mystery to me.

For the time being, is there a way to disable italics for status bar error messages like there is for REPL ones?

@Nesuniken
Copy link
Author

Changing the application's font to one with better italicization support (such as JetBrains mono) does appear to resolve the issue. Should've checked sooner in hindsight, didn't realize that setting affected text you otherwise can't style.

It'd still be nice if the errors for incomplete character support were less bizarre.

@spdegabrielle
Copy link
Sponsor Member

This would appear to be more likely related to the underlying graphics libraries, which have had recent updates (in 8.9 or 8.10)

does this still happen?

@Nesuniken
Copy link
Author

Afraid so

@spdegabrielle
Copy link
Sponsor Member

seems not to happen on macOS - I wonder if it happens on Linux?

image

@spdegabrielle
Copy link
Sponsor Member

minimal example to try without DrRacket

#lang at-exp racket/gui
(define f (new frame% [label "Simple Edit"]
                      [width 200]
                      [height 200]))
(define c (new editor-canvas% [parent f]))
(define t (new text%))
(send c set-editor t)
(send f show #t)


(define mb (new menu-bar% [parent f]))
(define m-edit (new menu% [label "Edit"] [parent mb]))
(define m-font (new menu% [label "Font"] [parent mb]))
(append-editor-operation-menu-items m-edit #f)
(append-editor-font-menu-items m-font)
(send t set-max-undo-history 100)

;;r𝕣

@Nesuniken
Copy link
Author

Nesuniken commented Oct 11, 2023

Minimal example has the same bug, except the missing character glyph no longer spreads automatically.

Test 1: Pasted three 𝕣's and changed each of their font sizes.
Test 2: Italicized the first 𝕣. It glitches out without mangling the other ones
Test 3: Resized the 2nd 𝕣 again. It now also shows the missing character glyph, but the 3rd 𝕣 is still unaffected

@Nesuniken
Copy link
Author

seems not to happen on macOS - I wonder if it happens on Linux?

image

Did the "unbound identifier" error message correctly italicize 𝕣, or did DrRacket just avoid spreading the missing character symbol to the rest of the editor?

@spdegabrielle
Copy link
Sponsor Member

I couldn't reproduce on macOS by italicising comments
Nor could I with the minimal test app.

image

@Nesuniken
Copy link
Author

Nesuniken commented Oct 17, 2023

Oh, I misunderstood what you had trouble reproducing.

It also seems like your test app defaulted to a different font than mine. Perhaps the font Racket defaults to on MacOS has better italics support? If you could switch to Consolas or Courier New (or whatever the default font for DrRacket on Windows is), I can confirm at least all of those fonts fail to italicize 𝕣 correctly for me.

@Nesuniken
Copy link
Author

Nesuniken commented Oct 17, 2023

Just realized I could use "Revert all preferences to default" to find that Courier New is the default font for DrRacket on Windows. Again, it seems like MacOS Racket has different defaults. Which font is your DrRacket version using?

@spdegabrielle
Copy link
Sponsor Member

Just realized I could use "Revert all preferences to default" to find that Courier New is the default font for DrRacket on Windows. Again, it seems like MacOS Racket has different defaults. Which font is your DrRacket version using?

Menlo

@Nesuniken
Copy link
Author

Nesuniken commented Oct 18, 2023

Strange, I tried switching my font to Menlo but it still didn't work. Jetbrains Mono remains the only font I've found that DrRacket reliably italicizes correctly.

@Nesuniken
Copy link
Author

Nesuniken commented Oct 18, 2023

I couldn't reproduce on macOS by italicising comments Nor could I with the minimal test app.
image

Within the minimal test app, is there any difference between italicizing 𝕣 and "slanting" it? I'm not sure whether the font distributions I'm finding are incomplete or if MacOS is using slanting as a fallback for characters that don't support italics

@spdegabrielle
Copy link
Sponsor Member

Hi, @Nesuniken

I could not find a difference between italic and slant.

I used the characters you provided.

ℂ, ℍ, ℕ, ℙ, ℚ, ℝ, and ℤ
⟜⌾◶⎉⍟⎊⥊⌽⍉⍋⍒⍷.

image

@Nesuniken
Copy link
Author

I just realized I'm having trouble getting italics and slanting to behave differently with any text. Is there some nuance I'm missing. or is Racket using the same procedure for both styles?

@Nesuniken
Copy link
Author

seems not to happen on macOS - I wonder if it happens on Linux?
image

Can finally confirm the bug doesn't happen on Linux. It's exclusive to Windows for whatever reason.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants