Coder Social home page Coder Social logo

jufmt's Introduction

Java Unicode Formatter (jufmt)

Build License: MPL 2.0

Simple Java and GraalVM toy to play with unicode formatting.

There are many websites that perform fancy Unicode text transformation. For fun, I wanted to try to implement these features in Java.

$ java -jar build/libs/jufmt-all.jar -h
░░▒█░█▒█▒█▀░█▄▒▄█░▀█▀
░▀▄█░▀▄█░█▀░█▒▀▒█░▒█▒
Usage: jufmt [-dhrV] [--strip-diacritic-marks] [-c=CONVERTER] [-n=FORM]
             [-o=ORNAMENT] [-s=STYLE] [STR] [COMMAND]
Format input latin string with fancy unicode chars
      [STR]                 The string to process
  -c, --converter=CONVERTER Converter, valid converters: none, normal, sans,
                              sansBold, sansItalic, sansBoldItalic, monospace,
                              fullwidth, fraktur, boldFraktur, serifBold,
                              serifItalic, serifBoldItalic, doubleStruck,
                              script, boldScript, circled, circledNegative,
                              squared, squaredNegative, parenthesized,
                              smallCaps, subscript, superscript, inverted,
                              mirrored, rounded, greek, japanese,
                              fauxEthiopian, ogham, asciiBrailleGrade1, morse
  -d, --describe            Describe characters, or more precisely codepoints
  -h, --help                Show this help message and exit.
  -o, --ornament=ORNAMENT   Ornaments, valid ornaments: curvedAngleBracket,
                              blackLenticularBracket, whiteLenticularBracket,
                              tortoiseBracket, whiteTortoiseBracket,
                              angleBracket, doubleAngleBracket, cornerBracket,
                              whiteCornerBracket, lightShade, mediumShade,
                              darkShade, wave, tibetanKuRuKhaBzhiMigCan,
                              ethiopicSectionMark
  -r, --reversed            Reverse string
  -s, --style=STYLE         Styles, valid styles: strikethrough, macron,
                              macronBelow, lowline, doubleLowline, overline,
                              doubleOverline, shadow, upwardArrowBelow,
                              hotFumes, doubleArrow, electric, snow, smeared
  -V, --version             Print version information and exit.
Commands:
  figlet  Renders input string as a text banner (FIGlet)
  normalize  Normalize input string using the given Unicode Normalization Forms
  zalgo   Renders input with Zalgo

If using GraalVM, micronaut offers the nativeImage task :

$ asdf local java java graalvm-community-20.0.1
$ java --version
openjdk 20.0.1 2023-04-18
OpenJDK Runtime Environment GraalVM CE 20.0.1+9.1 (build 20.0.1+9-jvmci-23.0-b12)
OpenJDK 64-Bit Server VM GraalVM CE 20.0.1+9.1 (build 20.0.1+9-jvmci-23.0-b12, mixed mode, sharing)
$ ./gradlew nativeCompile
...
$ ./jufmt-cli/build/native/nativeCompile/jufmt figlet -r bric3
___.           .__         ________
\_ |__ _______ |__|  ____  \_____  \
 | __ \\_  __ \|  |_/ ___\   _(__  <
 | \_\ \|  | \/|  |\  \___  /       \
 |___  /|__|   |__| \___  >/______  /
     \/                 \/        \/

The tool supports the following charset:

Table 1. Fonts
Font Character Set

Normal

"\ !#$%&'()*+,-./0123456789:;<⇒?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~

Sans bold

"\ !#$%&'()*+,-./𝟬𝟭𝟮𝟯𝟰𝟱𝟲𝟳𝟴𝟵:;<⇒?@𝗔𝗕𝗖𝗗𝗘𝗙𝗚𝗛𝗜𝗝𝗞𝗟𝗠𝗡𝗢𝗣𝗤𝗥𝗦𝗧𝗨𝗩𝗪𝗫𝗬𝗭[]^_`𝗮𝗯𝗰𝗱𝗲𝗳𝗴𝗵𝗶𝗷𝗸𝗹𝗺𝗻𝗼𝗽𝗾𝗿𝘀𝘁𝘂𝘃𝘄𝘅𝘆𝘇{|}~

Sans italic

"\ !#$%&'()*+,-./0123456789:;<⇒?@𝘈𝘉𝘊𝘋𝘌𝘍𝘎𝘏𝘐𝘑𝘒𝘓𝘔𝘕𝘖𝘗𝘘𝘙𝘚𝘛𝘜𝘝𝘞𝘟𝘠𝘡[]^_`𝘢𝘣𝘤𝘥𝘦𝘧𝘨𝘩𝘪𝘫𝘬𝘭𝘮𝘯𝘰𝘱𝘲𝘳𝘴𝘵𝘶𝘷𝘸𝘹𝘺𝘻{}~

Bold italic

"\ !#$%&'()*+,-./0123456789:;<⇒?@𝘼𝘽𝘾𝘿𝙀𝙁𝙂𝙃𝙄𝙅𝙆𝙇𝙈𝙉𝙊𝙋𝙌𝙍𝙎𝙏𝙐𝙑𝙒𝙓𝙔𝙕[]^_`𝙖𝙗𝙘𝙙𝙚𝙛𝙜𝙝𝙞𝙟𝙠𝙡𝙢𝙣𝙤𝙥𝙦𝙧𝙨𝙩𝙪𝙫𝙬𝙭𝙮𝙯{|}~

Monospace

"\ !#$%&'()*+,-./𝟶𝟷𝟸𝟹𝟺𝟻𝟼𝟽𝟾𝟿:;<⇒?@𝙰𝙱𝙲𝙳𝙴𝙵𝙶𝙷𝙸𝙹𝙺𝙻𝙼𝙽𝙾𝙿𝚀𝚁𝚂𝚃𝚄𝚅𝚆𝚇𝚈𝚉[]^_`𝚊𝚋𝚌𝚍𝚎𝚏𝚐𝚑𝚒𝚓𝚔𝚕𝚖𝚗𝚘𝚙𝚚𝚛𝚜𝚝𝚞𝚟𝚠𝚡𝚢𝚣{|}~

Fullwidth

"\ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~

Math Fraktur

"\ !#$%&'()*+,-./0123456789:;<⇒?@𝔄𝔅ℭ𝔇𝔈𝔉𝔊ℌℑ𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔ℜ𝔖𝔗𝔘𝔙𝔚𝔛𝔜ℨ[]^_`𝔞𝔟𝔠𝔡𝔢𝔣𝔤𝔥𝔦𝔧𝔨𝔩𝔪𝔫𝔬𝔭𝔮𝔯𝔰𝔱𝔲𝔳𝔴𝔵𝔶𝔷{|}~

Math Fraktur bold

"\ !#$%&'()*+,-./0123456789:;<⇒?@𝕬𝕭𝕮𝕯𝕰𝕱𝕲𝕳𝕴𝕵𝕶𝕷𝕸𝕹𝕺𝕻𝕼𝕽𝕾𝕿𝖀𝖁𝖂𝖃𝖄𝖅[]^_`𝖆𝖇𝖈𝖉𝖊𝖋𝖌𝖍𝖎𝖏𝖐𝖑𝖒𝖓𝖔𝖕𝖖𝖗𝖘𝖙𝖚𝖛𝖜𝖝𝖞𝖟{|}~

Serif bold

"\ !#$%&'()*+,-./𝟎𝟏𝟐𝟑𝟒𝟓𝟔𝟕𝟖𝟗:;<⇒?@𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙[]^_`𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐰𝐱𝐲𝐳{|}~

Serif italic

"\ !#$%&'()*+,-./0123456789:;<⇒?@𝐴𝐵𝐶𝐷𝐸𝐹𝐺𝐻𝐼𝐽𝐾𝐿𝑀𝑁𝑂𝑃𝑄𝑅𝑆𝑇𝑈𝑉𝑊𝑋𝑌𝑍[]^_`𝑎𝑏𝑐𝑑𝑒𝑓𝑔ℎ𝑖𝑗𝑘𝑙𝑚𝑛𝑜𝑝𝑞𝑟𝑠𝑡𝑢𝑣𝑤𝑥𝑦𝑧{}~

Serif bold italic

"\ !#$%&'()*+,-./0123456789:;<⇒?@𝑨𝑩𝑪𝑫𝑬𝑭𝑮𝑯𝑰𝑱𝑲𝑳𝑴𝑵𝑶𝑷𝑸𝑹𝑺𝑻𝑼𝑽𝑾𝑿𝒀𝒁[]^_`𝒂𝒃𝒄𝒅𝒆𝒇𝒈𝒉𝒊𝒋𝒌𝒍𝒎𝒏𝒐𝒑𝒒𝒓𝒔𝒕𝒖𝒗𝒘𝒙𝒚𝒛{|}~

Math double-struck

"\ !#$%&'()*+,-./𝟘𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡:;<⇒?@𝔸𝔹ℂ𝔻𝔼𝔽𝔾ℍ𝕀𝕁𝕂𝕃𝕄ℕ𝕆ℙℚℝ𝕊𝕋𝕌𝕍𝕎𝕏𝕐ℤ[]^_`𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫{|}~

Script

"\ !#$%&'()*+,-./0123456789:;<⇒?@𝒜ℬ𝒞𝒟ℰℱ𝒢ℋℐ𝒥𝒦ℒℳ𝒩𝒪𝒫𝒬ℛ𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵[]^_`𝒶𝒷𝒸𝒹ℯ𝒻ℊ𝒽𝒾𝒿𝓀𝓁𝓂𝓃ℴ𝓅𝓆𝓇𝓈𝓉𝓊𝓋𝓌𝓍𝓎𝓏{|}~

Bold script

"\ !#$%&'()*+,-./0123456789:;<⇒?@𝓐𝓑𝓒𝓓𝓔𝓕𝓖𝓗𝓘𝓙𝓚𝓛𝓜𝓝𝓞𝓟𝓠𝓡𝓢𝓣𝓤𝓥𝓦𝓧𝓨𝓩[]^_`𝓪𝓫𝓬𝓭𝓮𝓯𝓰𝓱𝓲𝓳𝓴𝓵𝓶𝓷𝓸𝓹𝓺𝓻𝓼𝓽𝓾𝓿𝔀𝔁𝔂𝔃{|}~

Circled

"⦸ !#$%&'()⊛⊕,⊖⨀⊘⓪①②③④⑤⑥⑦⑧⑨:;⧀⊜⧁?@ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ[]^_`ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ{⦶}~

Circled negative

"\ !#$%&'()*+,-./⓿❶❷❸❹❺❻❼❽❾:;<⇒?@🅐🅑🅒🅓🅔🅕🅖🅗🅘🅙🅚🅛🅜🅝🅞🅟🅠🅡🅢🅣🅤🅥🅦🅧🅨🅩[]^_`🅐🅑🅒🅓🅔🅕🅖🅗🅘🅙🅚🅛🅜🅝🅞🅟🅠🅡🅢🅣🅤🅥🅦🅧🅨🅩{}~

Squared

"\ !#$%&'()*+,-./0123456789:;<⇒?@🄰🄱🄲🄳🄴🄵🄶🄷🄸🄹🄺🄻🄼🄽🄾🄿🅀🅁🅂🅃🅄🅅🅆🅇🅈🅉[]^_`🄰🄱🄲🄳🄴🄵🄶🄷🄸🄹🄺🄻🄼🄽🄾🄿🅀🅁🅂🅃🅄🅅🅆🅇🅈🅉{}~

Squared negative

"⧅ !#$%&'()⧆⊞,⊟⊡⧄0123456789:;<⇒?@🅰🅱🅲🅳🅴🅵🅶🅷🅸🅹🅺🅻🅼🅽🅾🅿🆀🆁🆂🆃🆄🆅🆆🆇🆈🆉[]^_`🅰🅱🅲🅳🅴🅵🅶🅷🅸🅹🅺🅻🅼🅽🅾🅿🆀🆁🆂🆃🆄🆅🆆🆇🆈🆉{}~

Parenthesized

"\ !#$%&'()*+,-./0⑴⑵⑶⑷⑸⑹⑺⑻⑼:;<⇒?@⒜⒝⒞⒟⒠⒡⒢⒣⒤⒥⒦⒧⒨⒩⒪⒫⒬⒭⒮⒯⒰⒱⒲⒳⒴⒵[]^_`⒜⒝⒞⒟⒠⒡⒢⒣⒤⒥⒦⒧⒨⒩⒪⒫⒬⒭⒮⒯⒰⒱⒲⒳⒴⒵{}~

Small caps

"\ !#$%&'()*+,-./0123456789:;<⇒?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`ᴀʙᴄᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴩꞯʀꜱᴛᴜᴠᴡxʏᴢ{}~

Subscript

"\ !#$%&'()*₊,₋./₀₁₂₃₄₅₆₇₈₉:;<₌>?@ᴀʙᴄᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴘ🇶ʀꜱᴛᴜᴠᴡxʏᴢ[]^_`ₐᵦ𝒸𝒹ₑ𝒻𝓰ₕᵢⱼₖₗₘₙₒₚᵩᵣₛₜᵤᵥ𝓌ₓᵧ𝓏{}~

Superscript

"\ !#$%&'()*⁺,⁻./⁰¹²³⁴⁵⁶⁷⁸⁹:;<⁼>?@ᴬᴮᶜᴰᴱᶠᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᵠᴿˢᵀᵁⱽᵂˣʸᶻ[]^_`ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖᵠʳˢᵗᵘᵛʷˣʸᶻ{}~

Inverted

„\ ¡#$%⅋,)(*+‘-˙/0ƖՇƐᔭϛ9Ɫ86:;<⇒¿@∀ꓭↃꓷƎℲ⅁HIſꓘ⅂WNOԀῸꓤS⊥∩ꓥMX⅄Z][^‾`ɐqɔpǝɟƃɥıɾʞןɯuodbɹsʇnʌʍxʎz}|{~

Mirrored

"/ !#$%&')(*+,-.\0߁ςƐ߂टმ٢8୧:;<⇒⸮@AꓭↃꓷƎꟻӘHIႱꓘ⅃MИOꟼϘЯꙄTUVWXYZ][^_`ɒdↄbɘʇϱʜiįʞlmᴎoqpᴙꙅɈυvwxγz}|{~

Rounded

"\ !#$%&'()*+,-./0123456789:;<⇒?@ᗩᗷᑕᗪEᖴGᕼIᒍKᒪᗰᑎOᑭᑫᖇᔕTᑌᐯᗯ᙭Yᘔ[]^_`ᗩᗷᑕᗪEᖴGᕼIᒍKᒪᗰᑎOᑭᑫᖇᔕTᑌᐯᗯ᙭Yᘔ{|}~

Greek

"\ !#$%&'()*+,-./0123456789:;<⇒?@ΛBᑕDΣFGΉIJKᒪMПӨPQЯƧƬЦVЩXYZ[]^_`ΛBᑕDΣFGΉIJKᒪMПӨPQЯƧƬЦVЩXYZ{|}~

Japanese

"\ !#$%&'()*+,-./0123456789:;<⇒?@卂乃匚ᗪ乇千Ꮆ卄丨フҜㄥ爪几ㄖ卩Ɋ尺丂ㄒㄩᐯ山乂ㄚ乙[]^_`卂乃匚ᗪ乇千Ꮆ卄丨フҜㄥ爪几ㄖ卩Ɋ尺丂ㄒㄩᐯ山乂ㄚ乙{|}~

Faux Ethiopian

"\ !#$%&'()*+,-./0123456789:;<⇒?@ልጌርዕቿቻኗዘጎጋጕረጠክዐየዒዪነፕሁሀሠሸሃጊ[]^_`ልጌርዕቿቻኗዘጎጋጕረጠክዐየዒዪነፕሁሀሠሸሃጊ{|}~

Table 2. Styles
Font Example

Underline

U͟n͟d͟e͟r͟l͟i͟n͟e͟

Strikethrough

𝖲̶𝗍̶𝗋̶𝗂̶𝗄̶𝖾̶𝗍̶𝗁̶𝗋̶𝗈̶𝗎̶𝗀̶𝗁̶

Short Strikethrough

S̵h̵o̵r̵t̵ ̵S̵t̵r̵i̵k̵e̵t̵h̵r̵o̵u̵g̵h̵

TODO

TODO
  • ✓ unicode fonts

  • ✓ braille

  • ✓ morse

  • ✓ figlet

  • ❏ other utf-8 ascii, possibly other figlet fonts

     ▄▌ ▐▄█ █▀ █▚▞▌ ▀█▀
    
    ░░▒█░█▒█▒█▀░█▄▒▄█░▀█▀
    ░▀▄█░▀▄█░█▀░█▒▀▒█░▒█▒
    
    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
    ███▄█ ██ █ ▄▄█ ▄▀▄ █▄ ▄
    ███ █ ██ █ ▄██ █▄█ ██ █
    █ ▀ ██▄▄▄█▄███▄███▄██▄█
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    
    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
    ███▄█░██░█░▄▄█░▄▀▄░█▄░▄
    ███░█░██░█░▄██░█▄█░██░█
    █░▀░██▄▄▄█▄███▄███▄██▄█
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    
         ▄▄▄ ▄▄   ▄▄ ▄▄▄▄▄▄▄ ▄▄   ▄▄ ▄▄▄▄▄▄▄
        █   █  █ █  █       █  █▄█  █       █
        █   █  █ █  █    ▄▄▄█       █▄     ▄█
     ▄  █   █  █▄█  █   █▄▄▄█       █ █   █
    █ █▄█   █       █    ▄▄▄█       █ █   █
    █       █       █   █   █ ██▄██ █ █   █
    █▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█   █▄█   █▄█ █▄▄▄█
    
    ╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋
    ╋╋╋╋╋╋╭━╮╋╋╋╭╮╋
    ╋╭╮╋╋╋┃╭╯╋╋╋╯╰╮
    ╋╰╯╮╭╮╯╰╮╮╭╮╮╭╯
    ╋╭╮┃┃┃╮╭╯╰╯┃┃┃╋
    ╋┃┃╰╯┃┃┃╋┃┃┃┃╰╮
    ╋┃┃━━╯╰╯╋┻┻╯╰━╯
    ╭╯┃╋╋╋╋╋╋╋╋╋╋╋╋
    ╰━╯╋╋╋╋╋╋╋╋╋╋╋╋
    
         ░░ ░░    ░░ ░░░░░░░ ░░░    ░░░ ░░░░░░░░
         ▒▒ ▒▒    ▒▒ ▒▒      ▒▒▒▒  ▒▒▒▒    ▒▒
         ▒▒ ▒▒    ▒▒ ▒▒▒▒▒   ▒▒ ▒▒▒▒ ▒▒    ▒▒
    ▓▓   ▓▓ ▓▓    ▓▓ ▓▓      ▓▓  ▓▓  ▓▓    ▓▓
     █████   ██████  ██      ██      ██    ██
    
    ╱╱╱╱╱╱╭━╮╱╱╭╮
    ╱╭╮╱╱╱┃╭╯╱╭╯╰╮
    ╱╰╋╮╭┳╯╰┳╮┣╮╭╯
    ╱╭┫┃┃┣╮╭┫╰╯┃┃
    ╱┃┃╰╯┃┃┃┃┃┃┃╰╮
    ╱┃┣━━╯╰╯╰┻┻┻━╯
    ╭╯┃
    ╰━╯
    
    ╱╱╱╱╭━╮╱╱╭╮
    ╱╭┳┳┫━╋━━┫╰╮
    ╱┣┫┃┃╭┫┃┃┃╭┫
    ╭╯┣━┻╯╰┻┻┻━╯
    ╰━╯
  • ✓ ornaments

    • ✓ wrapping chars, e.g. : 【b】【r】【i】【c】【3】, 〖b〗〖r〗〖i〗〖c〗〖3〗, ⧼b⧽⧼r⧽⧼i⧽⧼c⧽⧼3⧽, etc.

    • ✓ insert chars, e.g. : b྿r྿i྿c྿3, ፠b፠r፠i፠c፠3, b࿐r࿐i࿐c࿐3, etc.

  • ✓ zalgo: b̼̖̹͉̽̾r͎͔͉͙̽ͭ̈́͛͊i̮̿c̥̦̥̅̈́͐ͮ̚3͎͇ͨ

  • ✓ styles

    • ✓ shadow: b̷r̷i̷c̷3̷

    • ✓ sweating: b̾r̾i̾c̾3̾ ̾

    • ✓ smeared ink: b҉r҉i҉c҉3҉

  • ✓ normalize (NFD, NFKD, NFC, NFKC)

This feature is inspired by this nice js project (demo).

License

  • This project

jufmt

Copyright (c) 2020, today - Brice DUTHEIL

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

jufmt's People

Contributors

bric3 avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

icodein

jufmt's Issues

Paginate when rendering all figlet

Mimic git default behavior.

  • Also offer a negate option, like git, --no-pager.
  • Should the tool use the default pager (in PAGER environment variable)
  • What about Windows ?
  • Disable pager on non interactive terminal (isTTY(stdout)) ?

Use a pager (e.g. less) if you are outputting a lot of text. For example, git diff does this by default. Using a pager can be error-prone, so be careful with your implementation such that you don’t make the experience worse for the user. You shouldn’t use a pager if stdin or stdout is not an interactive terminal.

Source: https://clig.dev/

Example

import picocli.CommandLine
import picocli.CommandLine.*
import picocli.CommandLine.Model.*
import java.io.FileWriter
import java.io.PrintWriter
import java.nio.file.Files
import java.util.concurrent.Callable
import kotlin.system.exitProcess

@Command(
    name = "sw",
    version = ["0.2"],
    mixinStandardHelpOptions = true,
    description = [asciiArt, "@|bold,yellow \uD83E\uDE90 A Star Wars CLI built on top of https://swapi.dev/ \uD83E\uDE90 |@"],
    subcommands = [PlanetsCommand::class, PeopleCommand::class, HelpCommand::class]
)
class SwaCLIPaginate : Callable<Int> {

    @Spec
    lateinit var spec: CommandSpec

    private fun executionStrategy(parseResult: ParseResult): Int {

        if (!parseResult.hasSubcommand())
            return RunLast().execute(parseResult)

        val file = Files.createTempFile("pico", ".tmp").toFile()
        this.spec.commandLine().out = PrintWriter(FileWriter(file), true)

        val result = RunLast().execute(parseResult)

        val processBuilder = ProcessBuilder("less", file.absolutePath).inheritIO()
        val process = processBuilder.start()
        process.waitFor()

        return result
    }

    override fun call(): Int {
        spec.commandLine().usage(System.out)
        return 0
    }

    companion object{
        @JvmStatic
        fun main(args: Array<String>){
            val app = SwaCLIPaginate()
            exitProcess(CommandLine(app)
                    .setExecutionStrategy(app::executionStrategy)
                    .execute(*args))
        }
    }
}

Source : https://github.com/jlengrand/swacli/blob/main/src/main/kotlin/nl/lengrand/swacli/SwaCLIPaginate.kt

Ref : remkop/picocli#1252

Ability to convert styled text back to regular text

E.g. when recover the regular ascii char from unicode text like 𝓪 𝓻𝓪𝓫𝓫𝓲𝓽 to a rabbit

For reference text can be converted via the --converter option :

$ jufmt --converter=boldScript "a rabbit"
𝓪 𝓻𝓪𝓫𝓫𝓲𝓽

Introducing an option like --restore, e.g.

$ jufmt --restore "𝓪 𝓻𝓪𝓫𝓫𝓲𝓽"
a rabbit

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

asdf
.tool-versions
github-actions
.github/workflows/gradle.yml
  • actions/checkout v4
  • gradle/wrapper-validation-action v2
  • actions/checkout v4
  • graalvm/setup-graalvm v1
  • gradle/actions v3
  • actions/upload-artifact v4
  • actions/upload-artifact v4
  • actions/download-artifact v4
  • mikepenz/action-junit-report v4
  • actions/download-artifact v4
  • softprops/action-gh-release v2
  • ubuntu 22.04
gradle
gradle.properties
settings.gradle.kts
  • com.gradle.enterprise 3.16.2
build.gradle.kts
gradle/libs.versions.toml
  • org.asciidoctor:asciidoctorj 2.5.12
  • org.asciidoctor:asciidoctorj-diagram 2.3.0
  • info.picocli:picocli 4.7.5
  • info.picocli:picocli-codegen 4.7.5
  • org.assertj:assertj-core 3.25.3
  • org.junit.jupiter:junit-jupiter-api 5.10.2
  • org.junit.jupiter:junit-jupiter-engine 5.10.2
  • org.junit.jupiter:junit-jupiter-params 5.10.2
  • org.mockito:mockito-core 5.11.0
  • org.jetbrains:annotations 24.1.0
  • org.jsoup:jsoup 1.17.2
  • org.graalvm.buildtools.native 0.10.1
  • org.asciidoctor.jvm.convert 4.0.2
  • com.github.johnrengelman.shadow 8.1.1
  • de.undercouch.download 5.6.0
  • org.quiltmc.gradle.licenser 2.0.1
  • com.adarshr.test-logger 4.0.0
jufmt-cli/build.gradle.kts
jufmt-lib/build.gradle.kts
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.6

  • Check this box to trigger a request for Renovate to run again on this repository

Figlet usage doc

Add some doc on figlet subcommand, e.g. from : https://patorjk.com/software/taag/#p=about

"Featured FIGlet Fonts" vs "Regular FIGlet Fonts"?

There are so many FIGlet fonts that I thought it might be advantagous to group the top ~15% of them in one area. This grouping was based on my own opinion, feed back from users, and what I'd seen used on the net. I felt this might be a good way to highlight certain fonts and to hook the causal visitors into checking out more fonts before surfing off elsewhere. If you enjoy the fonts, be sure to browse through all of them, as there are tons of good ones that aren't listed in the featured section. In fact, I kind of agonized on what should go in that section, and slimmed it down some since I didn't want to divide things up too much.

What is "Character Width" and "Character Height"?

These apply to FIGlet fonts only. FIGlet fonts can be designed to allow characters to overlap or be "smushed" together. The font designer controls the type and level of overlap. You can override the font author's default design by changing the settings for "Character Width" and "Character Height". Below is a description of the various choices.

  • "Full" - No character overlap.
  • "Fitted" - Characters are moved toward each other until they almost touch.
  • "Smush (U)" - Universal Smushing. Smushing moves two characters toward each other until their edges overlap by one character. In universal smushing, the latter character's edge overrides the former's edge.
  • "Smush (R)" - Rule-Based Smushing. Similar to Universal Smushing except the smushing is based on a set of rules (5 for vertical, 6 for horizontal). These rules allow font authors more control over how their letters are smushed. When you select this option from the dropdown, it turns on all possible smushing rules. Font authors can pick and chose which rules to turn on or off, so this option may produce different results than the "Default" option if the font author has chosen to use Rule-Based Smushing.
  • "Default" - The character overlap the font author originally intended for the font.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.