About fonts.

Can any font be made proportional?
I am using courier as I know it is proportional, but it looks like %^&.
Can I use any font and make it proportional?

Courier is not proportional, it is monospaced. Fonts are usually one or the other.

[quote=99673:@Brian O’Brien]Can any font be made proportional?
I am using courier as I know it is proportional, but it looks like %^&.
Can I use any font and make it proportional?[/quote]

Actually, Brian, Courier is NOT proportional. Is is a fixed-width font, where all characters occupy the same space. It is also called monospace. Hence the special design of the i and l where the serifs (the small bars on top and bottom) are extended so they look better in a larger space.

A proportional font uses different spacing for narrow characters such as “i” and wider characters such as “W” and “M”. A good example is Times.

And no, you cannot make Courier proportional, neither can you make Times monospace. You have to select among the fonts installed in the system the one that best suits your needs.

Actually you can. You just split strings by character and draw them in squares the width of an uppercase M.

If you analyse the lines you could make a fixed-width font proportional. It’d look awful, but you could.

[quote=99754:@Eduardo Gutierrez de Oliveira]Actually you can. You just split strings by character and draw them in squares the width of an uppercase M.

If you analyse the lines you could make a fixed-width font proportional. It’d look awful, but you could.[/quote]

You are right. Rendering a proportional font monospace, or the other way around, is possible. Although proportionally spacing a monospaced font can be quite an undertaking. But modifying the font itself takes a lot more.

I had to mention it, as I once (back in the OSX times, early 90s) used a telnet/terminal application that filtered all monospaced fonts by writing and measuring characters (just like NCSA telnet used to do) and then also allowed you to use any font as monospaced, which usually looked from jarring to ridiculous. I always found it funny they had included the functionality and assumed it was like an easter egg.

I can’t actually imagine any situation when this would be needed, either.

Thanks… Pardon me I meant to say non proportional (fixed) not proportional… but fixed width or monospace is probably the correct term.
That’s me Brian the dyslexic brain.

[quote=99966:@Brian O’Brien]Thanks… Pardon me I meant to say non proportional (fixed) not proportional… but fixed width or monospace is probably the correct term.
That’s me Brian the dyslexic brain.[/quote]

It’s all right. So if your question is “can I make any font monospaced”, the answer is no, modifying a font is not that easy. However, if the question is “can I display any font as monospaced”, the answer is yes, if you manage the placement of each character. A simple approach could be to drawstring on a canvas character by character and manage the spacing between characters as columns of even size.

Another approach could be to use a listbox and place each character in a different column.

Any font will look like what you mean when made monospaced. Actually, as I wrote before, Courier has been especially designed to look a little better. The idea behind monospaced is mostly to have perfectly legible number columns. Interestingly enough, most fonts use even space for numbers, so they can be used for columns of numbers. Most of the time, you can probably obtain a nice column alignment with a listbox, and a regular font.

You can embed the font in your app, if you can get permission for it. It may work better for you that way. You could include something like monofur (my current terminal font) and have people curse at you :smiley:

I embed the twitter bootstrap font to have scalable vector widgets in my app, for example.

I love you. Don’t know why I never thought of this before!

My designer friend now delivers graphic assets to me in “font” format because of this :slight_smile: