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

Wire text editor doesn't support non-monospaced fonts #2944

Open
DerelictDrone opened this issue Dec 14, 2023 · 4 comments
Open

Wire text editor doesn't support non-monospaced fonts #2944

DerelictDrone opened this issue Dec 14, 2023 · 4 comments
Labels

Comments

@DerelictDrone
Copy link
Member

DerelictDrone commented Dec 14, 2023

Describe the bug
At present, attempting to use a font that isn't monospaced will cause the text editor to print text over other text.

To Reproduce
Steps to reproduce the behavior:

  1. Switch font to Fixedsys or a custom system font that isn't monospaced.
  2. Open _helloworld.txt

Expected behavior
The text editor should be capable of supporting fonts where certain characters are wider or slimmer than others.

Screenshots
Example using the default font Fixedsys
fixedsys

Example using a known monospaced custom font, Cascadia Mono
cascadia mono

Test was performed with only wiremod loaded, in singleplayer, and on gm_construct.

@Vurv78
Copy link
Contributor

Vurv78 commented Dec 14, 2023

This is way too much work and would significantly bog down the editor for very little reason. So I don't see this ever happening. It's like all the trouble of supporting unicode, but with even less benefit.

I'll leave it open for other people to give their inputs for a bit.

@DerelictDrone
Copy link
Member Author

DerelictDrone commented Dec 14, 2023

This is way too much work and would significantly bog down the editor for very little reason. So I don't see this ever happening. It's like all the trouble of supporting unicode, but with even less benefit.

I'll leave it open for other people to give their inputs for a bit.

To me, it looks like this is mainly just a problem of trying to calculate the position of the next text draw of the same line, you can see that the @name Hello World worked properly when it all stayed one color, maybe we could switch out some of the calculations that work with constant width supplied from font with a sum of the surface.GetTextSize for successive text draws on the same line.

Though, this also affects the text cursor's position...

@DerelictDrone
Copy link
Member Author

DerelictDrone commented Dec 14, 2023

If the issue itself won't get fixed then the least that can be done is to remove Fixedsys from the default fonts list, so users are less likely to run into the above behavior.

@cryx3001
Copy link

cryx3001 commented Dec 22, 2023

I also encounter this issue when I try to use a font which is not present on my system (for example the Monaco font or a custom one which does not exist). It seems to use a fallback font which is also non-monospaced.
However, it seems that there is no way to check if a font actually exist or not, and no way to edit the fallback font.

@Vurv78 Vurv78 added the Easy fix label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants