How can I make ASCII text that will look good on Facebook? - c#

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.

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

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?

Related

text file: Reading file line by line

but after reading file getting output of 2nd Line is not getting with same space.why
THE industrial area layout date 11/12/2020
Head office page no
below is my code
lines = File.ReadAllLines(path,Encoding.UTF8));
text file:
THE industrial area layout date 11/12/2020
Head office page no
After Reading:
THE industrial area layout date 11/12/2020
Head office page no
How would i be able to do this? Thanks in advance.
Make sure you are analyzing the content with the same font, more specifically make sure you have monospace fonts otherwise you might get confused related to the spaces.
I would suggest Courier New.
What you see in the debugger text view doesn't use a monospace font by default so it's unreliable when checking the number of spaces between lines especially when there's other content besides spaces.
Another way to check the number of spaces is to replace them with some other character so that you can count them visibly.

HttpUtility does not decode "𠮟"

With all others characters HttpUtility works well but with this encoded value 𠮟 it just does not want to decode.
Decoded should be 𠮟.
Image attached: http://screencast.com/t/r3TxPHrYr5
Check to make sure that whatever font you're using to display the character has an associated glyph for that code point. Not all fonts have glyphs for all Unicode code points. Consolas, for one, has a relatively small set of glyphs, while Arial Unicode has glyphs for many of the defined Unicode code points. You can use the Character Map utility on Windows to verify that your font has a glyph for the code point in question. Fonts that don't have an associated glyph may either show nothing at all, a box with an X in it, a black diamond with a ? embedded within it (Firefox does this, I think), a ?, or even a ??.
HTH.

C# Sending String To Printer Not Working With Courier

My IDE is .Net 2008 using C#. I need to send a string to a printer in a non proportionally spaced font. As an example lets say the string = "Hello World" and the printer is "Printer1"
I followed the advice of this stackoverflow post:
Sending String Directly to printer
When I set the font to "Times New Roman" or "Comic Sans MS", it works. But when I use Courier, I get a nonproportionally spaced font.
I am using the exact coding as the post that I have cited. Why won't Courier give me the non proportionally spaced font I need? Is there a way to fix this?
Thank you in advance,
Harvey Nusbaum
Courier is a monospace font. All of its characters have the same width.

What font is used if a Unicode-character is not found in the selected font (Tahoma)?

I have written a WPF user control that uses Tahoma as a font to display unicode strings, which works fine. However, I have noticed that some eastern asian characters are actually missing in Tahoma, i.e. this font does not support all common Unicode characters.
However, when I display a string that contains some east asian letters, that I suppose are missing in Tahoma.ttf, the character is displayed correctly anyway, instead of a black rectangle that I expected to get for the missing unicode character.
So out of curiosity: is there any fallback mechanism, i.e. does Windows 7 or C# WPF replace the missing characters from a fallback font? Can anybody please explain how exactly this is working, and which font is actually used as a allback?
See the Font Fallback section of the FontFamily reference.
Thanks alot H.B., with your keyword, I was able to find this really helpful ressource from Microsoft, that explains how Font Fallback and Font Linking work:
http://msdn.microsoft.com/en-us/goglobal/bb688134
Here is a good quote:
A user running Windows XP selects the Tahoma font to enter some text first in English, next in Hebrew, and then in Telugu. Since Tahoma is an OpenType font, it provides support for Latin and Hebrew scripts, but does not contain any Telugu glyphs. Uniscribe detects this lack of font support and automatically renders the Telugu script by using its fallback font, which is Gautami.

Cambria Math big top and bottom margin

I wanted to show some mathematical expressions in a winforms textbox. So I thought the "Cambria Math" font would be a good choice but the text looked strange due the high top and bottom margin of the font. First I thought I made a mistake but according to this question, it's the correct behavior of the font.
Why does Cambria Math have these big margin values and how can I display my string correctly in the textbox like Word 2010?
(Note that I know only a little bit about typography ;)
Edit: I had to make the textbox that tall otherwise the caret would be invisible. The font size of the textbox is set to 8.25pt
Cambria Math uses Microsoft's mathematical OpenType extensions.
Word 2007 and later understand these and display the text with reasonable spacing.
However, notepad and Word 2000 display the text with enormous spacing, just like winforms. I guess the font has this much space by default because some characters (like U+2320, top half integral) are much larger than the alphanumerics.
If you use Cambria Math with a font engine (such as the one used by winforms) that doesn't understand the math extensions, you're going to get the big spacing.
If you're displaying simple expressions you might as well use Cambria.

Categories