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
character/message size bug in macOS 10.15.4 and Pd 0.50-2 #988
Comments
It's most likely the font sizing returned by TK on macOS 10.15. (I'm getting really tired of these small TK issues. where Tk doesn't seem to keep up with mac development very well.) |
In |
This if for the mac running Catalina:::tk::mac::OpenApplication ++++++++++++ |
YOSEMITE:Tk 8.5.19 |
Yes, the metrics are close enough for this probably not to be the source of the problem. EDIT: Clarify with "probably." |
hmm, did not expect that. Because when the values are the same, the problem doesn't appear, how is this not related? |
Well, it's a 1 pixel horizontal difference at the most which means the the letters should be spaced 1 pixel wider apart between the versions. |
Is the space at the end of object boxes on macOS 10.15 wider when there are more words & characters in the box? |
Yup, as I described in the first comment ;) |
that's also why I used long sentences in the examples |
Ok, the it is the metrics in so far as the extra pixels are added to the object box width, even though the rendered font is actually the same size, horizontally. We've run into this before, @umlaeute do you remember the solution? |
unfortunately no (i don't remember anything; i think there's a cronjob that regularily purges all occurences of font metrics from my memory... i don't know how to do it otherwise) (or, what i remember is a completely different situation, where the last character would be eaten and somesuch; that's luckily unrelated to the problem at hand ;-)) |
and also in the message box and comment. hmm, the thing now is that I tried with font size 16, which seem to be equal for both systems (if I got things correctly: 16 10 19?), but they still look different. Catalina adds spaces for bot zoomed and not zoomed! And funny enough, when in Yosemite, using font 16, when I zoomed, I got the same "bad" issue... it looked the same as bad as catalina... where a space has been added |
Just adding that Im having a really annoying time with this bug on Catalina also. btw its still occuring in 0.51.0 and I'm on MacOS 10.15.6 |
I remember having issues with font 12... |
Does this build have the same problem on 10.15? http://docs.danomatika.com/pdbuilds/0.51/Pd-0.51-0-tk8610.zip |
Hey @danomatika I get this message trying to open that build |
This still occurs on 0.51.1 |
Great! In Pd 0.51.3test1 this seems partially resolved on Catalina. New patches created have font size 12 and the shape of the box is correct ( no extra space at the end ). Additionally highlights appear correct and the cursor is in the right place in text. If I change font size for this new patch, that behaviour continues. However, if I open patches created before this issue which, afaik, defaulted to font size 10. They still have a space on the end of each object. The highlight and cursor works which is a big improvement. Users could do a work around to manually change the font size of previous patches from 10 to 12 , however this means layout issues / object overlap will occur sometimes, so isn't ideal really. It would also take a lot of fiddling about for migrating complex multi abstraction patches. |
And what if you change the font size to 10? |
additionally the text cursor appears in the correct place when you click at the start of a message text in edit mode, but in the wrong place when you click towards the end |
Here is a screen recording of the cursor and highlighting behaviour . Starts with 12 then 10 |
To reiterate, the font metrics probably need to be tweaked to better match what Tk 8.6 is giving us and/or it's a possible bug with how Tk and Cocoa report the character / string widths. Further: I probably won't be looking at this any time soon, in case people are waiting on me. |
ok cool, thanks for working on it so far @danomatika This is definitely an improvement on the previous situation |
@dizzybanjo Can you post the font metrics for the Pd versions you are trying? Instructions are in my previous post. |
On macOS 10.14, I'm not seeing this problem and it's probably because the font metrics are the same between old and new versions of Tk. Pd 0.50-2
Pd 0.51-3test1
|
hmm.. ok maybe this is an issue : canvas font, received from pd in pdtk_pd_startup, set in s_main.cset font_family "courier" sizes of chars for each of the Pd fixed font sizes:width(pixels) height(pixels)set font_metrics { sizes as above for zoomed-in viewset font_zoom2_metrics { |
Those are base metrics used to compute the character boxes, but what are the reported font metrics when you run the GUI, ie. my previous post? |
pd-gui.tcl.zip |
sorry @danomatika I didn't have much time to look at this yesterday. To explain more, I cant seem to find what you refer to in your previous instructions in my pd-gui.tcl file. Im not sure if Im doing it wrong or if this is something specific to Catalina. |
I added some test printing for the metrics some years ago, but it's a bit too much info to leave in all the time. Basically, you just need to edit the Tcl file to uncomment the logging lines. For a macOS app, the procedure is as follows:
Do this for both versions you are comparing and copy/paste the metrics output here. You can go back and re-comment those lines to return things to normal. EDIT: Fixed wrong filename. |
Hey Dan I dont see that in pd_bindings.tcl here either. Those files end at line 441 for me? |
I don't need copies of the files, we have those in the Git repository. I need the Pd window console output when you start each version by following the steps in my previous post. Basically, open the .app bundle, edit the pd-gui.tcl file, close, start Pd, show log level 4, copy/paste the metrics text output to a new post here. It should look like this previous post from porres. |
yes I understand. When I follow your instructions I don't see those lines in the code, and cannot search and find fit_font_into_metrics. Indeed my pd_bindings.tcl files ( from the releases compiled from MacOS ) finish at line 441. Thats why I posed the files to verify that. Should I be using a different version? |
pd-gui.tcl not pd_bindings.tcl
EDIT: Sorry, that somehow got mixed up earlier.
|
Pd 0.51-3test1 : Tk 8.6.10 Pd 0.51-2: Tk 8.6.10 |
Pd 0.50-2 : Tk 8.5.19 |
Ok, since the numbers are the same, this indicates the problem is not with the metrics. |
Does this problem happen when you disable retina resolution?
Are you only seeing it on retina screens (built-in MBP display) or also external monitors? |
hi, let me get back in, please, how can I help? |
@porres Well, you could respond to my previous post. In any case, I have a MBP 16 here running 10.15.7 and I see:
For Pd-0.51-3test5 I also see similar metrics:
As the character box sizing is the same, the issue may lie elsewhere, as in how Tk draws to the canvas etc. |
OTOH there is clear change from macOS 10.14 on my MBP 13, Pd-0.51-3test5:
although in this case, the box size is wider on the older platform. |
I've done some additional research and it may have something to do with the font handling / hinting which can render thinner on macOS 10.15, ie. font smoothing defaults changes and a Tk bug report. Looking at the behavior, if you drag-select text, the positioning of the background highlight & cursor are correct on the left side and start to offset as you go towards the right. Also, the font kerning seems to shift as you highlight stuff. I have a feeling it's an issue with the Tk text widget. |
At this point, at least there is a workaround. I suggest using Menlo as it's based off of Bitstream Vera Mono & DejaVu Sans Mono and is the most similar, except for the different zero chars. |
Thanks for all the great detective work on this @danomatika . Apologies I haven't tested much over the last week or so I had a crunch on a project. This sounds like a good workaround. I've switched to Menlo now and I think its solves any usability issues from old patches. Nice one! |
@porres Can you check and compare Menlo with DJSM. If it's "close enough" in sizing, we could simply change the default font as a quick fix for now as people are moving more and more to 10.15 and now 11.0. |
@dizzybanjo Well, I ordered a new M1 MBP so I will have to deal with it soon anyway. Better to know now as I cannot stay on 10.14 forever. |
@millerpuckette I did some quick comparisons on macOS 10.14 and Menlo is almost identical to DejaVu Sans Mono. I will make an image to highlight the differences, but I think we could safely make it the default font for macOS until we can figure out what's going on with DJSM. |
Cool, as long as it's the same size nothing much else matters to me :)
Will hold off on 0.52-3 until I hear.
thanks
M
…On Sun, Nov 15, 2020 at 10:24:07AM -0800, Dan Wilcox wrote:
@millerpuckette I did some quick comparisons and Menlo is almost identical to DejaVu Sans Mono. I will make an image to highlight the differences, but I think we could safely make it the default font for macOS until we can figure out what's going on with DJSM.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://urldefense.com/v3/__https://github.com/pure-data/pure-data/issues/988*issuecomment-727613887__;Iw!!Mih3wA!W5f5Y5kSAS3QH-aRab9BXwdniBzxSWNs267PO8aLzCf_8yzFMMzuPwP1tX8g$
|
Here's an image highlighting the differences between the same test patch (Browser -> Pure Data/7.stuff/tools/sizingtest.pd) using either DejaVu Sans Mono or Menlo. I made screenshots on macOS 10.14 using Pd-0.51-3test5 with font size 12 as the character sizing issue only happens on 10.15+, so this should be an accurate comparison. As far as I can tell, the sizing and positioning are pretty much the same. The main differences are adjustments to individual characters such as the slashed '0', more leading space on the 'l', lower strike on the 'e', thicker '_' and '-', etc. I don't think most people would notice a change and patch positioning should not break. I like the changes to 'l' and the underscores are easier to read in Menlo. I will go ahead and make a separate PR implementing this change. For completeness, here are the individual screenshots: DejaVu Sans Mono Menlo |
@millerpuckette Font change in #1222. |
Closed by #1222 |
This is a very annoying bug I'm facing now that I upgraded to Catalina.
Using Pd has become a painful task when dealing with comments that have lots of characters, and the same deal with messages or object boxes because the text is smaller!
I hope it's clear from the screen shot that, for instance, the end bar of the comment is a bit far from the actual end of the comment. This is less noticeable if the comment has less characters, so it depends on the number of characters and the difference is larger wit more characters.
This also changes the size of messages and object boxes.
Because of this, when trying to select a text from a message, comment or object, you can easily miss it and grab a couple of characters away from what you wanted. Also, if you're trying to shorten the size of comments/objects/messages by resizing the boxes, the text gets broken in separate lines before you'd expect visually.
Enough said, here's a screenshot.
Now let's check a screenshot from another computer I have (also with Pd 0.50-2) with an older system (10.10) but I'm sure things were alright in the same computer with (10.14).
We can see that the sliders and messages are of the same sizes but the text fits better. This is because in the first image, what we have is that the characters are displayed smaller than they should.
EDIT: This is still happening with the latest version from this repository - 285c53f - ping @danomatika
test patch: test.pd.zip
The text was updated successfully, but these errors were encountered: