From: Mike Williams on
It seems that the Cambria Math font has recently acquired an extremely large
Ascent and Descent. Has it perhaps always been that way and I've never
noticed it before, or is it something recent, perhaps a Vista thing? Try the
following code for example. For Arial and Times New Roman (and virtually all
other fonts) I am getting pretty much exactly what I would expect (a
TextHeight that is a bit larger than the point size) but for Cambria Math I
am getting an extremely large TextHeight (I get exactly the same results
using GDI32 methods). At this end (on my Vista Business laptop and my Vista
Home Premium desktop which both run at the standard 96 dpi) I get 15.75/18
for Arial and 15.75/17.25 for Times New Roman, which both seem okay, but I
get 15.75/87.75 for Cambria Math, which seems extraordinary.

Mike

Private Sub Command1_Click()
ScaleMode = vbPoints
Caption = "All sizes are in Points " & _
"(point size first followed by TextHeight)"
Font.Name = "Arial"
Font.Size = 16
Print Font.Name; Font.Size; TextHeight("x")
Print "Seems okay"
Font.Name = "Cambria Math"
Font.Size = 16
Print Font.Name; Font.Size; TextHeight("x")
Print "Very odd?"
Font.Name = "Times New Roman"
Font.Size = 16
Print Font.Name; Font.Size; TextHeight("x")
Print "Seems okay"
End Sub




From: Nobody on
"Mike Williams" <Mike(a)WhiskyAndCoke.com> wrote in message
news:OIiWmLlzKHA.3884(a)TK2MSFTNGP06.phx.gbl...
> It seems that the Cambria Math font has recently acquired an extremely
> large Ascent and Descent. Has it perhaps always been that way and I've
> never noticed it before, or is it something recent, perhaps a Vista thing?
> Try the following code for example. For Arial and Times New Roman (and
> virtually all other fonts) I am getting pretty much exactly what I would
> expect (a TextHeight that is a bit larger than the point size) but for
> Cambria Math I am getting an extremely large TextHeight (I get exactly the
> same results using GDI32 methods). At this end (on my Vista Business
> laptop and my Vista Home Premium desktop which both run at the standard 96
> dpi) I get 15.75/18 for Arial and 15.75/17.25 for Times New Roman, which
> both seem okay, but I get 15.75/87.75 for Cambria Math, which seems
> extraordinary.

I got the exact same number here in XP+SP2. I am using VB6+SP5 with SP6
runtime.


From: Helmut Meukel on
"Nobody" <nobody(a)nobody.com> schrieb im Newsbeitrag
news:Oa22WjlzKHA.1796(a)TK2MSFTNGP02.phx.gbl...
> "Mike Williams" <Mike(a)WhiskyAndCoke.com> wrote in message
> news:OIiWmLlzKHA.3884(a)TK2MSFTNGP06.phx.gbl...
>> It seems that the Cambria Math font has recently acquired an extremely large
>> Ascent and Descent. Has it perhaps always been that way and I've never
>> noticed it before, or is it something recent, perhaps a Vista thing? Try the
>> following code for example. For Arial and Times New Roman (and virtually all
>> other fonts) I am getting pretty much exactly what I would expect (a
>> TextHeight that is a bit larger than the point size) but for Cambria Math I
>> am getting an extremely large TextHeight (I get exactly the same results
>> using GDI32 methods). At this end (on my Vista Business laptop and my Vista
>> Home Premium desktop which both run at the standard 96 dpi) I get 15.75/18
>> for Arial and 15.75/17.25 for Times New Roman, which both seem okay, but I
>> get 15.75/87.75 for Cambria Math, which seems extraordinary.
>
> I got the exact same number here in XP+SP2. I am using VB6+SP5 with SP6
> runtime.
>
>



Hmmm,

I just went to Control Panel / Fonts on my Vista Home Premium 32-bit system
and clicked on 'Cambria & Cambria Math'. It's a True Type Collection.
It displays Cambria as usual, but when you switch to Cambria Math it shows
this font with extremely space between the lines. My guess is there are
mathematical symbols in this font which need this height. They didn't bother
with Italic, Bold or Bold Italic versions of Cambria Math.

Helmut.



From: Mike Williams on

"Helmut Meukel" <NoSpam(a)NoProvider.de> wrote in message news:%

> I just went to Control Panel / Fonts on my Vista Home Premium
> 32-bit system and clicked on 'Cambria & Cambria Math' . . . It
> displays Cambria as usual, but when you switch to Cambria Math
> it shows this font with extremely space between the lines.

It's probably always been like that, and I haven't noticed before. I never
actually use that font and I only noticed it because I was writing a little
utility for somebody and I came across it in the process.

> They didn't bother with Italic, Bold or Bold Italic versions
> of Cambria Math.

No, they didn't produce a special italic or bold fontface for it, although
you can of course get simulated bold and/or italic in the normal way that
you can get them for any other font that does not have its own specially
designed italic or bold font face, simply by specifying bold or italic in
the usual way.

> My guess is there are mathematical symbols in this font which
> need this height.

You're probably right there, although I did have a quick look through lots
of the characters using Unicode view in CharacterMap and I couldn't find
any. Even the special math characters that you might expect would be large
in relation to the other characters were not so huge as to occupy anywhere
near the full available character cell height . . but hey, what I know about
math or math fonts can be written on the back of a postage stamp, so that
doesn't mean very much ;-)

Mike



From: sven2000 on
I've noticed this for Symath.

Except from that, the textheight in VB is always the same.

*************************************************************************************
sample
*************************************************************************************
Private Sub Form_Load()

Form1.ScaleMode = vbPixels

End Sub
Private Sub Form_Paint()

Form1.Font.Name = "Times New Roman"
Form1.Font.Size = 24

Form1.Print Form1.Font.Name
Form1.Print Form1.Font.Name
Form1.Print Form1.Font.Size
Form1.Print "x"
Form1.Print Form1.TextWidth("x") & " " & Form1.TextHeight("x")
Form1.Print "X"
Form1.Print Form1.TextWidth("X") & " " & Form1.TextHeight("X")
Form1.Print "h"
Form1.Print Form1.TextWidth("h") & " " & Form1.TextHeight("h")
Form1.Print "gh"
Form1.Print Form1.TextWidth("gh") & " " & Form1.TextHeight("gh")

End Sub

Output:

Times New Roman
24
15 36
23 36
15 36
30 36

Width and height measured in paint (pixels):

x 15 14
X 22 21
h 15 22
gh 29 29

Distance bottom of line to bottom of next line:

36 pixels

*************************************************************************************
end sample
*************************************************************************************