Discussion:
How to rotate the "MS Sans Serif" font by 90 degree
(too old to reply)
Minfu
2004-04-18 15:41:03 UTC
Permalink
For labeling charts, I have to rotate a font by 90 degree. I can rotate a font. But the problem is like that
All other fonts used in my applications is "MS Sans Serif", but the rotated font is not even through I have set the font name to "MS Sans Serif" in the CreateFont function. The displayed rotated font is either "Arial" or "Times New Roman", operating system depending

I do not know how to rotate the "MS Sans Serif" font. Is there anybody can help me

Thanks

Minf
Schmidt
2004-04-18 16:57:10 UTC
Permalink
Post by Minfu
For labeling charts, I have to rotate a font by 90 degree. I can rotate a
All other fonts used in my applications is "MS Sans Serif", but the
rotated font is not even through I have set the font name to "MS Sans Serif"
in the CreateFont function. The displayed rotated font is either "Arial" or
"Times New Roman", operating system depending.
Post by Minfu
I do not know how to rotate the "MS Sans Serif" font. Is there anybody can
help me?

What about rotating the NonTTFs Pixel by Pixel?

'****Into a Form (+Picturebox named Picture1)
Private Sub Form_Click()
DrawTextV Picture1, "Small Test", "MS Sans Serif", 12, True
End Sub

Sub DrawTextV(Dst As PictureBox, S$, FName$, FSize&, Optional FBold&, _
Optional FColor&, Optional BColor& = vbWhite)
Dim x&, y&, Clr&, yy&
Static Buf As PictureBox
If Buf Is Nothing Then Set Buf = Controls.Add("vb.picturebox", "aBuf")
With Buf
.ScaleMode = 3: .AutoRedraw = True: .BorderStyle = 0
.FontName = FName: .FontSize = FSize: .FontBold = FBold
.ForeColor = FColor: .BackColor = vbMagenta: .Cls
.Move 0, 0, .ScaleX(.TextWidth(S), 3, 1), .ScaleY(.TextHeight(S), 3, 1)
Dst.ScaleMode = 3: Dst.BackColor = BColor
Buf.Print S
For y = 1 To .ScaleHeight
yy = .ScaleHeight - y
For x = 1 To .ScaleWidth
Clr = .Point(x, y)
If Clr <> .BackColor Then Dst.PSet (yy, x), Clr
Next x
Next y
End With
End Sub


Olaf
Minfu
2004-04-19 13:36:04 UTC
Permalink
It works very well. I made some changes to the code so that it meets my requirement

Thanks a lot.

Tom Esh
2004-04-18 17:52:31 UTC
Permalink
On Sun, 18 Apr 2004 08:41:03 -0700, "Minfu"
All other fonts used in my applications is "MS Sans Serif", but the rotated font is not even through I have set the font name to "MS Sans Serif" in the CreateFont function. The displayed rotated font is either "Arial" or "Times New Roman", operating system depending.
I do not know how to rotate the "MS Sans Serif" font. Is there anybody can help me?
The font engine won't rotate non-truetype fonts like MS Sans Serif.
Try it with "Microsoft Sans Serif" or another truetype font.


-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
Loading...