This is an example of Nepali sentence. Nepali is based on Devanagari Script.<p>यो फोरम मलाई एकदम मन पर्छ|<p>https://nepalilanguage.org/alphabet/#:~:text=Each%20of%20the%20following%2033,%2F%2C%20%E0%A4%AB%20%2Fp%CA%B0a%2F%2C
These are the vowels and consonants in Nepali.<p>A Nepali consonant can take these many forms. "Ka" is first letter of Nepali consonant.<p>Expected Input<p>यो फोरम मलाई एकदम मन पर्छ|<p>And any character like a,b,c,.,/,<i>,+,- based on which the ASCII art will be generated.<p>Expected Output<p>Every letter should be scaled and drawn with the given character, say for example "</i>". Like below.<p>Plan 1:<p>1) Accept Nepali characters as input. And parse each character.<p>example यो फोरम मलाई एकदम मन पर्छ|<p>2) Get the shape of each character.<p>3) Scale the shape.<p>4) Redraw the shape using "*" or anything given by user as input.<p>Plan 2:<p>1) Take Nepali character as input<p>2) Convert to Unicode.<p>3) Process the Unicode.<p>4) Display Nepali as output.<p>I'm wondering how could I do this? Language doesn't matter but I'd prefer, C, C++ or Javascript.<p>Here are the images used in the post.<p>https://imgur.com/a/GIUljrK
1) render string at large font size to monochrome bitmap<p>2) loop over all pixels in the bitmap, writing spaces or asterisks depending on bit value<p>You can also render anti-aliased to grayscale and use blacker/whiter ASCII characters.<p>Many languages have libraries/support for #1, and for accessing individual pixels in a bitmap. If you have that, #2 is trivial.<p>The most difficult part may be to make sure to pick a font that allows you to do whatever you want to do with the ASCII art.
Never tried anything like this, but I’d assume you’d probably use Freetype to render an existing Devanagari font to a matrix, then map each pixel position and brightness to a corresponding ASCII character… effectively your result is just a larger image that uses very large, letter-snapped “pixels” to represent shades of grey.<p>One possible (and randomly found) starting off point, in Go: <a href="https://fiwippi.net/blog/post/rendering_images_with_ascii_characters_in_go" rel="nofollow noreferrer">https://fiwippi.net/blog/post/rendering_images_with_ascii_ch...</a>