• TheDraw font support

    From Rob Swindell@1:103/705 to GitLab issue in main/sbbs on Sat Apr 19 19:10:22 2025
    open https://gitlab.synchro.net/main/sbbs/-/issues/913

    It'd be really neat to be able to dynamically generate text using TheDraw fonts and send to terminal users. This would make a good JS project, taking inspiration from:
    - https://github.com/tat3r/tdfiglet
    - https://github.com/digitallyserviced/tdfgo
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Sun Apr 20 05:50:08 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7084

    There's a node.js library already which might be easy to convert to synchronet?

    https://github.com/cognitivegears/tdfonts
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Mon Apr 21 02:16:03 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7089

    I've done most of the hard work. I converted the node.js version to
    work with synchronet jsexec but it doesn't display properly in the
    console. You're more into the coding stuff than I am so maybe you
    can finish it off? I copied the fonts from the https://github.com/cognitivegears/tdfonts package in /sbbs/data/tdfonts but that may not be the best place for them, but I think they should be distributed since not everyone is going to have them installed unless they fetch them separately.

    I'm not sure all the fonts are working as they should but that, again, might be just due to terminal differences.


    ![image](/uploads/6734acb996c0cd4f54cf183b11524f00/image.png){width=772 height=600}[tdfonts.js](/uploads/0c5521af03cf8a139b204cf0d15fd5c7/tdfonts.js)
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Mon Apr 21 08:07:33 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7090

    ![image](/uploads/29b8cedcf2e8e70fcf0266225ce7333c/image.png){width=504 height=635}
    Something definitely missing between tdfitlet and the js script. Not sure I could figure out what tho.
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Mon Apr 21 15:06:47 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7093

    I have converted tdfiglet with the help of various AIs and got something that seems to work OK.
    Test from the console with something like ;exec tdfonts -j c -f digital2 TEST

    There are multiple fonts in a .tdf file and this will only access the first. Maybe someone a bit more expert at this stuff than I am can add an index option to print the xth font in the file.

    I believe this doesn't work without outline fonts but with over 1000 to choose from, it shouldn't matter too much. I copied my tdfiglet fonts to /sbbs/data/tdfonts and think they should be distributed with synchronet if this is added otherwise it's another step to go download them.

    [tdfonts.js](/uploads/502e095d7e2b6d4038bf22aedf732f51/tdfonts.js)
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Fernando Toledo@1:103/705 to GitLab note in main/sbbs on Mon Apr 21 15:15:26 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7094

    very nice.. I just discover tdfiglet thanks you!
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Mon Apr 21 17:24:01 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7095

    Very cool. I'll have to play with this. Did you get the output issues resolves?

    I would place the fonts in ctrl/tdfonts, to live alongside ctrl/fonts.
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Mon Apr 21 18:06:36 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7096

    Seems reasonable to put them in ctrl. Yup. I fiddled around with various converters, and tdfiglet seemed to work the best and it's a single C file. Converted fairly well and just needed a few tweaks. the main issue was that it did output in utf-8 as default so I tweaked it to use ansi so no need to worry about the options. It would be great if you could get it to load other fonts in the set. There's tdfgo in github I think, which does this but I don't know go and I'm not ready to learn it.
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Tue Apr 22 09:54:58 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7097

    This useful bit of information should help. Each font is separated within the file by 0x55 0xaa 0x00 0xff
    ```
    bbs@bbs:/sbbs/data/tdfonts$ hexdump -C synrdsrx.tdf|grep "55 aa 00 ff"
    00000010 69 6c 65 1a 55 aa 00 ff 0b 53 79 6e 65 72 67 79 |ile.U....Synergy| 00002750 df 08 df 08 df 08 df 08 00 55 aa 00 ff 0b 53 79 |.........U....Sy| 000075e0 df 08 00 55 aa 00 ff 0b 53 79 6e 65 72 67 79 20 |...U....Synergy | 00009d20 08 df 08 df 08 df 08 00 55 aa 00 ff 0b 53 79 6e |........U....Syn| ```
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Tue Apr 22 11:52:18 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7098

    This reference might help too: https://www.roysac.com/blog/2014/04/thedraw-fonts-file-tdf-specifications/
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Tue Apr 22 11:58:13 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7099

    Yeah, that's where I got that from. I had a bit a look and came up with this. I was able to add -x n where n is the 0 based index to the font in the file.

    ![image](/uploads/de1ff882e07e7a6b488b9aa4c8ef6f33/image.png){width=783 height=337}

    ![image](/uploads/1ed27fc11359dfa866ccd452cff6a2bb/image.png){width=780 height=339}

    I've fixed random too but that will only find random fonts in the set specified by -x or assume -x 0 if the font doesn't exist, such as -x 99 isn't going to work so it'll assume -x 0 (default).

    [tdfonts.js](/uploads/7b8cb548acee622dedf64c5aba4db085/tdfonts.js)
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Tue Apr 22 11:59:59 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7100

    You should get this in a git repo soon, so you can track your changes.
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Tue Apr 22 12:01:40 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7101

    Do you want me to commit it?

    One thing we'll probably want to do at some point is convert it to a reusable load/*lib.js so it'll be more easily reused from other JS code (e.g. shells, modules).

    Having a front-end (e.g. exec/tdfiglet.js) is still fine and potentially useful, but that'd just be a wrapper around the load lib.
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Tue Apr 22 12:07:03 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7102

    Another thing we should address: for fonts that only have uppercase letters (e.g. NSA, madman2) convert the input string to uppercase. Some fonts do contain unique upper and lower case characters, so I wouldn't just always uppercase - only if the font is lacking the lowercase char mappings.
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Tue Apr 22 12:12:08 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7103

    I'm still working on it. I thought I'd throw it up here in case anyone had suggestions while I'm still plinking around. Yup, I do want to turn it into a library so let me figure that out first, unless you want to do it ;)

    For anyone who wants to play for now, this now does randomly also pick a font within the .tdf file. This should be the final thing I'm doing before libifying it...or whoever wants to libify it :smile: [tdfonts.js](/uploads/d23b4cd6d77f738148084813b47ff9dc/tdfonts.js)
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Tue Apr 22 12:20:29 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7104

    Go for it!

    Also, it is good practice to have a git history of changes while you're still working on something. That way you can easily track the history of "port from tdfiglet.c" to any enhancements or bug-fixes as you go and be able to easily go back in time if something stops working that you were sure was working previously.

    I think tdfiglet.js would be a good name for the front-end and perhaps tdfonts.js for the load-lib.
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Tue Apr 22 12:53:55 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7105

    tdfonts.js or tdfonts_lib.js maybe?
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Tue Apr 22 13:26:42 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7107

    I suppose we could also strip out characters that don't appear in the list of characters.
    font.charlist contains an array of valid characters.
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Tue Apr 22 13:38:18 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7109

    tdfiglet appears to already strip out (not display) characters not in the charlist. That's how I discovered the issue (by passing a string with lowercase chars to one of the uppercase-only fonts).
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab issue in main/sbbs on Tue Apr 22 15:59:38 2025
    close https://gitlab.synchro.net/main/sbbs/-/issues/913
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Tue Apr 22 15:59:38 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/913#note_7118

    Resolved by @nelgin.
    --- SBBSecho 3.24-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)