Skip to content

Console font bug, cursor is off #19

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

Closed
processing-bot opened this issue Nov 6, 2019 · 8 comments
Closed

Console font bug, cursor is off #19

processing-bot opened this issue Nov 6, 2019 · 8 comments
Labels
has attachment Attachment was not transfered from GitLab

Comments

@processing-bot
Copy link
Collaborator

Created by: clankill3r

I reported a similar issue a while ago for the text editor but I noticed it happens in the console too.

2019-11-06 09 57 22

I'm using the latest version of Samuel's website (which is from some time back, so it might been have fixed).

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

Hey there! The text editing area was resolved in sampottinger/processing#103 (Processing's custom text area UI was not compatible with Java 11 possibly b/c JEP 263) and should be active in your build. I wasn't able to reproduce but I'll keep digging. Which font and at what size?

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

Hey there! Sorry... I was able to reproduce the console issue with Source Code Pro 14px. This is a bit funky because I thought Processing simply used DefaultStyledDocument default drawing in EditorConsole unlike JEditTextArea in which processing uses custom drawing behavior. I'll need to do some digging... That said, the text edit area should be correct.

@processing-bot
Copy link
Collaborator Author

Created by: clankill3r

I had Source Code Pro 16px on OSX.

Op wo 6 nov. 2019 om 23:48 schreef A Samuel Pottinger <
[email protected]>:

Hey there! Sorry... I was able to reproduce with Source Code Pro 14px.
This is a bit funky because I thought Processing simply used
DefaultStyledDocument default drawing in EditorConsole unlike
JEditTextArea in which processing uses custom drawing behavior. I'll need
to do some digging...


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#19,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAFUKWU6E55F2FVW3QSU3L3QSNCR7ANCNFSM4JJRW5LQ
.

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

Hey there! So... we aren't doing custom rendering for that component... It's just a standard JTextPane (see EditorConsole). I'm slightly worried this might be https://bugs.openjdk.java.net/browse/JDK-8158370 (see also https://bugs.openjdk.java.net/browse/JDK-8156217). :-/ The resolution would be wait for Java to fix upstream or override drawing behavior. I'll be back with more soon.

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

Well... I'm not quite sure how this bug is manifesting but I traced it down to https://github.com/processing/processing4/blob/master/app/src/processing/app/ui/EditorConsole.java#L173. It appears that there's a rounding error in the text size calculation (inside Swing) but it only happens for certain gutter sizes. Using the default gutter size or switching Editor.LEFT_GUTTER to basically anything other than 44px seems to fix it. ☹️ So that's not great. I tried a bunch of different font / font sizes and this seems to resolve. I don't think I want to take over rendering behavior so I'll put this up to a PR. As with sampottinger/processing#103 this doesn't seem to happen with most fonts but it does happen with Source Code Pro. 😢

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

@clankill3r - This will be resolved with #20. Thank you for your help!

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

Hey @clankill3r - this is previewed in a new build. See https://github.com/sampottinger/processing4 (and https://www.datadrivenempathy.com/processing).

@processing-bot
Copy link
Collaborator Author

Created by: github-actions[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has attachment Attachment was not transfered from GitLab
Projects
None yet
Development

No branches or pull requests

1 participant