Dear all,
I would like to use Pd's canvas for simple, timed text projection in a piece, and I have a couple of questions:
object and [zexy/list2symbol] to then [label $1( the canvas. It's working very fine but when I try to open the properties menu of the canvas I get this error message:
(Tcl) UNHANDLED ERROR: wrong # args: should be "pdtk_iemgui_dialog mytoplevel mainheader dim_header wdt min_wdt wdt_label hgt min_hgt hgt_label rng_header min_rng min_rng_label max_rng max_rng_label rng_sched lin0_log1 lilo0_label lilo1_label loadbang steady num_label num snd rcv gui_name gn_dx gn_dy gn_f gn_fs bcol fcol lcol" while executing "pdtk_iemgui_dialog .gfxstub100311e20 |cnv| ------selectable_dimensions(pix):------ 15 1 size: 0.0 0.0 empty ------visible_rect..." ("uplevel" body line 1) invoked from within "uplevel #0 $docmds"
I can open the properties menu of a new canvas, but as soon as I label it with another long string I get the same error message. I can edit all the canvas properties just fine with messages, so for me it's not a critical issue. I was just wondering whether I should worry about the stability of my patch.
label according to the character count of the string. I've added the char count manually for each line in the .txt file, but I was wondering if there's a way to get the char count of a line automatically…
Thanks
Laure
On 20.02.19 17:39, Laure M. Hiendl wrote:
Dear all,
I would like to use Pd's canvas for simple, timed text projection in a piece, and I have a couple of questions:
- I'm getting the projected text from a .txt file via the [text get]
object and [zexy/list2symbol] to then [label $1( the canvas. It's working very fine but when I try to open the properties menu of the canvas I get this error message:
(Tcl) UNHANDLED ERROR: wrong # args: should be "pdtk_iemgui_dialog mytoplevel mainheader dim_header wdt min_wdt wdt_label hgt min_hgt hgt_label rng_header min_rng min_rng_label max_rng max_rng_label rng_sched lin0_log1 lilo0_label lilo1_label loadbang steady num_label num snd rcv gui_name gn_dx gn_dy gn_f gn_fs bcol fcol lcol" while executing "pdtk_iemgui_dialog .gfxstub100311e20 |cnv| ------selectable_dimensions(pix):------ 15 1 size: 0.0 0.0 empty ------visible_rect..." ("uplevel" body line 1) invoked from within "uplevel #0 $docmds"
I can open the properties menu of a new canvas, but as soon as I label it with another long string I get the same error message. I can edit all the canvas properties just fine with messages, so for me it's not a critical issue. I was just wondering whether I should worry about the stability of my patch.
no need to worry. the problem is, that the iemguis don't properly escape spaces in the labels, and tcl gets confused. if you need edit the properties (without messages that is), you need to first set the label to some string without spaces. (alternatively you could use a non-breaking-space (" ") which looks the same as a space but isn't one and therefore doesn't confuse the tcl parser.
but of course this is a bug and ought to be fixed.
- To center align the projected text I'm repositioning the canvas
label according to the character count of the string. I've added the char count manually for each line in the .txt file, but I was wondering if there's a way to get the char count of a line automatically…
[list fromsymbol] | [list length]
but that will actually count bytes rather than characters. the numbers are the same as long as you are using ASCII; as soon as you don't the numbers will differ. there used to be a UTF8-to-unicode patch around somewhere¹ that would convert utf8 bytelists (as output by [list fromsymbol] into unicode codepoint lists (one codepoint per character; unless you are into diacritics), that would help here. that's probably overkill for your problem at hand though...
- How can I get commas "," and semicolons ";" through the [text] object?
you don't.
fgmasdr IOhannes
note, however, that it will confuse the Tcl parser when using such a string as a canvas label, like in 1). you can substitute them with similar looking codepoints http://unicode.org/cldr/utility/confusables.jsp :-)
Christof
Gesendet: Mittwoch, 20. Februar 2019 um 17:53 Uhr Von: "IOhannes m zmoelnig" zmoelnig@iem.at An: pd-list@lists.iem.at Betreff: Re: [PD] Canvas questions
On 20.02.19 17:39, Laure M. Hiendl wrote:
Dear all,
I would like to use Pd's canvas for simple, timed text projection in a piece, and I have a couple of questions:
- I'm getting the projected text from a .txt file via the [text get]
object and [zexy/list2symbol] to then [label $1( the canvas. It's working very fine but when I try to open the properties menu of the canvas I get this error message:
(Tcl) UNHANDLED ERROR: wrong # args: should be "pdtk_iemgui_dialog mytoplevel mainheader dim_header wdt min_wdt wdt_label hgt min_hgt hgt_label rng_header min_rng min_rng_label max_rng max_rng_label rng_sched lin0_log1 lilo0_label lilo1_label loadbang steady num_label num snd rcv gui_name gn_dx gn_dy gn_f gn_fs bcol fcol lcol" while executing "pdtk_iemgui_dialog .gfxstub100311e20 |cnv| ------selectable_dimensions(pix):------ 15 1 size: 0.0 0.0 empty ------visible_rect..." ("uplevel" body line 1) invoked from within "uplevel #0 $docmds"
I can open the properties menu of a new canvas, but as soon as I label it with another long string I get the same error message. I can edit all the canvas properties just fine with messages, so for me it's not a critical issue. I was just wondering whether I should worry about the stability of my patch.
no need to worry. the problem is, that the iemguis don't properly escape spaces in the labels, and tcl gets confused. if you need edit the properties (without messages that is), you need to first set the label to some string without spaces. (alternatively you could use a non-breaking-space (" ") which looks the same as a space but isn't one and therefore doesn't confuse the tcl parser.
but of course this is a bug and ought to be fixed.
- To center align the projected text I'm repositioning the canvas
label according to the character count of the string. I've added the char count manually for each line in the .txt file, but I was wondering if there's a way to get the char count of a line automatically…
[list fromsymbol] | [list length]
but that will actually count bytes rather than characters. the numbers are the same as long as you are using ASCII; as soon as you don't the numbers will differ. there used to be a UTF8-to-unicode patch around somewhere¹ that would convert utf8 bytelists (as output by [list fromsymbol] into unicode codepoint lists (one codepoint per character; unless you are into diacritics), that would help here. that's probably overkill for your problem at hand though...
- How can I get commas "," and semicolons ";" through the [text] object?
you don't.
fgmasdr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list