views:

63

answers:

2

I'm making a .NET application that will take any picture and spit out ASCII text that will appear just like the image.

So far, it works well when the font is Lucida Console. Facebook doesn't use this font and thus break the art illusion.

Any thoughts, ideas and suggestions on how to tackle this problem? It's pretty a pretty neat idea! :)

EDIT:

Facebooks default font is:

font-family: "lucida grande", "tahoma", "verdana", "arial", sans-serif;

How do you suggest I solve this unique problem. :)

EDIT 2: Added more relevant tags.

+1  A: 

Here's an interesting "bended" idea:

There's a set of "Mathematical monospace" characters in Unicode, that always render using a monospace font. On my computer, even though the font chosen is DejaVu Sans, the font used to render these characters changes to DejaVu Sans Mono.

The ranges are:

  • U+1D670 to U+1D689 for A-Z
  • U+1D68A to U+1D6A3 for a-z
  • U+1D7F6 to U+1D7FF for 0-9

Try and see if you can see these on your computer:

If you see these as letters and numbers, and in monospace, you're good to go! I'm on Ubuntu 10.10, and my fonts have these characters.

Here's a screenshot of the above example on Ubuntu:

http://i25.tinypic.com/30ijhjs.png

Delan Azabani
Chrome developer shows only squares :(
overslacked
Safari on a iPhone/iPod only show squares.
Jerod Houghtelling
I'm sorry to hear that. It seems that the fonts in Ubuntu come with a lot more characters. @overslacked, what OS are you on?
Delan Azabani
I'm still using Windows XP.
overslacked
It's a little unfortunate to hear that Windows doesn't have this Unicode range in its fonts. The implementation is simple; characters in that range should be rendered by the default monospace font.
Delan Azabani
Please see this picture for an idea of how it should look like: http://i25.tinypic.com/30ijhjs.png
Delan Azabani
A: 

There's a generator out there that works with variable width fonts:

http://sourceforge.net/projects/ascgen2/

Maybe you could peek at its source for some ideas (but no stealing, of course!). Or, since it's an open source project, you and the author could collaborate and work on it together?

Cory Larson
Just curious, if I give full 100% attribution to open source code, is it still legal to implement for example a method?
Sergio Tapia
Depends on how the program is licensed. In this instance, you must abide by following clause in version 2 of the GNU General Public License (GPL):"You may copy and distribute verbatim copies of the Program'ssource code as you receive it, in any medium, provided that youconspicuously and appropriately publish on each copy an appropriatecopyright notice and disclaimer of warranty; keep intact all thenotices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program."
Cory Larson