text() inability to generate newline commands in long text strings

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

text() inability to generate newline commands in long text strings

Still_learning

Hi All,

I see from the archive that there was some discussion in 2015 about coding in the ability for OpenSCAD users to place line breaks in the text() module.

I am running OpenSCAD version 2017.01.20 on a Windows 7 platform.

A quick look at the MCAD library in my OpenSCAD directory reveals that no text.scad resides there.

I wish to be able to insert line breaks in long text strings.

Is this now possible?

Do I need a file or library I don't have?

A reply is always appreciated.

Thanks

Still Learning


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
The more I learn, the more I get curious about.
tp3
Reply | Threaded
Open this post in threaded view
|

Re: text() inability to generate newline commands in long text strings

tp3
On 04/13/2018 08:59 PM, John Sprockets wrote:
> Is this now possible?
>
The built-in text() does not support that and it's probably
not going to do that very soon. It's basically another layer
in the text processing stack that is quite a big topic.

I guess the document http://behdad.org/text/ still describes
the current state of the text rendering and right now OpenSCAD
does not support the top-level part which is the layouting.

Note that OpenSCAD does support even scripting languages thanks
to the use of the harfbuzz library. Just looking at newlines is
unlikely to work in the general case unfortunately.

> Do I need a file or library I don't have?
>
I'm not are of any text libraries which help with that, but
there are examples for simple multi-line handling, e.g. in
that reddit post:
https://www.reddit.com/r/openscad/comments/3jwobs/line_feed_in_openscad_text/

ciao,
   Torsten.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: text() inability to generate newline commands in long text strings

MichaelAtOz
Administrator
In reply to this post by Still_learning
You would be able to write a module, probably with a recursive function too,
to do that.
By either detecting a /"\n"/ or by number of chars/line.
You would need to calculate a rule of thumb for line advance [for
translate()] from the font size.

If you're fiddling with text() also see
https://github.com/brodykenrick/text_on_OpenSCAD




-----
Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - PM me if you need anything,
or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: text() inability to generate newline commands in long text strings

Still_learning
In reply to this post by tp3
Thanks for the link on reedit Torsten.

That helped.

Like many others, I guess I'm going to have to create multiple lines as
separate objects and merge them, transfer and reuse them via modules.

Still stuck, but Learning



-----
The more I learn, the more I get curious about.
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
The more I learn, the more I get curious about.
Reply | Threaded
Open this post in threaded view
|

Re: text() inability to generate newline commands in long text strings

Still_learning
In reply to this post by MichaelAtOz
Downloaded the zip from github and will see what is up.





-----
The more I learn, the more I get curious about.
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
The more I learn, the more I get curious about.