By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,152 Members | 2,193 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,152 IT Pros & Developers. It's quick & easy.

How to determine Height/Width of Font

P: n/a
Can someone please help!!

I am trying to figure out what a font is?
Assume I am working with a fixed font say Courier 10 point font

Question 1: What does this mean 10 point font
Question 2: How do I determine how many characters I can get on a line
Question 3: How do I determine how many lines I can get on a page. Assume no margins
Question 4: Does their exist some kind of refernce table that will equate a font with chars/line and #lines/page

Thank

Ada
I've read where there are 72 points in an inch but I think this equates to height and not widt

Nov 15 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Unless you are using a monospace font, you can't pre-determine the information
that you want. (In a monospace font, the character cell width is the same for
all glyphs (characters) in the font.)

Most fonts are *not* monospace, which means that the character cell widths are
different for the different glyphs. For example, W is wider than i.
Additionally, kerning comes into play, which essentially means that when glyphs
are drawn, they may actually be spaced closer together then their actual width.

About the only way to really determine what will fit on a line/page is to draw
it (or use the draw routines to calculate) the actual text being represented.
Look up DrawText DT_CALCRECT in MSDN to see numerous articles on the topic
(most will be C++, but will give you an idea of what you need to do).

If you are using a monospace font, you can get the cell dimensions from the
text metrics.

Adam wrote:

Can someone please help!!!

I am trying to figure out what a font is?
Assume I am working with a fixed font say Courier 10 point font.

Question 1: What does this mean 10 point font?
Question 2: How do I determine how many characters I can get on a line.
Question 3: How do I determine how many lines I can get on a page. Assume no margins.
Question 4: Does their exist some kind of refernce table that will equate a font with chars/line and #lines/page?

Thanks

Adam

I've read where there are 72 points in an inch but I think this equates to height and not width

Nov 15 '05 #2

P: n/a
Julie:

First, thansk for your reply.
But I am unfamiliar with C++.
Please correct me if I am wrong, but I thought that a Courier was a fixed width font. Meaning the letter w takes up the same space as the letter i.

Anyway, I'm surprised that their isn't a cross reference table or some sort or fomula.

Are you awar of any additional info?

Adam

----- Julie J. wrote: -----

Unless you are using a monospace font, you can't pre-determine the information
that you want. (In a monospace font, the character cell width is the same for
all glyphs (characters) in the font.)

Most fonts are *not* monospace, which means that the character cell widths are
different for the different glyphs. For example, W is wider than i.
Additionally, kerning comes into play, which essentially means that when glyphs
are drawn, they may actually be spaced closer together then their actual width.

About the only way to really determine what will fit on a line/page is to draw
it (or use the draw routines to calculate) the actual text being represented.
Look up DrawText DT_CALCRECT in MSDN to see numerous articles on the topic
(most will be C++, but will give you an idea of what you need to do).

If you are using a monospace font, you can get the cell dimensions from the
text metrics.

Adam wrote:
Can someone please help!!!
I am trying to figure out what a font is?

Assume I am working with a fixed font say Courier 10 point font.
Question 1: What does this mean 10 point font?

Question 2: How do I determine how many characters I can get on a line.
Question 3: How do I determine how many lines I can get on a page. Assume no margins.
Question 4: Does their exist some kind of refernce table that will equate a font with chars/line and #lines/page?
Thanks
Adam
I've read where there are 72 points in an inch but I think this equates to height and not width


Nov 15 '05 #3

P: n/a
In c#, you can use the Graphics objects MeasureString property to measure
how many pixels a a string will take given a particular font.

You can't really have a "table" of chars/line or lines/page even with a
monospace font because you'd need different tables based on:

1) what font are you in?
2) what size font is it?
3) is it bold, italic?
4) what size is the client of the window?
5) what size fonts does the user have? (large / small / 132%)

I'm sure people can come up with lots more, and this doesn't touch on
kerning or cleartype settings, etc. Basically, use measurestring or
similar.
"Adam" <an*******@discussions.microsoft.com> wrote in message
news:DE**********************************@microsof t.com...
Julie:

First, thansk for your reply.
But I am unfamiliar with C++.
Please correct me if I am wrong, but I thought that a Courier was a fixed width font. Meaning the letter w takes up the same space as the letter i.
Anyway, I'm surprised that their isn't a cross reference table or some sort or fomula.
Are you awar of any additional info?

Adam

----- Julie J. wrote: -----

Unless you are using a monospace font, you can't pre-determine the information that you want. (In a monospace font, the character cell width is the same for all glyphs (characters) in the font.)

Most fonts are *not* monospace, which means that the character cell widths are different for the different glyphs. For example, W is wider than i.
Additionally, kerning comes into play, which essentially means that when glyphs are drawn, they may actually be spaced closer together then their actual width.
About the only way to really determine what will fit on a line/page is to draw it (or use the draw routines to calculate) the actual text being represented. Look up DrawText DT_CALCRECT in MSDN to see numerous articles on the topic (most will be C++, but will give you an idea of what you need to do).

If you are using a monospace font, you can get the cell dimensions from the text metrics.

Adam wrote:
>> Can someone please help!!!
>> I am trying to figure out what a font is? > Assume I am working with a fixed font say Courier 10 point font.
>> Question 1: What does this mean 10 point font?

> Question 2: How do I determine how many characters I can get on a line.
> Question 3: How do I determine how many lines I can get on a page. Assume no margins. > Question 4: Does their exist some kind of refernce table that will

equate a font with chars/line and #lines/page?
>> Thanks
>> Adam
>> I've read where there are 72 points in an inch but I think this

equates to height and not width

Nov 15 '05 #4

P: n/a
Phil:

OK but let's say I know my font. Its Courier 10 point.

Do you know what this means Courier 10 point?
I know Courier is a fixed font. But I don't know what 10 point means. is it 10 points high? What about the width?
Can you define what a 10 point COurier font is in terms of height, width?

----- Philip Rieck wrote: -----

In c#, you can use the Graphics objects MeasureString property to measure
how many pixels a a string will take given a particular font.

You can't really have a "table" of chars/line or lines/page even with a
monospace font because you'd need different tables based on:

1) what font are you in?
2) what size font is it?
3) is it bold, italic?
4) what size is the client of the window?
5) what size fonts does the user have? (large / small / 132%)

I'm sure people can come up with lots more, and this doesn't touch on
kerning or cleartype settings, etc. Basically, use measurestring or
similar.
"Adam" <an*******@discussions.microsoft.com> wrote in message
news:DE**********************************@microsof t.com...
Julie:
First, thansk for your reply. But I am unfamiliar with C++.
Please correct me if I am wrong, but I thought that a Courier was a fixed

width font. Meaning the letter w takes up the same space as the letter i.
Anyway, I'm surprised that their isn't a cross reference table or some sort or fomula.
Are you awar of any additional info?
Adam
>> ----- Julie J. wrote: -----

Unless you are using a monospace font, you can't pre-determine the information that you want. (In a monospace font, the character cell width is the same for all glyphs (characters) in the font.)
Most fonts are *not* monospace, which means that the character cell
widths are different for the different glyphs. For example, W is wider than i.
Additionally, kerning comes into play, which essentially means that when glyphs are drawn, they may actually be spaced closer together then their actual width. About the only way to really determine what will fit on a line/page is to draw it (or use the draw routines to calculate) the actual text being represented. Look up DrawText DT_CALCRECT in MSDN to see numerous articles on the topic (most will be C++, but will give you an idea of what you need to do).
If you are using a monospace font, you can get the cell dimensions
from the text metrics.
Adam wrote:
Can someone please help!!!
I am trying to figure out what a font is? Assume I am working with a fixed font say Courier 10 point font.
Question 1: What does this mean 10 point font?

Question 2: How do I determine how many characters I can get on a

line. Question 3: How do I determine how many lines I can get on a page. Assume no margins. Question 4: Does their exist some kind of refernce table that will

equate a font with chars/line and #lines/page?
Thanks
Adam
I've read where there are 72 points in an inch but I think this

equates to height and not width

Nov 15 '05 #5

P: n/a
Yes, courier is a monospace font. There are several flavors of courier, each
may be slightly different in one respect or another.

As for some table or cross reference, I'm not aware of any such beast.

Your best bet is to research font articles in MSDN to get an understanding of
how fonts/typefaces work in Windows, and how to get the the widths that you are
after. A great article is:

http://msdn.microsoft.com/library/de...dn_fontmap.asp

Adam wrote:

Julie:

First, thansk for your reply.
But I am unfamiliar with C++.
Please correct me if I am wrong, but I thought that a Courier was a fixed width font. Meaning the letter w takes up the same space as the letter i.

Anyway, I'm surprised that their isn't a cross reference table or some sort or fomula.

Are you awar of any additional info?

Adam
----- Julie J. wrote: -----

Unless you are using a monospace font, you can't pre-determine the information
that you want. (In a monospace font, the character cell width is the same for
all glyphs (characters) in the font.)

Most fonts are *not* monospace, which means that the character cell widths are
different for the different glyphs. For example, W is wider than i.
Additionally, kerning comes into play, which essentially means that when glyphs
are drawn, they may actually be spaced closer together then their actual width.

About the only way to really determine what will fit on a line/page is to draw
it (or use the draw routines to calculate) the actual text being represented.
Look up DrawText DT_CALCRECT in MSDN to see numerous articles on the topic
(most will be C++, but will give you an idea of what you need to do).

If you are using a monospace font, you can get the cell dimensions from the
text metrics.

Adam wrote:
>> Can someone please help!!!
>> I am trying to figure out what a font is?

> Assume I am working with a fixed font say Courier 10 point font.
>> Question 1: What does this mean 10 point font?

> Question 2: How do I determine how many characters I can get on a line.
> Question 3: How do I determine how many lines I can get on a page. Assume no margins.
> Question 4: Does their exist some kind of refernce table that will equate a font with chars/line and #lines/page?
>> Thanks
>> Adam
>> I've read where there are 72 points in an inch but I think this equates to height and not width

Nov 15 '05 #6

P: n/a
Yes, 10 points high, or 10/72 of an inch.

Which courier font are you talking about. There is Courier New (which is a
TrueType font) and Courier (which is a screen font).

Adam wrote:

Phil:

OK but let's say I know my font. Its Courier 10 point.

Do you know what this means Courier 10 point?
I know Courier is a fixed font. But I don't know what 10 point means. is it 10 points high? What about the width?
Can you define what a 10 point COurier font is in terms of height, width?

----- Philip Rieck wrote: -----

In c#, you can use the Graphics objects MeasureString property to measure
how many pixels a a string will take given a particular font.

You can't really have a "table" of chars/line or lines/page even with a
monospace font because you'd need different tables based on:

1) what font are you in?
2) what size font is it?
3) is it bold, italic?
4) what size is the client of the window?
5) what size fonts does the user have? (large / small / 132%)

I'm sure people can come up with lots more, and this doesn't touch on
kerning or cleartype settings, etc. Basically, use measurestring or
similar.
"Adam" <an*******@discussions.microsoft.com> wrote in message
news:DE**********************************@microsof t.com...
> Julie:
>> First, thansk for your reply.

> But I am unfamiliar with C++.
> Please correct me if I am wrong, but I thought that a Courier was a fixed

width font. Meaning the letter w takes up the same space as the letter i.
>> Anyway, I'm surprised that their isn't a cross reference table or some sort or fomula. >> Are you awar of any additional info?
>> Adam
>>>>>> ----- Julie J. wrote: -----
>> Unless you are using a monospace font, you can't pre-determine the information
> that you want. (In a monospace font, the character cell width is the

same for
> all glyphs (characters) in the font.)
>> Most fonts are *not* monospace, which means that the character cell

widths are
> different for the different glyphs. For example, W is wider than i.
> Additionally, kerning comes into play, which essentially means that

when glyphs
> are drawn, they may actually be spaced closer together then their

actual width. >> About the only way to really determine what will fit on a line/page is to draw
> it (or use the draw routines to calculate) the actual text being

represented.
> Look up DrawText DT_CALCRECT in MSDN to see numerous articles on the

topic
> (most will be C++, but will give you an idea of what you need to do).
>> If you are using a monospace font, you can get the cell dimensions

from the
> text metrics.
>> Adam wrote:
>>> Can someone please help!!!
>>> I am trying to figure out what a font is?
>> Assume I am working with a fixed font say Courier 10 point font.
>>> Question 1: What does this mean 10 point font?
>> Question 2: How do I determine how many characters I can get on a

line. >> Question 3: How do I determine how many lines I can get on a page. Assume no margins. >> Question 4: Does their exist some kind of refernce table that will equate a font with chars/line and #lines/page? >>> Thanks
>>> Adam
>>> I've read where there are 72 points in an inch but I think this

equates to height and not width
>

Nov 15 '05 #7

P: n/a
Julie

I am referring to Courier and not Courier New

I now understand how the heigth is determined but what about the width
DO you know how if their exists a formula to determine how many characters/line I can get with a Courier 10 point font on a 8.5 width paper

Adam ----- Julie J. wrote: ----

Yes, 10 points high, or 10/72 of an inch

Which courier font are you talking about. There is Courier New (which is
TrueType font) and Courier (which is a screen font)

Adam wrote
Phil
OK but let's say I know my font. Its Courier 10 point
Do you know what this means Courier 10 point

I know Courier is a fixed font. But I don't know what 10 point means. is it 10 points high? What about the width
Can you define what a 10 point COurier font is in terms of height, width
----- Philip Rieck wrote: ----
In c#, you can use the Graphics objects MeasureString property to measur

how many pixels a a string will take given a particular font
You can't really have a "table" of chars/line or lines/page even with

monospace font because you'd need different tables based on
1) what font are you in

2) what size font is it
3) is it bold, italic
4) what size is the client of the window
5) what size fonts does the user have? (large / small / 132%
I'm sure people can come up with lots more, and this doesn't touch o

kerning or cleartype settings, etc. Basically, use measurestring o
similar
"Adam" <an*******@discussions.microsoft.com> wrote in messag news:DE**********************************@microsof t.com..
Julie
First, thansk for your reply

But I am unfamiliar with C++
Please correct me if I am wrong, but I thought that a Courier was a fixe

width font. Meaning the letter w takes up the same space as the letter i Anyway, I'm surprised that their isn't a cross reference table or som sort or fomula Are you awar of any additional info
Ada
>>> ----- Julie J. wrote: ----
Unless you are using a monospace font, you can't pre-determine th informatio
that you want. (In a monospace font, the character cell width is th

same fo
all glyphs (characters) in the font.
Most fonts are *not* monospace, which means that the character cel

widths ar
different for the different glyphs. For example, W is wider than i
Additionally, kerning comes into play, which essentially means tha

when glyph
are drawn, they may actually be spaced closer together then thei

actual width About the only way to really determine what will fit on a line/pag is to dra
it (or use the draw routines to calculate) the actual text bein

represented
Look up DrawText DT_CALCRECT in MSDN to see numerous articles on th

topi
(most will be C++, but will give you an idea of what you need to do)
If you are using a monospace font, you can get the cell dimension

from th
text metrics
Adam wrote
Can someone please help!!
I am trying to figure out what a font is
Assume I am working with a fixed font say Courier 10 point font
Question 1: What does this mean 10 point font
Question 2: How do I determine how many characters I can get on

line Question 3: How do I determine how many lines I can get on a page Assume no margins Question 4: Does their exist some kind of refernce table that wil equate a font with chars/line and #lines/page Thank
Ada
I've read where there are 72 points in an inch but I think thi

equates to height and not width

Nov 15 '05 #8

P: n/a
Adam:

If you are worried about this, I assume that you are either writing to the
printer, or painting a control or surface, is that right? Are you working
with the Graphics object in System.Drawing? If so, check the
MeasureString() method. It might be what you are after.

In order to use this, you have to know the string that you are writing in
addition to the font, and you have to have the Graphics Object applicable to
your surface (which is basically like having the Handle to the Device
Context of the device that you are writing to) It returns a SizeF
structure, which represents the height and width required, in pixels.
"Adam" <an*******@discussions.microsoft.com> wrote in message
news:0A**********************************@microsof t.com...
Julie:

I am referring to Courier and not Courier New.

I now understand how the heigth is determined but what about the width?
DO you know how if their exists a formula to determine how many characters/line I can get with a Courier 10 point font on a 8.5 width
paper?
Adam ----- Julie J. wrote: -----

Yes, 10 points high, or 10/72 of an inch.

Which courier font are you talking about. There is Courier New (which is a TrueType font) and Courier (which is a screen font).

Adam wrote:
>> Phil:
>> OK but let's say I know my font. Its Courier 10 point.
>> Do you know what this means Courier 10 point?

> I know Courier is a fixed font. But I don't know what 10 point means. is it 10 points high? What about the width?
> Can you define what a 10 point COurier font is in terms of height, width?
>> ----- Philip Rieck wrote: -----
>> In c#, you can use the Graphics objects MeasureString property to measure > how many pixels a a string will take given a particular font.
>> You can't really have a "table" of chars/line or lines/page
even with a > monospace font because you'd need different tables based on:
>> 1) what font are you in?

> 2) what size font is it?
> 3) is it bold, italic?
> 4) what size is the client of the window?
> 5) what size fonts does the user have? (large / small / 132%)
>> I'm sure people can come up with lots more, and this doesn't
touch on > kerning or cleartype settings, etc. Basically, use measurestring or > similar.
>>> "Adam" <an*******@discussions.microsoft.com> wrote in
message > news:DE**********************************@microsof t.com...
>> Julie:
>>> First, thansk for your reply.
>> But I am unfamiliar with C++.
>> Please correct me if I am wrong, but I thought that a Courier was
a fixed > width font. Meaning the letter w takes up the same space as the letter i. >>> Anyway, I'm surprised that their isn't a cross reference table or some > sort or fomula.
>>> Are you awar of any additional info?
>>> Adam
>>>>>>> ----- Julie J. wrote: -----
>>> Unless you are using a monospace font, you can't
pre-determine the > information
>> that you want. (In a monospace font, the character cell
width is the > same for
>> all glyphs (characters) in the font.)
>>> Most fonts are *not* monospace, which means that the
character cell > widths are
>> different for the different glyphs. For example, W is wider
than i. >> Additionally, kerning comes into play, which essentially means that > when glyphs
>> are drawn, they may actually be spaced closer together then
their > actual width.
>>> About the only way to really determine what will fit on a
line/page > is to draw
>> it (or use the draw routines to calculate) the actual text
being > represented.
>> Look up DrawText DT_CALCRECT in MSDN to see numerous articles
on the > topic
>> (most will be C++, but will give you an idea of what you need
to do). >>> If you are using a monospace font, you can get the cell

dimensions > from the
>> text metrics.
>>> Adam wrote:
>>>> Can someone please help!!!
>>>> I am trying to figure out what a font is?
>>> Assume I am working with a fixed font say Courier 10 point font.
>>>> Question 1: What does this mean 10 point font?
>>> Question 2: How do I determine how many characters I can get on a

> line.
>>> Question 3: How do I determine how many lines I can get on a
page. > Assume no margins.
>>> Question 4: Does their exist some kind of refernce table that
will > equate a font with chars/line and #lines/page?
>>>> Thanks
>>>> Adam
>>>> I've read where there are 72 points in an inch but I think this

> equates to height and not width
>>

Nov 15 '05 #9

P: n/a
Okay, let's assume you're talking about a physical print out.

a point is a measurement of size such that:
12 pt = 1 pica
1 pt ~ 1/72 of an inch.
(Note that on a monitor, however, the concept of an "inch" is vague at
best. )

So a 10 point typeface should render as 5/36" high, giving about 7 lines per
inch. Note that line spacing will lower the number of lines per inch you
get.

For width, you need to know the pitch - pitch is measured in characters per
inch (and only applicable to fixed-with fonts), so the conversions are
fairly easy. A 12-pitch typeface gives 12 characters to the inch.

Courier 10 point on most windows system is a 12 pitch font, while Courier 12
is normally a 10 pitch font. Note that some typefaces may have different
width / height ratios, but this one is common.

So using a "normal" Courier 10 point on an 8.5x11 letter-size piece of paper
with no margins and 0 line spacing should give you 79 lines high (or 79.2 if
you want to fill the paper) and 102 characters wide, or about 8058 full
characters.

Note that this is the ideal with no variation for printer / driver quirks at
all, and has almost no bearing on a monitor. Also, almost all printouts
will have some line spacing and margins (many printers require at least some
margin)
"Adam" <an*******@discussions.microsoft.com> wrote in message
news:AB**********************************@microsof t.com...
Phil:

OK but let's say I know my font. Its Courier 10 point.

Do you know what this means Courier 10 point?
I know Courier is a fixed font. But I don't know what 10 point means. is it 10 points high? What about the width? Can you define what a 10 point COurier font is in terms of height, width?

----- Philip Rieck wrote: -----

In c#, you can use the Graphics objects MeasureString property to measure how many pixels a a string will take given a particular font.

You can't really have a "table" of chars/line or lines/page even with a monospace font because you'd need different tables based on:

1) what font are you in?
2) what size font is it?
3) is it bold, italic?
4) what size is the client of the window?
5) what size fonts does the user have? (large / small / 132%)

I'm sure people can come up with lots more, and this doesn't touch on
kerning or cleartype settings, etc. Basically, use measurestring or
similar.
"Adam" <an*******@discussions.microsoft.com> wrote in message
news:DE**********************************@microsof t.com...
> Julie:
>> First, thansk for your reply. > But I am unfamiliar with C++.
> Please correct me if I am wrong, but I thought that a Courier was a fixed width font. Meaning the letter w takes up the same space as the letter i.
>> Anyway, I'm surprised that their isn't a cross reference table or some sort or fomula.
>> Are you awar of any additional info?
>> Adam
>>>>>> ----- Julie J. wrote: -----
>> Unless you are using a monospace font, you can't
pre-determine the
information
> that you want. (In a monospace font, the character cell width is the
same for
> all glyphs (characters) in the font.)
>> Most fonts are *not* monospace, which means that the
character cell widths are
> different for the different glyphs. For example, W is wider
than i. > Additionally, kerning comes into play, which essentially means

that when glyphs
> are drawn, they may actually be spaced closer together then
their actual width. >> About the only way to really determine what will fit on a
line/page
is to draw
> it (or use the draw routines to calculate) the actual text
being represented.
> Look up DrawText DT_CALCRECT in MSDN to see numerous articles
on the topic
> (most will be C++, but will give you an idea of what you need
to do). >> If you are using a monospace font, you can get the cell

dimensions from the
> text metrics.
>> Adam wrote:
>>> Can someone please help!!!
>>> I am trying to figure out what a font is?
>> Assume I am working with a fixed font say Courier 10 point font.
>>> Question 1: What does this mean 10 point font?
>> Question 2: How do I determine how many characters I can get on a

line. >> Question 3: How do I determine how many lines I can get on a page. Assume no margins. >> Question 4: Does their exist some kind of refernce table that will equate a font with chars/line and #lines/page? >>> Thanks
>>> Adam
>>> I've read where there are 72 points in an inch but I think this

equates to height and not width
>

Nov 15 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.