I wrote a VB.Net program that lets you load any small image and then converts that image to ASCII art as HTML. I currently write the HTML as (for example):
and then end the file with:
It simply copies the color image loaded and makes a grayscale copy and then based on that value, picks an ASCII character (I have 92 characters all weighted from darkest to lightest) mapped to a gray shade value 0 to 255.
Then with the original color image I take the RGB and convert it to <font color = "#RRGGBB>&#ASC Value</font>.
and this works well EXCEPT Courier New is slightly taller that it is wide so my ASCII art looks a bit stretched. I could change my code to "squash" the image before rendering the HTML, but I wondered if instead there was a CSS statement that could make Courier New (or any fixed width font) to have a 1 to 1 aspect ratio when displayed?
Thank you
Code:
<html>
<head>
<body bgcolor = "#000000">
<pre><font face = "Courier New" size ="1">
<font color = "#660099">F</font><font color = "#660066">v</font><font color = "#660066">v</font>...
and then end the file with:
Code:
...<font color = "#002B00">:</font><font color = "#660066">v</font><font color = "#660099">F</font>
</pre>
</body>
</html>
It simply copies the color image loaded and makes a grayscale copy and then based on that value, picks an ASCII character (I have 92 characters all weighted from darkest to lightest) mapped to a gray shade value 0 to 255.
Then with the original color image I take the RGB and convert it to <font color = "#RRGGBB>&#ASC Value</font>.
and this works well EXCEPT Courier New is slightly taller that it is wide so my ASCII art looks a bit stretched. I could change my code to "squash" the image before rendering the HTML, but I wondered if instead there was a CSS statement that could make Courier New (or any fixed width font) to have a 1 to 1 aspect ratio when displayed?
Thank you