Hi, I've been updating and fixing cyclone/comment and I realized Pd loads similar but different fonts depending on the operating system. I looked closely and, for instance, if you have a label font for a iemgui (such as a slider) with "helvetica", it will look a bit differently in Linux, and it seems this is because Linux loads a similar but not actually 'helvetica'? I don't know, I'm confused, I'm asking.
So, it seems the only way to guarantee things will look exactly the same is if you have 'DejaVu Sans Mono', cause now Pd loads this very same font indeed for all operating systems, right? For that matter, I updated whole of cyclone's documentation so it loads 'DejaVu Sans Mono' for all cyclone/comment objects.
Now a question about loading fonts that concerns cyclone/comment. If I ask it load a font name that it is not present, it will load some default font and I just don't really know which one it is. How can I find out? It seems this 'default' font is also different for each operating system. How can I find out?
Thanks
and well, anyway, I know this is quite known, but we do seem to have discrepancies between patches and rendering even with regular Pd comments (that is, without using cyclone's comment). I can still see differences between help patches. But just to be clear, the font of Pd's comment and everything (objects, messages, number boxes/etc) is DejaVu Sans Mono and this is installed and loaded as being exactly the same for all platforms, right?
Em qui., 23 de jan. de 2020 às 23:38, Alexandre Torres Porres < porres@gmail.com> escreveu:
Hi, I've been updating and fixing cyclone/comment and I realized Pd loads similar but different fonts depending on the operating system. I looked closely and, for instance, if you have a label font for a iemgui (such as a slider) with "helvetica", it will look a bit differently in Linux, and it seems this is because Linux loads a similar but not actually 'helvetica'? I don't know, I'm confused, I'm asking.
So, it seems the only way to guarantee things will look exactly the same is if you have 'DejaVu Sans Mono', cause now Pd loads this very same font indeed for all operating systems, right? For that matter, I updated whole of cyclone's documentation so it loads 'DejaVu Sans Mono' for all cyclone/comment objects.
Now a question about loading fonts that concerns cyclone/comment. If I ask it load a font name that it is not present, it will load some default font and I just don't really know which one it is. How can I find out? It seems this 'default' font is also different for each operating system. How can I find out?
Thanks
On 1/24/2020 12:14 AM, Alexandre Torres Porres wrote:
is DejaVu Sans Mono and this is installed and loaded as being exactly the same for all platforms, right?
Here linux and windows use "bold" font. macOS uses "normal" font :
https://github.com/pure-data/pure-data/blob/master/src/s_main.c#L74
Here there's a search for a base font :
https://github.com/pure-data/pure-data/blob/master/tcl/pd-gui.tcl#L468
Here there's some font settings per OS :
https://github.com/pure-data/pure-data/blob/master/tcl/pd-gui.tcl#L284
--
Mensaje telepatico asistido por maquinas.
Em sex., 24 de jan. de 2020 às 01:03, Lucas Cordiviola < lucarda27@hotmail.com> escreveu:
Here there's a search for a base font :
https://github.com/pure-data/pure-data/blob/master/tcl/pd-gui.tcl#L468
Here there's some font settings per OS :
https://github.com/pure-data/pure-data/blob/master/tcl/pd-gui.tcl#L284
What I see here is that it defaults to 'DejaVu Sans Mono' and always finds it. So if you try to load a general font for all of PD that the system can't find, then it just uses 'DejaVu Sans Mono' instead. So yeah, I believe Pd defaults to 'DejaVu Sans Mono' and finds it, but eve so, it seems rendering is not 100% - But that wasn't my main question, I just wanted to confirm this.
I tested on Linux and it couldn't find 'Times' or 'Helvetica' and it did default to 'DejaVu Sans Mono'. Now, what I'm asking is what happens when you choose 'Times' or 'Helvetica' for a GUI label. I know it doesn't find it and that I don't have it, but it loads pretty similar fonts that are not 'DejaVu Sans Mono'. So my main question is how can we learn what font is actually being loaded in these cases.
Moreover, when I try to load a non existing font in cyclone/comment, it does load some font that I have no idea which one it is, and it seems to be different for each platform - how can I find this out?
Em sex., 24 de jan. de 2020 às 01:48, Alexandre Torres Porres < porres@gmail.com> escreveu:
Em sex., 24 de jan. de 2020 às 01:03, Lucas Cordiviola < lucarda27@hotmail.com> escreveu:
Moreover, when I try to load a non existing font in cyclone/comment, it
does load some font that I have no idea which one it is, and it seems to be different for each platform - how can I find this out?
By 'non existing' I mean something made up, not "times" or "helvetica", but something like "eat my shorts sans mono". It seems that if I try to load times/helvetica in cyclone/comment, it'll load a similar font just like GUI labels
On 1/24/20 3:38 AM, Alexandre Torres Porres wrote:
Hi, I've been updating and fixing cyclone/comment and I realized Pd loads similar but different fonts depending on the operating system.
before you investigate on what Pd might possibly do wrong, please consider (and answer) the following questions:
Office) handle this?
handle this?
handle this?
test all of them on multiple platforms and multiple installations of each platform (as used by real people; not just pristine installations).
can you name a reference application that handles fonts "correctly"? what does this reference application do to achieve this?
mgfr IOhannes
Em sex., 24 de jan. de 2020 às 16:50, IOhannes m zmölnig zmoelnig@iem.at escreveu:
On 1/24/20 3:38 AM, Alexandre Torres Porres wrote:
Hi, I've been updating and fixing cyclone/comment and I realized Pd loads similar but different fonts depending on the operating system.
before you investigate on what Pd might possibly do wrong, please consider (and answer) the following questions:
- how do wide-spread text editing applications (e.g. MS/Open/Libre
Office) handle this?
I was actually testing this before asking here. I could see that Libre Office did something similar where it loaded a similar font to Helvetica when I didn't have it. At least I think so.
- how do even more wide-spread text reading applications (browsers)
handle this?
- how do graphic applications (e.g. photoshop/gimp) handle this?
- how do typesetting applications (e.g. Indesign/Illustratur/Inkscape)
handle this?
test all of them on multiple platforms and multiple installations of each platform (as used by real people; not just pristine installations).
can you name a reference application that handles fonts "correctly"? what does this reference application do to achieve this?
My actual main concern comes from dealing with cyclone/comment and I just wanted to confirm if we had "DejaVu Sans Mono" for every platform, which I think it's quite clear. I'm just trying to see if it's working correctly and I just wanna know what kind of font it's loading, namely when you don't have something like "helvetica" or "times", but it finds something similar.
My best/ideal solution is if I could make cyclone/comment say *you tried to load helvetica, but I loaded "x" instead*. Now, apparently this is handled internally via tk, and I've been having a hard time figuring out how it does so and if it's possible finding out and printing the actual loaded font. So the it seems both cyclone/comment and iemguis load fonts in the same way and this is handled by tk in a rather obscure way.
As far as Pd issues go. I'm sure it was attempted to make this as close to 100% equal as possible, and I'm just curious on what still needed to be made. Now, considering that iemguis properties come with 3 harcoded fonts and it seems only one of them is guaranteed, I could suggest we tried to make Pd come with the exact 3 same fonts or maybe find out and use on the drop down menu the actual font name we're using.
cheers
On 1/24/20 10:07 PM, Alexandre Torres Porres wrote:
My best/ideal solution is if I could make cyclone/comment say *you tried to load helvetica, but I loaded "x" instead*
https://www.tcl.tk/man/tcl/TkCmd/font.htm#M5
that was the first hit i got when searching for "tcl get information on current font"
. Now, apparently this is handled internally via tk,
actually no. this is done on an OS-level.
*most* software that deals with fonts will simply ask the OS's font-manager to give it a certain font, and the font-manger will return a handle to a "close-enough" font. that's a good thing, as applications don't have to worry too much about which fonts are available on a given system (fonts are really hairy regarding licenses). most fonts only cover a small range of available characters (e.g. only characters used in "western" scripts), so picking a sepcific font might turn some glyphs into the famous square symbol. to somewhat fix this, the OS's font-manager will mix various fonts for you, so if you have at least one font with kanji support, you can still use your limited default font and use "it" to display both portuguese and japanese.
gmds IOhannes
Em sex., 24 de jan. de 2020 às 18:35, IOhannes m zmölnig zmoelnig@iem.at escreveu:
On 1/24/20 10:07 PM, Alexandre Torres Porres wrote:
My best/ideal solution is if I could make cyclone/comment say *you tried
to
load helvetica, but I loaded "x" instead*
https://www.tcl.tk/man/tcl/TkCmd/font.htm#M5
that was the first hit i got when searching for "tcl get information on current font"
Yeah, I had seen that, and I'm struggling to see if I can make that happen, but my coding skills are limited and things aren't that 100% straightforward for me, so I don't know if it's possible I figure it out :)
. Now, apparently this is handled internally via tk,
actually no. this is done on an OS-level.
I don't remember where exactly I saw it, but it was one of these manuals/tutorials and stuff online that said so, but sure, I guess you can be right, cool.
As far as my cross-platofrms issues, I guess things don't look that much terrible at all if we have actual different fonts for iemgui labels. But now that I know about it, it annoys me that other fonts besides DejaVu Sans Mono aren't really there. Perhaps this can be taken care just by mentioning in the documentation somewhere (if you don't have times/helvetica installed, similar fonts are loaded). It doesn't seem worth doing more than that and trying to ship the same group of 3 fonts like we're doing with dejavu, right?
I guess the main issue as far as patch discrepancy goes is still how DejaVu is rendered in Pd's commments - I see some quite noticeable differences if I open a help patch with lots of written stuff in Linux, and some of the spacing I did fit in an area can get out of bounds in Linux - specially with line spacing, so it seems.
cheers