Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

In Lexington, Kentucky, it's illegal to carry an ice cream cone in your pocket.


dovenet / Synchronet Javascript / Auto-indenting wrapped text in a frame

SubjectAuthor
* Auto-indenting wrapped text in a frameCodefenix
`* Auto-indenting wrapped text in a frameechicken
 `- Auto-indenting wrapped text in a frameCodefenix

1
Auto-indenting wrapped text in a frame

<65661A79.896.dove-net2012@conchaos.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=118&group=DOVE-Net.Synchronet_Javascript#118

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: codefenix@VERT/CONCHAOS (Codefenix)
To: All
Subject: Auto-indenting wrapped text in a frame
Message-ID: <65661A79.896.dove-net2012@conchaos.synchro.net>
Date: Tue, 28 Nov 2023 11:51:05 -0500
X-Comment-To: All
Path: rocksolidbbs.com!not-for-mail
Organization: ConstructiveChaos BBS
Newsgroups: DOVE-Net.Synchronet_Javascript
X-FTN-PID: Synchronet 3.20a-Win32 master/c02f2513f Mar 5 2023 MSC 1929
X-FTN-CHRS: CP437 2
WhenImported: 20231128094406-0800 41e0
WhenExported: 20231128141316-0800 41e0
ExportedFrom: VERT sync-js 3963
WhenImported: 20231128115105-0500 412c
WhenExported: 20231128124357-0500 412c
ExportedFrom: CONCHAOS dove-net2012 896
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Codefenix - Tue, 28 Nov 2023 16:51 UTC

Is there a simple way to automatically pad new lines of text with say, 6 leading whitespaces when wrapping text in a frame (i.e.: word_wrap = true)?

What I'm trying to achieve is adding such an indent to wrapped lines of dialog in MRC. I added a HH:MM timestamp recently, and think it would look nicer if the next line began after where the timestamp ended in the previous line.

Example of current state:

12:34 <codefenix> this is a long line of text which should autowrap when we get to this part of it

Desired state:

12:34 <codefenix> this is a long line of text which should autowrap when we
get to this part of it

|01<|09co|03d|11e|15ƒ|11e|03n|09ix|01>|07

....Logic and practical information do not seem to apply here.
---
■ Synchronet ■ -=[ ConstructiveChaos BBS | conchaos.synchro.net ]=-

Auto-indenting wrapped text in a frame

<65662F24.3928.sync_js@bbs.electronicchicken.com>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=119&group=DOVE-Net.Synchronet_Javascript#119

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: echicken@VERT/ECBBS (echicken)
To: Codefenix
Subject: Auto-indenting wrapped text in a frame
Message-ID: <65662F24.3928.sync_js@bbs.electronicchicken.com>
Date: Tue, 28 Nov 2023 18:19:16 -0500
X-Comment-To: Codefenix
Path: rocksolidbbs.com!not-for-mail
Organization: electronic chicken bbs
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <65661A79.896.dove-net2012@conchaos.synchro.net>
References: <65661A79.896.dove-net2012@conchaos.synchro.net>
X-FTN-PID: Synchronet 3.20a-Linux master/274efc589 Nov 24 2023 GCC 9.4.0
X-FTN-CHRS: CP437 2
WhenImported: 20231128103307-0800 41e0
WhenExported: 20231128141316-0800 41e0
ExportedFrom: VERT sync-js 3964
WhenImported: 20231128181916-0500 412c
WhenExported: 20231128183306Z 412c
ExportedFrom: ECBBS sync_js 3928
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: echicken - Tue, 28 Nov 2023 23:19 UTC

Re: Auto-indenting wrapped text in a frame
By: Codefenix to All on Tue Nov 28 2023 11:51:05

Co> Is there a simple way to automatically pad new lines of text with say, 6
Co> leading whitespaces when wrapping text in a frame (i.e.: word_wrap =
Co> true)?

No, there isn't.

Co> What I'm trying to achieve is adding such an indent to wrapped lines of
Co> dialog in MRC. I added a HH:MM timestamp recently, and think it would look
Co> nicer if the next line began after where the timestamp ended in the
Co> previous line.

You could put the text that you want to align into its own word-wrapped frame:

-frame- -frame----------------------
[HH:MM] [text that might be wrapped]

And then you probably want to use frame.data_height to determine the height after wrapping of that second frame, and use it to set the actual height of that frame, and use it to offset the y position of the next row of content, etc.

The alternative is adding an indentation option to Frame and messing around with the word wrapping logic there. Probably doable but probably a pain.

---
echicken
electronic chicken bbs - bbs.electronicchicken.com
---
■ Synchronet ■ electronic chicken bbs - bbs.electronicchicken.com

Auto-indenting wrapped text in a frame

<656789D9.898.dove-net2012@conchaos.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=120&group=DOVE-Net.Synchronet_Javascript#120

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: codefenix@VERT/CONCHAOS (Codefenix)
To: echicken
Subject: Auto-indenting wrapped text in a frame
Message-ID: <656789D9.898.dove-net2012@conchaos.synchro.net>
Date: Wed, 29 Nov 2023 13:58:33 -0500
X-Comment-To: echicken
Path: rocksolidbbs.com!not-for-mail
Organization: ConstructiveChaos BBS
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <65662F24.3928.sync_js@bbs.electronicchicken.com>
References: <65662F24.3928.sync_js@bbs.electronicchicken.com>
X-FTN-PID: Synchronet 3.20a-Win32 master/c02f2513f Mar 5 2023 MSC 1929
X-FTN-CHRS: CP437 2
WhenImported: 20231129114859-0800 41e0
WhenExported: 20231129141320-0800 41e0
ExportedFrom: VERT sync-js 3965
WhenImported: 20231129135833-0500 412c
WhenExported: 20231129144857-0500 412c
ExportedFrom: CONCHAOS dove-net2012 898
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Codefenix - Wed, 29 Nov 2023 18:58 UTC

Re: Auto-indenting wrapped text in a frame
By: echicken to Codefenix on Tue Nov 28 2023 06:19 pm

ec> No, there isn't.
ec> You could put the text that you want to align into its own word-wrapped
ec> frame:

Ok, that's an interesting idea, thanks.

|01<|09co|03d|11e|15ƒ|11e|03n|09ix|01>|07

....To love oneself is the beginning of a lifelong romance.
---
■ Synchronet ■ -=[ ConstructiveChaos BBS | conchaos.synchro.net ]=-


dovenet / Synchronet Javascript / Auto-indenting wrapped text in a frame

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor