-
Notifications
You must be signed in to change notification settings - Fork 302
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
JetBrains Mono font is not monospace for bold style & if weight is not "regular" #675
Comments
Another observation: the measured width for my non-bold test string aligns with the bold ones
I verified that by changing the measured width calculation to use the current (font size + 1). Noticably, this is not true for space characters. Only visible characters' seem to have this effect, which means each space in the test string causes the measued widths to be one off by 1. Note that the actual test string is still shown shorter cause it uses the same font size, only the calculation for the width uses a (font-size +1) Using (font-size+1) also to render the property in the plain style shows that it is actually the same width without whitespaces: In fact, using a font < 16.0 does not show the original issue I reported here at all! |
My guess is that for non-Regular font MPS uses "fake bold", i.e. artificially stretch and bolden original font instead of using special Bold version. Probably because it tries to find non-existent |
Does this idea of "fake bold" make sense given my observations, i.e. that the effect differs with different font-sizes as shown above? |
Can you try the MPS 24.1 EAP? I downloaded your project and cannot reproduce the issue in the latest MPS. |
I originally reported this in the unofficial MPS Slack: https://jetbrains-mps.slack.com/archives/C3YUV3YK0/p1713368543862319
When I use the font "JetBrains Mono" with a weight that is not "Regular", the font gets wider in case of using the style "bold" or "boldItalic".
I created a simple, self-contained example with MPS 2023.3 that I attached here called FontWeightIssue.
In the sandbox model, there are two editor lines for the same "name" property. You can set the font for both at the top of the editor and the style for each line individually. It will also show you the measured width next to the name:
FontWeightIssue.zip
The text was updated successfully, but these errors were encountered: