tags:

views:

224

answers:

8

I am trying to do some dynamic programming based on the number of chars in a sentence. I need to know which letter of the English alphabet takes up the most pixels in the screen???

+1  A: 

Capital "M" is conventionally the widest.

ChrisW
Really?? What about "W" ....
marc_s
Thus the reason for the unit of measurement called "em" http://en.m.wikipedia.org/wiki/Em_(typography)
bta
+4  A: 

My money is on W :)

Tudorizer
+1  A: 

It depends on the font. Crossed zero for example takes up considerably more than a regular one.

But if one could put up a guess, I'd go with X or B.

Rook
+30  A: 

Hmm, let's see:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

cccccccccccccccccccccccccccccccccccccccc

dddddddddddddddddddddddddddddddddddddddd

eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

ffffffffffffffffffffffffffffffffffffffff

gggggggggggggggggggggggggggggggggggggggg

hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk

llllllllllllllllllllllllllllllllllllllll

mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn

oooooooooooooooooooooooooooooooooooooooo

pppppppppppppppppppppppppppppppppppppppp

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

ssssssssssssssssssssssssssssssssssssssss

tttttttttttttttttttttttttttttttttttttttt

uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww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VVVVVV

WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ

W wins.

Of course, this is a silly empirical experiment. There is no single answer to which letter is widest. It depends on the font. So you'll have to do a similar empirical experiment to figure out the answer for your environment. But the fact is, most fonts follow the same conventions, and capital W will be the widest.

Ned Batchelder
LOL. That's what I call deep researching!
Tudorizer
More like "W for Win" :P
BoltClock
In monospace, everybody win
Colin Hebert
+1: Didn't think I would upvote an answer that mostly looked like the poster had fallen asleep on his keyboard.
Ani
Yup, doing this in DOS or on an old Commodore 64, wouldnt have worked.
BerggreenDK
A: 

Which font? Lowercase, upper?

Rocket Ronnie
+1  A: 

It will depend on the font. I would create a small program in a programming language you're most comfortable with, where you draw each letter of the alphabet into a n times m sized bitmap. Initialize each pixel with white. Then count the number of white pixels after you've drawn each letter and save that number. The highest number you find is the one you're looking for.

EDIT: If you're in fact just interested in which one takes up the largest rectangle (but it looks like you're really after that, not the pixels), you can use various API calls to find the size, but that depends on your programming language. In Java, for example, you would use the FontMetrics class.

steinar
+1  A: 

Arial 30px in Chrome - W wins.

http://vidasp.net/tinydemos/letter-width.html

Šime Vidas
+2  A: 

Depending on your platform, there might be a way to "getWidth" from a string or DrawText() function somehow with a width property.

I would make a simple algortime that utilized the needed font and then ran through the alfabet and stored it in a small config or just calculated it at initialization as a loop from A to Z isnt that hard.

BerggreenDK