A
adrianv
Thu, Dec 31, 2020 5:24 PM
I'm trying to print columnar output of numbers in RC3. I'm having a problem
with minus signs because they aren't the same width as anything else, it
seems. I'm wondering if this is the same result everyone gets, or if it
depends on my environment (like my font is misbehaving). I'm using Ubuntu.
function str_join(list,sep="",_i=0, _result="") =
_i >= len(list)-1 ? (_i==len(list) ? _result : str(_result,list[_i])) :
str_join(list,sep,_i+1,str(_result,list[_i],sep));
function repeat(x,n) = [for(i=[1:1:n]) x];
minus = chr(8722);
space_figure = chr(8199);
echo(str_join(["X", each repeat("-",10), "X"])); // Hyphen character, too
short
echo(str_join(["X", each repeat(minus,10), "X"])); // unicode minus
character
echo(str_join(["X", each repeat("0",10), "X"])); // zero digit
echo(str_join(["X", each repeat("1",10), "X"])); // one digit
echo(str_join(["X", each repeat(space_figure,10), "X"])); // Figure space
echo(str_join(["X", each repeat(" ",10), "X"])); // Regular space (wrong)
The output in my console:
http://forum.openscad.org/file/t2477/screen.png
I was expecting to see the line of minus signs the same with as the three
lines below with numbers and figure spaces.
--
Sent from: http://forum.openscad.org/
I'm trying to print columnar output of numbers in RC3. I'm having a problem
with minus signs because they aren't the same width as anything else, it
seems. I'm wondering if this is the same result everyone gets, or if it
depends on my environment (like my font is misbehaving). I'm using Ubuntu.
function str_join(list,sep="",_i=0, _result="") =
_i >= len(list)-1 ? (_i==len(list) ? _result : str(_result,list[_i])) :
str_join(list,sep,_i+1,str(_result,list[_i],sep));
function repeat(x,n) = [for(i=[1:1:n]) x];
minus = chr(8722);
space_figure = chr(8199);
echo(str_join(["X", each repeat("-",10), "X"])); // Hyphen character, too
short
echo(str_join(["X", each repeat(minus,10), "X"])); // unicode minus
character
echo(str_join(["X", each repeat("0",10), "X"])); // zero digit
echo(str_join(["X", each repeat("1",10), "X"])); // one digit
echo(str_join(["X", each repeat(space_figure,10), "X"])); // Figure space
echo(str_join(["X", each repeat(" ",10), "X"])); // Regular space (wrong)
The output in my console:
<http://forum.openscad.org/file/t2477/screen.png>
I was expecting to see the line of minus signs the same with as the three
lines below with numbers and figure spaces.
--
Sent from: http://forum.openscad.org/
NH
nop head
Thu, Dec 31, 2020 5:57 PM
I get the same on Windows but I never expect it to work because the console
isn't a monospace font.?
[image: image.png]
On Thu, 31 Dec 2020 at 17:25, adrianv avm4@cornell.edu wrote:
I'm trying to print columnar output of numbers in RC3. I'm having a
problem
with minus signs because they aren't the same width as anything else, it
seems. I'm wondering if this is the same result everyone gets, or if it
depends on my environment (like my font is misbehaving). I'm using
Ubuntu.
function str_join(list,sep="",_i=0, _result="") =
_i >= len(list)-1 ? (_i==len(list) ? _result : str(_result,list[_i])) :
str_join(list,sep,_i+1,str(_result,list[_i],sep));
function repeat(x,n) = [for(i=[1:1:n]) x];
minus = chr(8722);
space_figure = chr(8199);
echo(str_join(["X", each repeat("-",10), "X"])); // Hyphen character,
too
short
echo(str_join(["X", each repeat(minus,10), "X"])); // unicode minus
character
echo(str_join(["X", each repeat("0",10), "X"])); // zero digit
echo(str_join(["X", each repeat("1",10), "X"])); // one digit
echo(str_join(["X", each repeat(space_figure,10), "X"])); // Figure space
echo(str_join(["X", each repeat(" ",10), "X"])); // Regular space
(wrong)
The output in my console:
http://forum.openscad.org/file/t2477/screen.png
I was expecting to see the line of minus signs the same with as the three
lines below with numbers and figure spaces.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I get the same on Windows but I never expect it to work because the console
isn't a monospace font.?
[image: image.png]
On Thu, 31 Dec 2020 at 17:25, adrianv <avm4@cornell.edu> wrote:
> I'm trying to print columnar output of numbers in RC3. I'm having a
> problem
> with minus signs because they aren't the same width as anything else, it
> seems. I'm wondering if this is the same result everyone gets, or if it
> depends on my environment (like my font is misbehaving). I'm using
> Ubuntu.
>
> function str_join(list,sep="",_i=0, _result="") =
> _i >= len(list)-1 ? (_i==len(list) ? _result : str(_result,list[_i])) :
> str_join(list,sep,_i+1,str(_result,list[_i],sep));
>
> function repeat(x,n) = [for(i=[1:1:n]) x];
>
> minus = chr(8722);
> space_figure = chr(8199);
>
> echo(str_join(["X", each repeat("-",10), "X"])); // Hyphen character,
> too
> short
> echo(str_join(["X", each repeat(minus,10), "X"])); // unicode minus
> character
> echo(str_join(["X", each repeat("0",10), "X"])); // zero digit
> echo(str_join(["X", each repeat("1",10), "X"])); // one digit
> echo(str_join(["X", each repeat(space_figure,10), "X"])); // Figure space
> echo(str_join(["X", each repeat(" ",10), "X"])); // Regular space
> (wrong)
>
>
> The output in my console:
>
> <http://forum.openscad.org/file/t2477/screen.png>
>
> I was expecting to see the line of minus signs the same with as the three
> lines below with numbers and figure spaces.
>
>
>
>
>
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
A
adrianv
Thu, Dec 31, 2020 6:38 PM
I thought the minus character was supposed to be the same width as the
figures. I'm not sure why I thought this. I can't find it stated
anywhere. Note that all the digits are the same width and they are the
width of the figure space. In an actual proportional font, the 1 will be
narrower. It looks like "+" is the same width as the minus (U+2122).
So is there a space character or combination of them that are supposed to
match the width of a minus sign?
Note see:
http://jkorpela.fi/chars/spaces.html
nophead wrote
I get the same on Windows but I never expect it to work because the
console
isn't a monospace font.?
[image: image.png]
On Thu, 31 Dec 2020 at 17:25, adrianv <
I'm trying to print columnar output of numbers in RC3. I'm having a
problem
with minus signs because they aren't the same width as anything else, it
seems. I'm wondering if this is the same result everyone gets, or if it
depends on my environment (like my font is misbehaving). I'm using
Ubuntu.
function str_join(list,sep="",_i=0, _result="") =
_i >= len(list)-1 ? (_i==len(list) ? _result : str(_result,list[_i]))
:
str_join(list,sep,_i+1,str(_result,list[_i],sep));
function repeat(x,n) = [for(i=[1:1:n]) x];
minus = chr(8722);
space_figure = chr(8199);
echo(str_join(["X", each repeat("-",10), "X"])); // Hyphen character,
too
short
echo(str_join(["X", each repeat(minus,10), "X"])); // unicode minus
character
echo(str_join(["X", each repeat("0",10), "X"])); // zero digit
echo(str_join(["X", each repeat("1",10), "X"])); // one digit
echo(str_join(["X", each repeat(space_figure,10), "X"])); // Figure
space
echo(str_join(["X", each repeat(" ",10), "X"])); // Regular space
(wrong)
The output in my console:
<http://forum.openscad.org/file/t2477/screen.png>
I was expecting to see the line of minus signs the same with as the three
lines below with numbers and figure spaces.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
I thought the minus character was supposed to be the same width as the
figures. I'm not sure why I thought this. I can't find it stated
anywhere. Note that all the digits are the same width and they are the
width of the figure space. In an actual proportional font, the 1 will be
narrower. It looks like "+" is the same width as the minus (U+2122).
So is there a space character or combination of them that are supposed to
match the width of a minus sign?
Note see:
http://jkorpela.fi/chars/spaces.html
nophead wrote
> I get the same on Windows but I never expect it to work because the
> console
> isn't a monospace font.?
>
> [image: image.png]
>
> On Thu, 31 Dec 2020 at 17:25, adrianv <
> avm4@
> > wrote:
>
>> I'm trying to print columnar output of numbers in RC3. I'm having a
>> problem
>> with minus signs because they aren't the same width as anything else, it
>> seems. I'm wondering if this is the same result everyone gets, or if it
>> depends on my environment (like my font is misbehaving). I'm using
>> Ubuntu.
>>
>> function str_join(list,sep="",_i=0, _result="") =
>> _i >= len(list)-1 ? (_i==len(list) ? _result : str(_result,list[_i]))
>> :
>> str_join(list,sep,_i+1,str(_result,list[_i],sep));
>>
>> function repeat(x,n) = [for(i=[1:1:n]) x];
>>
>> minus = chr(8722);
>> space_figure = chr(8199);
>>
>> echo(str_join(["X", each repeat("-",10), "X"])); // Hyphen character,
>> too
>> short
>> echo(str_join(["X", each repeat(minus,10), "X"])); // unicode minus
>> character
>> echo(str_join(["X", each repeat("0",10), "X"])); // zero digit
>> echo(str_join(["X", each repeat("1",10), "X"])); // one digit
>> echo(str_join(["X", each repeat(space_figure,10), "X"])); // Figure
>> space
>> echo(str_join(["X", each repeat(" ",10), "X"])); // Regular space
>> (wrong)
>>
>>
>> The output in my console:
>>
>> <http://forum.openscad.org/file/t2477/screen.png>
>>
>> I was expecting to see the line of minus signs the same with as the three
>> lines below with numbers and figure spaces.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> Sent from: http://forum.openscad.org/
>>
>> _______________________________________________
>> OpenSCAD mailing list
>>
> Discuss@.openscad
>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>>
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@.openscad
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
> image.png (8K)
> <http://forum.openscad.org/attachment/31398/0/image.png>
--
Sent from: http://forum.openscad.org/
JB
Jordan Brown
Thu, Dec 31, 2020 9:29 PM
If you pop up a level and look, you'll find
http://jkorpela.fi/dashes.html
and that will in turn lead you to FIGURE DASH U+2012 / chr(8210).
That seems to do what you need.
(But mostly I across with nop head; trying to do tabular data in a
proportional font without table layout support is doomed.)
(But but ... it's really an HTML renderer, so if we (re)added HTML
support...)
> http://jkorpela.fi/chars/spaces.html
If you pop up a level and look, you'll find
http://jkorpela.fi/dashes.html
and that will in turn lead you to FIGURE DASH U+2012 / chr(8210).
That seems to do what you need.
(But mostly I across with nop head; trying to do tabular data in a
proportional font without table layout support is doomed.)
(But but ... it's really an HTML renderer, so if we (re)added HTML
support...)
JB
Jordan Brown
Thu, Dec 31, 2020 9:32 PM
On 12/31/2020 1:29 PM, Jordan Brown wrote:
If you pop up a level and look, you'll find
http://jkorpela.fi/dashes.html
and that will in turn lead you to FIGURE DASH U+2012 / chr(8210).
That seems to do what you need.
(But mostly I across with nop head; trying to do tabular data in a
proportional font without table layout support is doomed.)
mostly I agree... jeez, don't know where that came from.
On 12/31/2020 1:29 PM, Jordan Brown wrote:
>> http://jkorpela.fi/chars/spaces.html
>
> If you pop up a level and look, you'll find
>
> http://jkorpela.fi/dashes.html
>
> and that will in turn lead you to FIGURE DASH U+2012 / chr(8210).
>
> That seems to do what you need.
>
> (But mostly I across with nop head; trying to do tabular data in a
> proportional font without table layout support is doomed.)
mostly I *agree*... jeez, don't know where that came from.
>
> (But but ... it's really an HTML renderer, so if we (re)added HTML
> support...)
>
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
HL
Hans L
Thu, Dec 31, 2020 9:46 PM
I think the solution should be to have the Console font configurable via
Preferences, in the same way that the Editor font is.
It would be nice to be able to choose a different / monospaced console font
according to preference.
Seems like a good candidate for a feature request... I thought there may
have been an issue already discussing this, but couldn't find one on github.
Hans
On Thu, Dec 31, 2020 at 3:30 PM Jordan Brown openscad@jordan.maileater.net
wrote:
I think the solution should be to have the Console font configurable via
Preferences, in the same way that the Editor font is.
It would be nice to be able to choose a different / monospaced console font
according to preference.
Seems like a good candidate for a feature request... I thought there may
have been an issue already discussing this, but couldn't find one on github.
Hans
On Thu, Dec 31, 2020 at 3:30 PM Jordan Brown <openscad@jordan.maileater.net>
wrote:
> http://jkorpela.fi/chars/spaces.html
>
>
> If you pop up a level and look, you'll find
>
> http://jkorpela.fi/dashes.html
>
> and that will in turn lead you to FIGURE DASH U+2012 / chr(8210).
>
> That seems to do what you need.
>
> (But mostly I across with nop head; trying to do tabular data in a
> proportional font without table layout support is doomed.)
>
> (But but ... it's really an HTML renderer, so if we (re)added HTML
> support...)
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
A
adrianv
Thu, Dec 31, 2020 10:12 PM
Hmmm. Not sure how I missed that. I was just exploring using en-dash
instead of minus (along with the en space) and that was working for me, but
the figure dash will make things simpler.
I've been waiting for the dev version because doing table layout seemed to
be hopeless with the HTML support. The HTML support ate spaces, but as far
as I could tell, didn't actually support table layout, so I gave up on
getting anything working there.
I'm not trying to do some massive complex formatting operation. I just want
to print numerical matrices in columns, mainly so I can debug my code more
easily. So it's a very limited task. All numbers have the same width, and
I have the figure space. The decimal point has a matching space. And then
sometimes there's an "e" which is slightly off, but it's a very slight
error, so readability is preserved.
It would be nice if the console font was a fixed width font. Having it be
configurable isn't so helpful if you don't know if it's fixed width or
proportional, because then it's hard to write code that will work for
everyone.
JordanBrown wrote
If you pop up a level and look, you'll find
http://jkorpela.fi/dashes.html
and that will in turn lead you to FIGURE DASH U+2012 / chr(8210).
That seems to do what you need.
(But mostly I across with nop head; trying to do tabular data in a
proportional font without table layout support is doomed.)
(But but ... it's really an HTML renderer, so if we (re)added HTML
support...)
OpenSCAD mailing list
Hmmm. Not sure how I missed that. I was just exploring using en-dash
instead of minus (along with the en space) and that was working for me, but
the figure dash will make things simpler.
I've been waiting for the dev version because doing table layout seemed to
be hopeless with the HTML support. The HTML support ate spaces, but as far
as I could tell, didn't actually support table layout, so I gave up on
getting anything working there.
I'm not trying to do some massive complex formatting operation. I just want
to print numerical matrices in columns, mainly so I can debug my code more
easily. So it's a very limited task. All numbers have the same width, and
I have the figure space. The decimal point has a matching space. And then
sometimes there's an "e" which is slightly off, but it's a very slight
error, so readability is preserved.
It would be nice if the console font was a fixed width font. Having it be
configurable isn't so helpful if you don't know if it's fixed width or
proportional, because then it's hard to write code that will work for
everyone.
JordanBrown wrote
>> http://jkorpela.fi/chars/spaces.html
>
> If you pop up a level and look, you'll find
>
> http://jkorpela.fi/dashes.html
>
> and that will in turn lead you to FIGURE DASH U+2012 / chr(8210).
>
> That seems to do what you need.
>
> (But mostly I across with nop head; trying to do tabular data in a
> proportional font without table layout support is doomed.)
>
> (But but ... it's really an HTML renderer, so if we (re)added HTML
> support...)
>
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@.openscad
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
Sent from: http://forum.openscad.org/
M
MichaelAtOz
Thu, Dec 31, 2020 11:18 PM
Experiment with tabs
echo("1\t2");
-----Original Message-----
From: Discuss [mailto:discuss-bounces@lists.openscad.org] On Behalf Of adrianv
Sent: Fri, 1 Jan 2021 04:25
To: discuss@lists.openscad.org
Subject: [OpenSCAD] printing a minus sign in RC3
I'm trying to print columnar output of numbers in RC3. I'm having a problem
with minus signs because they aren't the same width as anything else, it
seems. I'm wondering if this is the same result everyone gets, or if it
depends on my environment (like my font is misbehaving). I'm using Ubuntu.
function str_join(list,sep="",_i=0, _result="") =
_i >= len(list)-1 ? (_i==len(list) ? _result : str(_result,list[_i])) :
str_join(list,sep,_i+1,str(_result,list[_i],sep));
function repeat(x,n) = [for(i=[1:1:n]) x];
minus = chr(8722);
space_figure = chr(8199);
echo(str_join(["X", each repeat("-",10), "X"])); // Hyphen character, too
short
echo(str_join(["X", each repeat(minus,10), "X"])); // unicode minus
character
echo(str_join(["X", each repeat("0",10), "X"])); // zero digit
echo(str_join(["X", each repeat("1",10), "X"])); // one digit
echo(str_join(["X", each repeat(space_figure,10), "X"])); // Figure space
echo(str_join(["X", each repeat(" ",10), "X"])); // Regular space (wrong)
The output in my console:
http://forum.openscad.org/file/t2477/screen.png
I was expecting to see the line of minus signs the same with as the three
lines below with numbers and figure spaces.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Experiment with tabs
echo("1\t2");
> -----Original Message-----
> From: Discuss [mailto:discuss-bounces@lists.openscad.org] On Behalf Of adrianv
> Sent: Fri, 1 Jan 2021 04:25
> To: discuss@lists.openscad.org
> Subject: [OpenSCAD] printing a minus sign in RC3
>
> I'm trying to print columnar output of numbers in RC3. I'm having a problem
> with minus signs because they aren't the same width as anything else, it
> seems. I'm wondering if this is the same result everyone gets, or if it
> depends on my environment (like my font is misbehaving). I'm using Ubuntu.
>
> function str_join(list,sep="",_i=0, _result="") =
> _i >= len(list)-1 ? (_i==len(list) ? _result : str(_result,list[_i])) :
> str_join(list,sep,_i+1,str(_result,list[_i],sep));
>
> function repeat(x,n) = [for(i=[1:1:n]) x];
>
> minus = chr(8722);
> space_figure = chr(8199);
>
> echo(str_join(["X", each repeat("-",10), "X"])); // Hyphen character, too
> short
> echo(str_join(["X", each repeat(minus,10), "X"])); // unicode minus
> character
> echo(str_join(["X", each repeat("0",10), "X"])); // zero digit
> echo(str_join(["X", each repeat("1",10), "X"])); // one digit
> echo(str_join(["X", each repeat(space_figure,10), "X"])); // Figure space
> echo(str_join(["X", each repeat(" ",10), "X"])); // Regular space (wrong)
>
>
> The output in my console:
>
> <http://forum.openscad.org/file/t2477/screen.png>
>
> I was expecting to see the line of minus signs the same with as the three
> lines below with numbers and figure spaces.
>
>
>
>
>
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
This email has been checked for viruses by AVG.
https://www.avg.com
A
adrianv
Thu, Dec 31, 2020 11:33 PM
I tried using tabs. They are too weak of a tool. They are only at every 8th
position, so I have to be very careful about the lengths of texts and I can
only align at every 8th...or likely every 16th in practice if anything
exceeds length 8 anywhere. But worse, I can only align on the left. So "1"
and "1000" will be left aligned instead of right aligned. So to get
properly right aligned columns I still need to adjust spacing for every
character in the output. It doesn't actually solve the problem at all. It
just introduces extra complexity.
The tab key was handy on a mechanical typewriter.....but in the modern world
they are pointless and in my opinion, mainly an annoying nuisance.
MichaelAtOz wrote
Experiment with tabs
echo("1\t2");
-----Original Message-----
From: Discuss [mailto:
discuss-bounces@.openscad
Sent: Fri, 1 Jan 2021 04:25
To:
Subject: [OpenSCAD] printing a minus sign in RC3
I'm trying to print columnar output of numbers in RC3. I'm having a
problem
with minus signs because they aren't the same width as anything else, it
seems. I'm wondering if this is the same result everyone gets, or if it
depends on my environment (like my font is misbehaving). I'm using
Ubuntu.
function str_join(list,sep="",_i=0, _result="") =
_i >= len(list)-1 ? (_i==len(list) ? _result : str(_result,list[_i]))
:
str_join(list,sep,_i+1,str(_result,list[_i],sep));
function repeat(x,n) = [for(i=[1:1:n]) x];
minus = chr(8722);
space_figure = chr(8199);
echo(str_join(["X", each repeat("-",10), "X"])); // Hyphen character,
too
short
echo(str_join(["X", each repeat(minus,10), "X"])); // unicode minus
character
echo(str_join(["X", each repeat("0",10), "X"])); // zero digit
echo(str_join(["X", each repeat("1",10), "X"])); // one digit
echo(str_join(["X", each repeat(space_figure,10), "X"])); // Figure
space
echo(str_join(["X", each repeat(" ",10), "X"])); // Regular space
(wrong)
The output in my console:
<http://forum.openscad.org/file/t2477/screen.png>
I was expecting to see the line of minus signs the same with as the three
lines below with numbers and figure spaces.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
I tried using tabs. They are too weak of a tool. They are only at every 8th
position, so I have to be very careful about the lengths of texts and I can
only align at every 8th...or likely every 16th in practice if anything
exceeds length 8 anywhere. But worse, I can only align on the left. So "1"
and "1000" will be left aligned instead of right aligned. So to get
properly right aligned columns I still need to adjust spacing for every
character in the output. It doesn't actually solve the problem at all. It
just introduces extra complexity.
The tab key was handy on a mechanical typewriter.....but in the modern world
they are pointless and in my opinion, mainly an annoying nuisance.
MichaelAtOz wrote
> Experiment with tabs
> echo("1\t2");
>
>> -----Original Message-----
>> From: Discuss [mailto:
> discuss-bounces@.openscad
> ] On Behalf Of adrianv
>> Sent: Fri, 1 Jan 2021 04:25
>> To:
> discuss@.openscad
>> Subject: [OpenSCAD] printing a minus sign in RC3
>>
>> I'm trying to print columnar output of numbers in RC3. I'm having a
>> problem
>> with minus signs because they aren't the same width as anything else, it
>> seems. I'm wondering if this is the same result everyone gets, or if it
>> depends on my environment (like my font is misbehaving). I'm using
>> Ubuntu.
>>
>> function str_join(list,sep="",_i=0, _result="") =
>> _i >= len(list)-1 ? (_i==len(list) ? _result : str(_result,list[_i]))
>> :
>> str_join(list,sep,_i+1,str(_result,list[_i],sep));
>>
>> function repeat(x,n) = [for(i=[1:1:n]) x];
>>
>> minus = chr(8722);
>> space_figure = chr(8199);
>>
>> echo(str_join(["X", each repeat("-",10), "X"])); // Hyphen character,
>> too
>> short
>> echo(str_join(["X", each repeat(minus,10), "X"])); // unicode minus
>> character
>> echo(str_join(["X", each repeat("0",10), "X"])); // zero digit
>> echo(str_join(["X", each repeat("1",10), "X"])); // one digit
>> echo(str_join(["X", each repeat(space_figure,10), "X"])); // Figure
>> space
>> echo(str_join(["X", each repeat(" ",10), "X"])); // Regular space
>> (wrong)
>>
>>
>> The output in my console:
>>
>> <http://forum.openscad.org/file/t2477/screen.png>
>>
>> I was expecting to see the line of minus signs the same with as the three
>> lines below with numbers and figure spaces.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> Sent from: http://forum.openscad.org/
>>
>> _______________________________________________
>> OpenSCAD mailing list
>>
> Discuss@.openscad
>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
> --
> This email has been checked for viruses by AVG.
> https://www.avg.com
>
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@.openscad
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
Sent from: http://forum.openscad.org/
HL
Hans L
Sat, Jan 30, 2021 12:28 AM
Console font is now selectable in Preferences on the nightly development
snapshots by the way.
I figured I'd revive this thread to announce that, since this discussion
was the impetus that caused me to add the feature.
This also comes with other changes which improve the GUI Console
performance by an order of magnitude or two, for scripts with heavy ECHO
output.
Unfortunately neither are planned to be in the upcoming release since it
was too close to the wire to be making changes like that. RC6 is pretty
much frozen from new features and will likely be the final release.
Anyways, until next release, just enjoy the nightlies ... if you dare :-P
Hans
On Thu, Dec 31, 2020 at 5:34 PM adrianv avm4@cornell.edu wrote:
I tried using tabs. They are too weak of a tool. They are only at every
8th
position, so I have to be very careful about the lengths of texts and I can
only align at every 8th...or likely every 16th in practice if anything
exceeds length 8 anywhere. But worse, I can only align on the left. So
"1"
and "1000" will be left aligned instead of right aligned. So to get
properly right aligned columns I still need to adjust spacing for every
character in the output. It doesn't actually solve the problem at all. It
just introduces extra complexity.
The tab key was handy on a mechanical typewriter.....but in the modern
world
they are pointless and in my opinion, mainly an annoying nuisance.
MichaelAtOz wrote
Experiment with tabs
echo("1\t2");
-----Original Message-----
From: Discuss [mailto:
discuss-bounces@.openscad
Sent: Fri, 1 Jan 2021 04:25
To:
Subject: [OpenSCAD] printing a minus sign in RC3
I'm trying to print columnar output of numbers in RC3. I'm having a
problem
with minus signs because they aren't the same width as anything else, it
seems. I'm wondering if this is the same result everyone gets, or if
depends on my environment (like my font is misbehaving). I'm using
Ubuntu.
function str_join(list,sep="",_i=0, _result="") =
_i >= len(list)-1 ? (_i==len(list) ? _result :
:
str_join(list,sep,_i+1,str(_result,list[_i],sep));
function repeat(x,n) = [for(i=[1:1:n]) x];
minus = chr(8722);
space_figure = chr(8199);
echo(str_join(["X", each repeat("-",10), "X"])); // Hyphen character,
too
short
echo(str_join(["X", each repeat(minus,10), "X"])); // unicode minus
character
echo(str_join(["X", each repeat("0",10), "X"])); // zero digit
echo(str_join(["X", each repeat("1",10), "X"])); // one digit
echo(str_join(["X", each repeat(space_figure,10), "X"])); // Figure
space
echo(str_join(["X", each repeat(" ",10), "X"])); // Regular space
(wrong)
The output in my console:
<http://forum.openscad.org/file/t2477/screen.png>
I was expecting to see the line of minus signs the same with as the
Console font is now selectable in Preferences on the nightly development
snapshots by the way.
I figured I'd revive this thread to announce that, since this discussion
was the impetus that caused me to add the feature.
This also comes with other changes which improve the GUI Console
performance by an order of magnitude or two, for scripts with heavy ECHO
output.
Unfortunately neither are planned to be in the upcoming release since it
was too close to the wire to be making changes like that. RC6 is pretty
much frozen from new features and will likely be the final release.
Anyways, until *next* release, just enjoy the nightlies ... if you dare :-P
Hans
On Thu, Dec 31, 2020 at 5:34 PM adrianv <avm4@cornell.edu> wrote:
> I tried using tabs. They are too weak of a tool. They are only at every
> 8th
> position, so I have to be very careful about the lengths of texts and I can
> only align at every 8th...or likely every 16th in practice if anything
> exceeds length 8 anywhere. But worse, I can only align on the left. So
> "1"
> and "1000" will be left aligned instead of right aligned. So to get
> properly right aligned columns I still need to adjust spacing for every
> character in the output. It doesn't actually solve the problem at all. It
> just introduces extra complexity.
>
> The tab key was handy on a mechanical typewriter.....but in the modern
> world
> they are pointless and in my opinion, mainly an annoying nuisance.
>
>
> MichaelAtOz wrote
> > Experiment with tabs
> > echo("1\t2");
> >
> >> -----Original Message-----
> >> From: Discuss [mailto:
>
> > discuss-bounces@.openscad
>
> > ] On Behalf Of adrianv
> >> Sent: Fri, 1 Jan 2021 04:25
> >> To:
>
> > discuss@.openscad
>
> >> Subject: [OpenSCAD] printing a minus sign in RC3
> >>
> >> I'm trying to print columnar output of numbers in RC3. I'm having a
> >> problem
> >> with minus signs because they aren't the same width as anything else, it
> >> seems. I'm wondering if this is the same result everyone gets, or if
> it
> >> depends on my environment (like my font is misbehaving). I'm using
> >> Ubuntu.
> >>
> >> function str_join(list,sep="",_i=0, _result="") =
> >> _i >= len(list)-1 ? (_i==len(list) ? _result :
> str(_result,list[_i]))
> >> :
> >> str_join(list,sep,_i+1,str(_result,list[_i],sep));
> >>
> >> function repeat(x,n) = [for(i=[1:1:n]) x];
> >>
> >> minus = chr(8722);
> >> space_figure = chr(8199);
> >>
> >> echo(str_join(["X", each repeat("-",10), "X"])); // Hyphen character,
> >> too
> >> short
> >> echo(str_join(["X", each repeat(minus,10), "X"])); // unicode minus
> >> character
> >> echo(str_join(["X", each repeat("0",10), "X"])); // zero digit
> >> echo(str_join(["X", each repeat("1",10), "X"])); // one digit
> >> echo(str_join(["X", each repeat(space_figure,10), "X"])); // Figure
> >> space
> >> echo(str_join(["X", each repeat(" ",10), "X"])); // Regular space
> >> (wrong)
> >>
> >>
> >> The output in my console:
> >>
> >> <http://forum.openscad.org/file/t2477/screen.png>
> >>
> >> I was expecting to see the line of minus signs the same with as the
> three
> >> lines below with numbers and figure spaces.
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> --
> >> Sent from: http://forum.openscad.org/
> >>
> >> _______________________________________________
> >> OpenSCAD mailing list
> >>
>
> > Discuss@.openscad
>
> >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
> >
> >
> > --
> > This email has been checked for viruses by AVG.
> > https://www.avg.com
> >
> >
> > _______________________________________________
> > OpenSCAD mailing list
>
> > Discuss@.openscad
>
> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>