The way to send a lable to a canvas is by first going through a symbol box and the a [send "ToMyCanvasReceiveName"( . The canvas needs to be set up with the same receive name e.g. "ToMyCanvasReceiveName".
In order to get text into the canvas you use
[MyText( | [symbol] | [label $1( | [; "ToMyCanvasReceiveName"(
BTW, I just tried replacing the pound sign [35( with unicode [8983( which is a pound sign for telephones. This works on the current Pd 0.51 but unfortunately not on my older 0.49 that I still have to use at the moment. It gives me the wrong replacement character as the character range still seems to be limited to maybe 256 characters or so on 0.49.
Ingo
-----Original Message----- From: Bill Purvis [mailto:bill@billp.org] Sent: Sunday, January 17, 2021 5:57 PM To: Ingo Subject: Re: [PD] unicode symbols and Pd
On 17/01/2021 13:36, Ingo wrote:
Yes, of course it all works fine with [print] ! That's what I said.
What does not work is sending it to a canvas. That's what I need!
Ingo
How do you propose sending it to the canvas - I sent it to a symbol box? Sorry if I haven't understood - I did say I was a newbie.
Bill
-- +----------------------------------------+ | Bill Purvis | | email: bill@billp.org | +----------------------------------------+
BTW, I just tried replacing the pound sign [35( with unicode [8983( which is a pound sign for telephones. This works on the current Pd 0.51
how so ?
on my machines (win, debian) ASCII code is still wrapped between 0 and 255, like always. so sending ASCII 8983 to [list tosymbol] outputs the same result as ASCII 23. (I'm on PD 0.51.2)
BTW, i use ASCII 164 as a (well, rather unsatisfying) replacement for ASCII 35 (diamond).
And yes, I agree it would be great if canvases would allow this character to be displayed correctly.
best
oliver
[8983( works for me on Windows7 64-bit with Pd 0.51.1. It doesn't work with Debian 9.5 32-bit with 0.49.
I don't know why but I need it to work on my Linux machines and not on Windows.
164 looks better than the dollar sign. I might use that as well. I went through them all and couldn't decide so far . . .
Ingo
-----Original Message----- From: Pd-list [mailto:pd-list-bounces@lists.iem.at] On Behalf Of oliver Sent: Sunday, January 17, 2021 7:41 PM To: Pd-List Subject: Re: [PD] unicode symbols and Pd
BTW, I just tried replacing the pound sign [35( with unicode [8983( which is a pound sign for telephones. This works on the current Pd 0.51
how so ?
on my machines (win, debian) ASCII code is still wrapped between 0 and 255, like always. so sending ASCII 8983 to [list tosymbol] outputs the same result as ASCII 23. (I'm on PD 0.51.2)
BTW, i use ASCII 164 as a (well, rather unsatisfying) replacement for ASCII 35 (diamond).
And yes, I agree it would be great if canvases would allow this character to be displayed correctly.
best
oliver
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Ingo wrote:
[8983( works for me on Windows7 64-bit with Pd 0.51.1.
that's really strange. can somebody else confirm this ? i tested it (on this very system) and i got the result i just posted before ...
It doesn't work with Debian 9.5 32-bit with 0.49.
try updating PD with either BACKPORTS enabled in your apt sources list
https://backports.debian.org/Instructions/
or try a "testing" version of DEBIAN, then you should get PD 0.51. on LINUX too.
best
oliver
On 1/17/21 7:40 PM, oliver wrote:
BTW, I just tried replacing the pound sign [35( with unicode [8983( which is a pound sign for telephones. This works on the current Pd 0.51
how so ?
on my machines (win, debian) ASCII code is still wrapped between 0 and 255, like always.
actually no. ASCII is 0..127 by definition.
otoh, bytes are 8bit numbers, which cover a range of 0..255.
so sending ASCII 8983 to [list tosymbol] outputs the same result as ASCII 23. (I'm on PD 0.51.2)
you need to convert the unicode codepoint to utf8. for the unicodepoint 8983, the utf-8 sequence is "232 166 131". feeding this sequence to [list tosymbol] will give you "覃" (which is think is what you want).
And yes, I agree it would be great if canvases would allow this character to be displayed correctly.
but they do. since ages.
i'm honestly baffled by this discussion. afaik we have a working unicode implementation in Pd for more than 10 years. what's the buzz, tell me what's a-happening...
amsdr IOhannes
Em dom., 17 de jan. de 2021 às 17:42, IOhannes m zmölnig zmoelnig@iem.at escreveu:
afaik we have a working unicode implementation in Pd for more than 10 years.
what's the buzz, tell me what's a-happening...
I didn't know if Pd had full blast support for unicode cross platform. Nice to know.
I wanted to know if all systems had at least sharp/flat unicode glyphs out of the box as macs do. Other symbols would be great too but I see we can't guarantee. So, now that support is granted, I did ask if there was an easy and free font for musical unicode symbols that we can all install. A perfect and ideal scenario would be for Pd to carry one and ship it, but that might be aiming too high on my dreams :)
On Sun, 2021-01-17 at 18:03 -0300, Alexandre Torres Porres wrote:
Em dom., 17 de jan. de 2021 às 17:42, IOhannes m zmölnig < zmoelnig@iem.at> escreveu:
afaik we have a working unicode implementation in Pd for more than 10 years. what's the buzz, tell me what's a-happening...
I didn't know if Pd had full blast support for unicode cross platform. Nice to know.
I wanted to know if all systems had at least sharp/flat unicode glyphs out of the box as macs do.
♭ ♮ ♯ work fine for me in Pd on Linux.
However, the higher-order ones I can copy from the page you linked to the 'Label' field of [cnv] editor. When I 'apply', they are converted to a 'ð' (icelandic eth). I did only anecdotal tests, but this applies to all the characters with a decimal number higher than 119000 from that page.
Roman
On 1/17/21 10:03 PM, Alexandre Torres Porres wrote:
I wanted to know if all systems had at least sharp/flat unicode glyphs out of the box as macs do.
as macs *currently* do. in general i wouldn't extrapolate too much from your current system to future or past system (though in the specific case, i guess it's probably safe to assume that 𝄪 and 𝄫 won't go away.
apart from that: the only guaranteed font to be available on Windows and Linux is "DejaVu Sans Mono" (and if the font-renderer weren't broken on macOS, you could count on that font too). open the ttf-file with a font manager program and inspect it to see, which glyphs it natively supports.
and it looks like it has (single) sharp and flat signs, but not double ones.
Other symbols would be great too but I see we can't guarantee. So, now that support is granted, I did ask if there was an easy and free font for musical unicode symbols that we can all install. A perfect and ideal scenario would be for Pd to carry one and ship it, but that might be aiming too high on my dreams:)
that doesn't actually sound perfect and ideal to me. fonts are generally large, and i would consider 𝄪 and 𝄫 to be edge cases. i don't think i ever needed them; your use-case might of course be different, but i don't think we should target at satisfying each and every usecase out of the box.
IOhannes
Em dom., 17 de jan. de 2021 às 20:09, IOhannes m zmölnig zmoelnig@iem.at escreveu:
the only guaranteed font to be available on Windows and Linux is "DejaVu Sans Mono" (and if the font-renderer weren't broken on macOS, you could count on that font too). open the ttf-file with a font manager program and inspect it to see which glyphs it natively supports.
and it looks like it has (single) sharp and flat signs, but not double ones.
hmm, I'm looking at FontBook on DejaVu and I don't see sharp & flat signs.
that doesn't actually sound perfect and ideal to me. fonts are generally large, and i would consider 𝄪 and 𝄫 to be edge cases.
yes, they are.
i don't think i ever needed them; your use-case might of course be different
I was thinking of a database of scales, for didactical purposes, so G# minor (parallel key of B Major) with an altered major 7th has F𝄪, for instance.
but i don't think we should target at satisfying each and every usecase out of the box.
I was just thinking of all great possibilities we could have with a nice set of musical symbol fonts, like displaying chords and being able to design some simple notation things for chords and scales. More than double sharp/flats, microtonal stuff like quarter tone would be also awesome. They have that in open music.
Nonetheless, I guess one can try and design a GUI for that. But that'd be way out of my league...
cheers
On Sun, Jan 17, 2021 at 4:58 PM Alexandre Torres Porres porres@gmail.com wrote:
Em dom., 17 de jan. de 2021 às 20:09, IOhannes m zmölnig zmoelnig@iem.at escreveu:
the only guaranteed font to be available on Windows and Linux is "DejaVu Sans Mono" (and if the font-renderer weren't broken on macOS, you could count on that font too). open the ttf-file with a font manager program and inspect it to see which glyphs it natively supports.
and it looks like it has (single) sharp and flat signs, but not double
ones.
hmm, I'm looking at FontBook on DejaVu and I don't see sharp & flat signs.
that doesn't actually sound perfect and ideal to me. fonts are generally large, and i would consider 𝄪 and 𝄫 to be edge cases.
yes, they are.
i don't think i ever needed them; your use-case might of course be different
I was thinking of a database of scales, for didactical purposes, so G# minor (parallel key of B Major) with an altered major 7th has F𝄪, for instance.
but i don't think we should target at satisfying each and every usecase out of the box.
I was just thinking of all great possibilities we could have with a nice set of musical symbol fonts, like displaying chords and being able to design some simple notation things for chords and scales. More than double sharp/flats, microtonal stuff like quarter tone would be also awesome. They have that in open music.
just to chime in here, is there any reason not to use a dedicated musically oriented font like Opus? it seems weird to try to use one font for every sort of purpose and i'm sure there's a few free fonts that could be used that are similar, even ones under GPL. i suspect that Open Music uses one of these.
best, scott
Nonetheless, I guess one can try and design a GUI for that. But that'd be way out of my league...
cheers _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On Sun, Jan 17, 2021 at 4:58 PM Alexandre Torres Porres porres@gmail.com wrote: just to chime in here, is there any reason not to use a dedicated musically oriented font like Opus?
No objection in using music fonts, on the contrary, and I just wanted to know what is a good/easy one to tell people to install. Regarding Opus, I don't think it's good for this case as unicode based ones seem better, as you can just add symbols to your regular set. Once you go Opus, that's all you can use and all of Pd will just display music symbol characters in objects, messages, ect.
it seems weird to try to use one font for every sort of purpose
but who said that?
Anyway, I mentioned Bravura as the only one I found out there, not sure about any other option.
and i'm sure there's a few free fonts that could be used that are similar, even ones under GPL. i suspect that Open Music uses one of these.
yeah, I have no idea what they use, but that's inside a GUI, so it can be a dedicated font. And yeah, in the case of a dedicated GUI external, I guess one can use a font like that.
By the way, cyclone/comment can load arbitrary fonts and I tried Opus in it, and it worked fine.
cheers
Em dom., 17 de jan. de 2021 às 23:12, Alexandre Torres Porres < porres@gmail.com> escreveu:
No objection in using music fonts, on the contrary, and I just wanted to know what is a good/easy one to tell people to install.
It seems the best and easy ones to install I found so far is FreeSerif and Symbola.
I mentioned Bravura as the only one I found out there, not sure about any
other option.
Bravura was a pain to install, seems more powerful I guess? But FreeSerif and Symbola get the job done more easily.
My mind is blown with how many symbols this font (DejaVu) has, I had no
idea, I thought it only had the most usual ones and everything else came from "the system". This actually happens with the bass clef that I can see. I don't see it in DejaVu (or Menlo), so where is it coming from?
Ok, I know it's coming from somewhere else, and that's not the point. Maybe a better question is to just make sure that this indeed happens (that the Pd will look elsewhere in your fonts to see if you have a bass clef or whatever else is missing in DejaVu). I just wanna get this straight, how it happens and if it happens in all operating systems, before I tell people that they can just install something like symbola that they'll be able to display whole notes and whatnot in iemguis' labels.
cheers
Am 18. Jänner 2021 20:24:27 MEZ schrieb Alexandre Torres Porres porres@gmail.com:
Em dom., 17 de jan. de 2021 às 23:12, Alexandre Torres Porres < porres@gmail.com> escreveu:
Ok, I know it's coming from somewhere else, and that's not the point. Maybe a better question is to just make sure that this indeed happens (that the Pd will look elsewhere in your fonts to see if you have a bass clef or whatever else is missing in DejaVu). I
Pd doesn't do anything like that. in fact, most applications don't do anything like that. fonts are a *hard* problem, that's why these problems are typically solved centrally (on the toolkit level (eg Tcl/Tk) or even lower).
there are of course exceptions to this: eg Gem handles the fonts on its own (using a library; I'm not crazy enough attempting to handle fonts myself).
as a rule of thumb: if you don't specify the font-file directly (eg /path/to/DejaVuSans-Mono.ttl
) but rather the font name (eg "DejaVu Sans Mono"), then you are working with a high level interface that will use multiple fonts to render a glyph.
price question: when selecting a font for Pd (using the -font-face
cmdline option), do you specify the font by filename, or by the font-name?
mfg.hft.fsl IOhannes
Em seg., 18 de jan. de 2021 às 17:45, IOhannes m zmölnig zmoelnig@iem.at escreveu:
there are of course exceptions to this: eg Gem handles the fonts on its own (using a library; I'm not crazy enough attempting to handle fonts myself).
Wow, This is huge for me. And I missed what this meant when I first read it (don't read emails on summer vacation).
So we can do this on the external level. I see it might be tricky and perhaps you can elaborate on the challenges please. It's just that once I was asking if we could do that for external (thinking about cyclone/comment then) and I got the idea that telling externals where to look for fonts is not possible, but I see now Gem allows us to do that!
This would really be great for something like this where you can ship a "music symbol" font and use an external like cyclone/comment to display cool symbolic musical thingies!
I'll check on it and see if I can make any of it.
Cheers
I guess I got excited too quickly, Gem uses a library that renders fonts in openGL, so it's not really something we could do for any kind of external... right?
Em seg., 15 de fev. de 2021 às 00:32, Alexandre Torres Porres < porres@gmail.com> escreveu:
I got the idea that telling externals where to look for fonts is not possible
yeah, that was probably the right idea...
It only works for GEM because it is actually responsible for drawing text onto the screen (probably using the freetype library, but haven't checked). The Pd core, on the other hand, doesn't do anything like that, it just sends commands to the GUI.
However, you can certainly ask Tcl/Tk to draw text using a certain font. In fact, the IEM GUI objects do exactly this.
The only remaining problem is that you want to use local fonts instead of asking the user to install them. Actually, we already have the pdfontloader Tcl extension (https://github.com/pure-data/pdfontloader) to load the bundled Deja Vu Sans Mono font. However, it's specific to Windows (AddFontResourceExW) and you would need to port it to other systems. I'm not sure if it's even possible on macOS and Linux, you would have to do some research. But if it works, you could just call |pdfontloader::load $path |in your external with sys_vgui(). However, the extension has to compiled against the correct Tk version, so ideally it would be shipped with Pd. You could open a feature request.
Christof
On 15.02.2021 04:32, Alexandre Torres Porres wrote:
Em seg., 18 de jan. de 2021 às 17:45, IOhannes m zmölnig <zmoelnig@iem.at mailto:zmoelnig@iem.at> escreveu:
there are of course exceptions to this: eg Gem handles the fonts on its own (using a library; I'm not crazy enough attempting to handle fonts myself).
Wow, This is huge for me. And I missed what this meant when I first read it (don't read emails on summer vacation).
So we can do this on the external level. I see it might be tricky and perhaps you can elaborate on the challenges please. It's just that once I was asking if we could do that for external (thinking about cyclone/comment then) and I got the idea that telling externals where to look for fonts is not possible, but I see now Gem allows us to do that!
This would really be great for something like this where you can ship a "music symbol" font and use an external like cyclone/comment to display cool symbolic musical thingies!
I'll check on it and see if I can make any of it.
Cheers
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Or could just ask the user to install the fonts :-) It's a simple drag and drop after all...
On 15.02.2021 04:55, Christof Ressi wrote:
It only works for GEM because it is actually responsible for drawing text onto the screen (probably using the freetype library, but haven't checked). The Pd core, on the other hand, doesn't do anything like that, it just sends commands to the GUI.
However, you can certainly ask Tcl/Tk to draw text using a certain font. In fact, the IEM GUI objects do exactly this.
The only remaining problem is that you want to use local fonts instead of asking the user to install them. Actually, we already have the pdfontloader Tcl extension (https://github.com/pure-data/pdfontloader) to load the bundled Deja Vu Sans Mono font. However, it's specific to Windows (AddFontResourceExW) and you would need to port it to other systems. I'm not sure if it's even possible on macOS and Linux, you would have to do some research. But if it works, you could just call |pdfontloader::load $path |in your external with sys_vgui(). However, the extension has to compiled against the correct Tk version, so ideally it would be shipped with Pd. You could open a feature request.
Christof
On 15.02.2021 04:32, Alexandre Torres Porres wrote:
Em seg., 18 de jan. de 2021 às 17:45, IOhannes m zmölnig <zmoelnig@iem.at mailto:zmoelnig@iem.at> escreveu:
there are of course exceptions to this: eg Gem handles the fonts on its own (using a library; I'm not crazy enough attempting to handle fonts myself).
Wow, This is huge for me. And I missed what this meant when I first read it (don't read emails on summer vacation).
So we can do this on the external level. I see it might be tricky and perhaps you can elaborate on the challenges please. It's just that once I was asking if we could do that for external (thinking about cyclone/comment then) and I got the idea that telling externals where to look for fonts is not possible, but I see now Gem allows us to do that!
This would really be great for something like this where you can ship a "music symbol" font and use an external like cyclone/comment to display cool symbolic musical thingies!
I'll check on it and see if I can make any of it.
Cheers
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Em seg., 15 de fev. de 2021 às 00:59, Christof Ressi info@christofressi.com escreveu:
Or could just ask the user to install the fonts :-) It's a simple drag and drop after all...
I agree it doesn't look worth the effort, given it's not that complicated to install a font.
Nonetheless... I'd be willing, cause I'm really into making the user experience the easiest as it can be.
On 15.02.2021 04:55, Christof Ressi wrote:
if it works, you could just call pdfontloader::load $path in your external with sys_vgui(). However, the extension has to compiled against the correct Tk version, so ideally it would be shipped with Pd. You could open a feature request.
there I go then :) https://github.com/pure-data/pure-data/issues/1269
thanks!
Em seg., 15 de fev. de 2021 às 00:57, Christof Ressi info@christofressi.com escreveu:
I'm not sure if it's even possible on macOS and Linux, you would have to do some research.
Maybe Dan has already shed some light on this
Em ter., 19 de jan. de 2021 às 12:38, Dan Wilcox danomatika@gmail.com escreveu:
The Pd GUI does not load a font file directly (from ttf, otf, etc), and this is good, as things like font caching are good to have, especially when it's handled by the system for you.
As mentioned in the fonts/README.txt in the Pd sources, DejaVu Sans Mono is now standard on most platforms (Menlo is a very close replacement on macOS for now) because:
- Linux: the font is a dependency, ie. installing pd via apt-get also
installs DVSM
- Windows: the font file itself is shipped with Pd and loaded into Tk
using a custom Tcl extension written in C which calls the Windows API to have the system load the font file and make it available, this way people don't have to manually install DVSM to their system when using Pd
- macOS: the font file itself is shipped within the Pd .app bundle and the
system reads a key inside the Info.plist which tells it to find and load that file when the Pd .app is opened.
so, for a first attempt, I'd tell linux users only to "hey, install this yourselves", they'll even be happy :)
windows is pretty covered and we can see if we can adapt mac to load an external that can read a key inside a given Info.plist
The main patch canvas uses the single font specified by -font-face when rendering. The IEM GUI object labels have 3 font options, but none are settable, ie. replace or add a new option. It would probably be difficult to modify the canvas to work with "rich text" where fonts and styles could be mixed and matched. Maybe I'm wrong on this, but I'm not sure if anyone has tried with the Tk GUI itself, more probably with one of the forks.
yeah, rich text and multiple fonts would be nice to design documentation, but something related to this is happening, where if you have unicode glyphs installed in your system, Pd seems to find them even though they're not in DJVSM
cheers
yeah, rich text and multiple fonts would be nice to design documentation, but something related to this is happening, where if you have unicode glyphs installed in your system, Pd seems to find them even though they're not in DJVSM
I think this is covered by font caching. The system loads fonts it uses for the native UI and maybe a couple others for extra symbols, language, etc by default. Then when you ask for an extra symbol, you can get it even if it's not in the font family you are using.
If you use the font file directly, ie. for use in GEM, then you only get what's in the font file as there is no connection to the system in this regard. To get the required symbol coverage, then you need to use multiple fonts manually or a font with all symbols built-in.
For more:
http://www.unifoundry.com http://www.unifoundry.com/ (and no, I don't recommend Unifont as a Pd requirement)
https://stackoverflow.com/questions/34732718/why-isnt-there-a-font-that-cont... https://stackoverflow.com/questions/34732718/why-isnt-there-a-font-that-contains-all-unicode-glyphs
Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/
On 1/18/21 1:55 AM, Alexandre Torres Porres wrote:
Em dom., 17 de jan. de 2021 às 20:09, IOhannes m zmölnig zmoelnig@iem.at escreveu:
the only guaranteed font to be available on Windows and Linux is "DejaVu Sans Mono" (and if the font-renderer weren't broken on macOS, you could count on that font too). open the ttf-file with a font manager program and inspect it to see which glyphs it natively supports.
and it looks like it has (single) sharp and flat signs, but not double ones.
hmm, I'm looking at FontBook on DejaVu and I don't see sharp & flat signs.
i don't know about FontBook, but my trusty fontforge shows flat, natural and sharp signs.
see attachment.
i checked both the system installed version of "DejaVu Sans Mono" and the one that is included n Pd's font/ folder.
gfmdsar IOhannes
Em seg., 18 de jan. de 2021 às 08:50, IOhannes m zmölnig zmoelnig@iem.at escreveu:
i don't know about FontBook
good, it sucks
but my trusty fontforge
yay, nice tip, I looked for something like this and didn't find and there's a mac version :)
shows flat, natural and sharp signs.
My mind is blown with how many symbols this font has, I had no idea, I thought it only had the most usual ones and everything else came from "the system". This actually happens with the bass clef that I can see. I don't see it in DejaVu (or Menlo), so where is it coming from?
Anyway, Menlo also has a sharp and a flat, and exactly the same block you sent as an attachment.
see attachment.
no, see mine
So, this means sharps and flats are officially supported in Pd for all systems out of the box and that's great! I can include it in my external ;)
Now, is there any special trick or magic to type in such characters? Besides knowing the list value and send it to [list tosymbol] or copy/pasting it?
cheers
On Sun, 2021-01-17 at 21:40 +0100, IOhannes m zmölnig wrote:
On 1/17/21 7:40 PM, oliver wrote:
And yes, I agree it would be great if canvases would allow this character to be displayed correctly.
but they do. since ages.
Can't reproduce right now, but I remember instances where I typed umlaute and had to hit backspace twice to delete them. I didn't bother to report that, but will do, if I encounter it again.
i'm honestly baffled by this discussion. afaik we have a working unicode implementation in Pd for more than 10 years. what's the buzz, tell me what's a-happening...
One part of the buzz is that I can copy the characters from [1] to a graphical text editor or terminal and they are displaying correctly there, but not in Pd.
[1] https://www.alt-codes.net/music_note_alt_codes.php
Roman
Em dom., 17 de jan. de 2021 às 18:31, Roman Haefeli reduzent@gmail.com escreveu:
On Sun, 2021-01-17 at 21:40 +0100, IOhannes m zmölnig wrote:
On 1/17/21 7:40 PM, oliver wrote:
And yes, I agree it would be great if canvases would allow this character to be displayed correctly.
but they do. since ages.
Can't reproduce right now, but I remember instances where I typed umlaute and had to hit backspace twice to delete them. I didn't bother to report that, but will do, if I encounter it again.
I reported that and it got fixed. Was it in symbol atom boxes?
But with these other unicode characters, I need to hit backspace twice inside message boxes similarly to that previous issue, so maybe we can have another report.
IOhannes m zmölnig wrote:
On 1/17/21 7:40 PM, oliver wrote:
you need to convert the unicode codepoint to utf8. for the unicodepoint 8983, the utf-8 sequence is "232 166 131". feeding this sequence to [list tosymbol] will give you "覃" (which is think is what you want)
wow, thanks, that's great news !
still, that's not the desired symbol, i think there's been a decimal/hexadecimal mismatch of the unicode code point ...
anyway, the right utf-8 sequence for "VIEWDATA SQUARE" would be "226 140 151", see attached patch.
i'm honestly baffled by this discussion. afaik we have a working unicode implementation in Pd for more than 10 years. what's the buzz, tell me what's a-happening...
(... whyyyyy wouuuuld youuuuu want to know ... ;-))
it's the difference between the representation of the sharp symbol in symbol canvas vs. GUI canvas, where the sharp symbol is printed as a dollar sign.
attached is example image and patch, plus utf-8 solution !
best
oliver
Em dom., 17 de jan. de 2021 às 18:53, oliver oliver@klingt.org escreveu:
it's the difference between the representation of the sharp symbol in symbol canvas vs. GUI canvas, where the sharp symbol is printed as a dollar sign.
people, it's the third time I say this is a very well and known issue and that we already have a fix for that...
Just to make it bluntly clear, I'll link to the Pull Request on github that fixes it, here it is https://github.com/pure-data/pure-data/pull/953 - it deals with different things, including the fact that # becomes $, which is part of this issue => https://github.com/pure-data/pure-data/issues/558
I also mentioned a couple of times I have a hack that allows you to use "#" in labeles, see [else/display], and it uses dynamic patching to create the object with that in the label as an argument... see https://github.com/porres/pd-else/blob/master/Classes/Abstractions/display.p...
anyway, the right utf-8 sequence for "VIEWDATA SQUARE" would be "226 140 151", see attached patch.
attached is example image and patch, plus utf-8 solution !
works for me, but the VIEWDATA SQUARE (U+2317) is not the "right" symbol for sharp https://www.compart.com/en/unicode/U+2317 you actually want this one instead => https://www.compart.com/en/unicode/U+266F
[list fromsybol] gives me "226 153 175" for this character, please try it.
best
oliver _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
works for me, but the VIEWDATA SQUARE (U+2317) is not the "right" symbol for sharp https://www.compart.com/en/unicode/U+2317 you actually want this one instead => https://www.compart.com/en/unicode/U+266F
sorry, i wasn't clear there. i didn't mean a literally (musical) sharp but a simple diamond, as ingo in his first mail wanted to have printed on a canvas or any other PD GUI.
neither of our approaches is a "real" sharp/diamond/hash key/pound key/raute ... (= ASCII 35), but just a workaround to visually achieve what's not possible ATM in PD itself
[list fromsybol] gives me "226 153 175" for this character, please try it.
thanks, yeah ! great to have a real musical sharp here !
best
oliver
Em dom., 17 de jan. de 2021 às 17:42, IOhannes m zmölnig zmoelnig@iem.at escreveu:
you need to convert the unicode codepoint to utf8.
just wondering, how can you do that? :)
Alexandre Torres Porres wrote:
Em dom., 17 de jan. de 2021 às 17:42, IOhannes m zmölnig <zmoelnig@iem.at mailto:zmoelnig@iem.at> escreveu:
you need to convert the unicode codepoint to utf8.
just wondering, how can you do that? :)
i did a little research (there are most likely better/easier ways):
================================================
unicode code point (U+xxxx) to Hex UTF-8 bytes:
http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=8983&mode=decimal
(make sure you select "Interpret as: decimal code point" below !
================================================
hexadecimal to decimal:
https://www.rapidtables.com/convert/number/hex-to-decimal.html
or roll your own hex2dec with PD-vanilla ;-)
================================================
best
oliver
Em dom., 17 de jan. de 2021 às 19:47, oliver oliver@klingt.org escreveu:
i did a little research (there are most likely better/easier ways):
http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=8983&mode=decimal
I was asking and wondering if there was an easy way to do it by hand and inside Pd, but it seems to be a very complicated conversion.
On 1/17/21 11:25 PM, Alexandre Torres Porres wrote:
Em dom., 17 de jan. de 2021 às 17:42, IOhannes m zmölnig zmoelnig@iem.at escreveu:
you need to convert the unicode codepoint to utf8.
just wondering, how can you do that? :)
representation) 2. at PdCon-2009 me an maja did a utf-8 to unicode-point converter [utf82codepoint] (i'm pretty sure i write this sentence half a year ago on this very mailinglist). that's the other way round though. 3. so i just resurrected that old 1-object library and added a [codepoint2utf8] converter as well. there's no deken-package yet, but it's only self-contained abstractions which you can find at https://git.iem.at/pd/unicode/
dfamse IOhannes
Copy/Paste and UTF-8 work both fine on my Windows computer. With the relatively current Pd 0.51.1 and the older 0.47. Thanks, IOhannes!
So it's not the [canvas] that is causing the problem with unicode characters (except for the ascii 35 issue).
The code for the alternative # (8983) in UTF-8 turned out to be "226 140 151" instead of "232 166 131". But this doesn't change the real problem.
On my Debian 9.5 with Pd 0.49 I cannot display anything higher than ascii values. All higher characters are displayed with empty squares or nothing at all.
Copying the patch with the [#( as unicode "8983" results in an empty square even in the message box. So the problem seems rather be an issue of the OS not being able to display higher unicode characters at all. I'll have to figure out how to do this . . .
On my Windows computer I have a addon for displaying unicode. This doesn't seem to be present in my very basic Debian installation that uses fluxbox as a windows manager.
So, there is a bug in [canvas] not displaying ascii 35 correctly and UTF-8 (alternative characters) is not working for me right now. My last solution would be to edit the "Helvetica" or "DejaVu" font for displaying a "#" with a lower number. However, last time I was looking for the location of Helvetica I couldn find it and didn't get any answer here. If anyone knows the location of the font when being used by Pd please let me know.
This means I probably have to wait another few years until someone will fix the [canvas] issue for displaying a sharp "#".
Thanks anyway! I give up for now.
Ingo
-----Original Message----- From: Pd-list [mailto:pd-list-bounces@lists.iem.at] On Behalf Of IOhannes m zmölnig Sent: Sunday, January 17, 2021 9:40 PM To: pd-list@lists.iem.at Subject: Re: [PD] unicode symbols and Pd
On 1/17/21 7:40 PM, oliver wrote:
BTW, I just tried replacing the pound sign [35( with unicode [8983( which is a pound sign for telephones. This works on the current Pd 0.51
how so ?
on my machines (win, debian) ASCII code is still wrapped between 0 and 255, like always.
actually no. ASCII is 0..127 by definition.
otoh, bytes are 8bit numbers, which cover a range of 0..255.
so sending ASCII 8983 to [list tosymbol] outputs the same result as ASCII 23. (I'm on PD 0.51.2)
you need to convert the unicode codepoint to utf8. for the unicodepoint 8983, the utf-8 sequence is "232 166 131". feeding this sequence to [list tosymbol] will give you "?" (which is think is what you want).
And yes, I agree it would be great if canvases would allow this character to be displayed correctly.
but they do. since ages.
i'm honestly baffled by this discussion. afaik we have a working unicode implementation in Pd for more than 10 years. what's the buzz, tell me what's a-happening...
amsdr IOhannes
On 1/18/21 11:14 AM, Ingo wrote:
This means I probably have to wait another few years until someone will fix the [canvas] issue for displaying a sharp "#".
in the meantime you could start by installing a couple of fonts (preferably ones that have the missing symbols) on your system and then restart Pd.
i'm using Debian for a couple of years, and i cannot remember any problems in the last decade.
afaik, the only thing that does not work¹ are emojis. while they are technically just unicode symbols, it seems that i cannot enter them (although they are displayed correctly, if you get them into the patch "by other means", like [list tosymbol] or by editing the patch)
fgmdsar IOhannes
¹ apart from '#' in iemguis; but i think this has been covered extensively in this thread during the last days.
On Mon, 2021-01-18 at 12:43 +0100, IOhannes m zmölnig wrote:
afaik, the only thing that does not work¹ are emojis. while they are technically just unicode symbols, it seems that i cannot enter them (although they are displayed correctly, if you get them into the patch
Saying "the only thing that does not work" implies everything else works. I'm not sure what you exactly mean by that. Are you saying that utf-8-support is fully implemented, but Pd's font doesn't contain all symbols? Or do you even mean all utf-8 can be displayed in Pd (except emojis)?
On a minimal Debian Buster where I basically only installed Pd 0.51.3 from backports, I cannot display many symbols in Pd, although the same symbols are displayed correctly in the terminal. See attached screenshot with a clef example.
I don't have a problem with Pd's utf-8 support per se, but according to your statement I wonder what is expected and what is a bug.
Roman
Are you saying that utf-8-support is fully implemented, but Pd's font doesn't contain all symbols?
Yes.
On a minimal Debian Buster where I basically only installed Pd 0.51.3 from backports, I cannot display many symbols in Pd, although the same symbols are displayed correctly in the terminal. See attached screenshot with a clef example.
Well, your terminal obviously uses a different font. Just make sure that the Unicode codepoint you want to use is actually supported by the font that is used by Pd (DVSM on Windows/Linux, Menlo on macOS)
Christof
On 18.01.2021 13:48, Roman Haefeli wrote:
On Mon, 2021-01-18 at 12:43 +0100, IOhannes m zmölnig wrote:
afaik, the only thing that does not work¹ are emojis. while they are technically just unicode symbols, it seems that i cannot enter them (although they are displayed correctly, if you get them into the patch
Saying "the only thing that does not work" implies everything else works. I'm not sure what you exactly mean by that. Are you saying that utf-8-support is fully implemented, but Pd's font doesn't contain all symbols? Or do you even mean all utf-8 can be displayed in Pd (except emojis)?
On a minimal Debian Buster where I basically only installed Pd 0.51.3 from backports, I cannot display many symbols in Pd, although the same symbols are displayed correctly in the terminal. See attached screenshot with a clef example.
I don't have a problem with Pd's utf-8 support per se, but according to your statement I wonder what is expected and what is a bug.
Roman
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
IOhannes m zmölnig wrote:
in the meantime you could start by installing a couple of fonts (preferably ones that have the missing symbols) on your system and then restart Pd.
I already have DejaVu and Helvetica installed that has all fonts that I need. If I'm not completely off these should be distributed with Pd and be the same on all platforms, right?
If all characters were in the DejaVu / Helvetica fonts I should be able to display the alternative # (8983) with UTF-8. It works on Windows with both older and newer software versions of Pd. Thus these characters should be there. If they are not in the DejaVu font but elswhere how do I know what to install?
It would be soooooo easy to edit one single unused character of the fonts if I knew where they were. Unfortunately I do not expect myself to be able to read through the entire Pd source code to find out. The default font locations of Debian don't seem to do anything - at least not for me on Pd in Debian.
Ingo
-----Original Message----- From: Pd-list [mailto:pd-list-bounces@lists.iem.at] On Behalf Of IOhannes m zmölnig Sent: Monday, January 18, 2021 12:43 PM To: pd-list@lists.iem.at Subject: Re: [PD] unicode symbols and Pd
On 1/18/21 11:14 AM, Ingo wrote:
This means I probably have to wait another few years until someone will fix the [canvas] issue for displaying a sharp "#".
in the meantime you could start by installing a couple of fonts (preferably ones that have the missing symbols) on your system and then restart Pd.
i'm using Debian for a couple of years, and i cannot remember any problems in the last decade.
afaik, the only thing that does not work are emojis. while they are technically just unicode symbols, it seems that i cannot enter them (although they are displayed correctly, if you get them into the patch "by other means", like [list tosymbol] or by editing the patch)
fgmdsar IOhannes
apart from '#' in iemguis; but i think this has been covered extensively in this thread during the last days.
Em seg., 18 de jan. de 2021 às 13:31, Ingo ingo@miamiwave.com escreveu:
IOhannes m zmölnig wrote:
in the meantime you could start by installing a couple of fonts
(preferably
ones that have the missing symbols) on your system and then restart Pd.
I already have DejaVu and Helvetica installed that has all fonts that I need. If I'm not completely off these should be distributed with Pd and be the same on all platforms, right?
No, only DejaVu is distributed by Pd and it is the only font that should be the same in all platforms. Actually, in the meantime, we're shipping Menlo as a substitute for DejaVu on macs. So even this is not entirely true.
I know iemguis have "Helvtica" and "Times" listed as font options, but Pd doesn't ship those and you're expected to have them in your system. If you don't, you might actually get a different font that's supposed to be similar.
If all characters were in the DejaVu / Helvetica fonts
sharp and flat are in DejaVu. I don't know about Helvetica, we'd have to look, no one mentioned Helvetica here.
I should be able to display the alternative # (8983) with UTF-8.
Yes, if you have DejaVu, you should display the sharp symbol, which is not "8983", that is the "VIEWDATA SQUARE", and it is not present in DejaVu! The sharp symbol looks like but is a completely different symbol. It is also completely different from the number sign "#" (and not an "alternate" version of it). Anyway, its value is "9839", see https://www.fileformat.info/info/unicode/char/266f/index.htm - as an utf-8 list this is "0xE2 0x99 0xAF" and "226 153 175" as a decimal list, send this list to [list tosymbol] and you'll see the sharp sign!
It would be soooooo easy to edit one single unused character of the fonts if I knew where they were. Unfortunately I do not expect myself to be able to read through the entire Pd source code to find out.
This is not in the source code of Pd, the font is a .ttf file, and for you to edit it, you have to edit the font and generate a new custom design font for you.
cheers
Thanks a lot, Alexandre!
"226 153 175" works perfectly!
This is exactly what I had been looking for!
I'm actually using DejaVa für displaying this.
I'm happy that I don't have to install anything new or update anything!
The funny thing is that when I search for dejavu I only get one result in /usr/share/fonts/ .
When I rename the folder it still displays everything normally - so there must be a backup or similar in another location.
Maybe it is compiled which could be why it doesn't show up.
Ingo
From: Alexandre Torres Porres [mailto:porres@gmail.com] Sent: Monday, January 18, 2021 6:38 PM To: Ingo Cc: Pd-List Subject: Re: [PD] unicode symbols and Pd
Em seg., 18 de jan. de 2021 às 13:31, Ingo <ingo@miamiwave.com mailto:ingo@miamiwave.com > escreveu:
IOhannes m zmölnig wrote:
in the meantime you could start by installing a couple of fonts (preferably ones that have the missing symbols) on your system and then restart Pd.
I already have DejaVu and Helvetica installed that has all fonts that I need. If I'm not completely off these should be distributed with Pd and be the same on all platforms, right?
No, only DejaVu is distributed by Pd and it is the only font that should be the same in all platforms. Actually, in the meantime, we're shipping Menlo as a substitute for DejaVu on macs. So even this is not entirely true.
I know iemguis have "Helvtica" and "Times" listed as font options, but Pd doesn't ship those and you're expected to have them in your system. If you don't, you might actually get a different font that's supposed to be similar.
If all characters were in the DejaVu / Helvetica fonts
sharp and flat are in DejaVu. I don't know about Helvetica, we'd have to look, no one mentioned Helvetica here.
I should be able to display the alternative # (8983) with UTF-8.
Yes, if you have DejaVu, you should display the sharp symbol, which is not "8983", that is the "VIEWDATA SQUARE", and it is not present in DejaVu! The sharp symbol looks like but is a completely different symbol. It is also completely different from the number sign "#" (and not an "alternate" version of it). Anyway, its value is "9839", see https://www.fileformat.info/info/unicode/char/266f/index.htm - as an utf-8 list this is "0xE2 0x99 0xAF" and "226 153 175" as a decimal list, send this list to [list tosymbol] and you'll see the sharp sign!
It would be soooooo easy to edit one single unused character of the fonts if I knew where they were. Unfortunately I do not expect myself to be able to read through the entire Pd source code to find out.
This is not in the source code of Pd, the font is a .ttf file, and for you to edit it, you have to edit the font and generate a new custom design font for you.
cheers
Em seg., 18 de jan. de 2021 às 14:38, Alexandre Torres Porres < porres@gmail.com> escreveu:
No, only DejaVu is distributed by Pd and it is the only font that should be the same in all platforms. Actually, in the meantime, we're shipping Menlo as a substitute for DejaVu on macs. So even this is not entirely true.
errata: we're not actually "shipping" it, Menlo is just available in macs. No idea why DejaVu stopped working properly though, I just hope it gets fixed soon so we can say Pd ships DejaVu for all systems.