Search code examples
iosfacebookcocoa-touchascii

How can we post ASCII art on Facebook wall?


In my app, I have a requirement to post the ASCII art from my iPhone app onto the Facebook wall post. But the problem I face is that Facebook font (Lucida Console) Changes the formatting of my ASCII art. I have made my ASCII art in Courier New.

Is there a way I can post my ASCII art on Facebook without having to re-format the whole thing?


Solution

  • Courier is a monospaced font. That means, that every letter has the same space. That's why it is easy to use for ASCII art and popular for coding — as words with same length will always be at same positions.

    From Facebook CSS:

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

    Lucida Grande is a proportional font. i.e. an i uses much less space than an m. Words in different lines won't match very well.

    Edit

    Have a look at this Facebook group. The users compensate the absence of a monospaced font by

    1. using just symbols with roughly the same width
    2. filling room with short symbols like .

    Monospaced:

     `♥♥'''''''''''''''♥♥`  
     `♥♥'''''''''''''''♥♥`
    

    Proportional:

    ♥♥'''''''''''''''♥♥