

$LetterFile = Join-Path $PSScriptRoot 'letters.xml'

# Populate the $Letters hashtable with character data from the XML. It's filtered just before output with a simple "''Where-Object If the maximum number of lines in the letter with the most lines is 4, only 4 lines will be output and letters will be bottom-aligned (which doesn't matter in the case of max 4 lines). Here's an example of the XML that's used for the letter "a":Īll the characters in the XML have from 4-6 lines, where some of them may consist of only whitespace.
Ascii art characters code#
: Now on GitHub and in the PowerShell Gallery.ĭocumentationThere's some built-in documentation and comments in the code itself all of them might not be up-to-date, but I tried to fix most of them.Ĭurrently, only lower-case letters are supported, mostly because PowerShell/Windows is case-insensitive by default when reading the XML - and workarounds seem cumbersome. Of course, this isn't the most useful script in the world it has to be placed in the "fun" category.
Ascii art characters software#
When creating such images by software by sampling 'real' images it is common to. Another issue is the stretching in height due to the rectangular aspect ratio of characters. An obvious problem is the variation in apparent density between some typefaces. It was harder than I thought to write the algorithm for compression, and quite a bit of work to create the XML. A more convincing but shorter sequence for representing 10 levels of grey is. I wrote this for my own use, but I figured I'd share it in case someone was looking for something like this. This XML file is expected to have the name "letters.xml", be encoded in UTF-8 and to be in the module's working directory. The list of accepted characters is dynamically created from the read XML file. If you want other characters, you will need to add them to the XML. This is why it can prepend an apostrophe, because somewhere along the way to IRC, the leading spaces seem to disappear.Ĭurrently it supports only a pretty basic subset of characters (I did add a few "international"/accented ones randomly). Originally I wrote it to be used in conjunction with a modified version of PowerBot, a simple IRC bot framework based on the SmartIrc4Net library. If you do want to add it, use the parameter "-PrependChar". Write-Ascii no longer prepends an apostrophe by default, so in all the examples/screenshots where you might see "-nop" or "-NoPrependChar", you can ignore that and just leave it out. If you use ASCII artwork from here, please do not remove the artists name/initials if they are present. It has been tested with PowerShell version 2 and 3 in its current form. The ASCII art of this website has been created by many different artists and credit has been given where the artist is known. This is sort of a poor man's figlet for PowerShell. I used the Linux utility figlet to create the ASCII art letters and wrapped them in XML along with some metadata. This PowerShell ASCII art script module uses an XML file that contains the supported characters, and produces ASCII art letter output to STDOUT or the pipeline. Ascii art characters powershell script - Svendsen Tech Jump to page sections
