How to add a font from windows...

-OniKaze-

Newcomer
Joined
Feb 26, 2007
Messages
7
Hello every1!
my problem is quite simple i guess...but i don't know how to solve it..=D
i'm trying to add a windows font, in my case Arial, in vb .net 'cause it doesn't come with it, but i don't know how!!!

Can any1 PLEAAAASE help me???

Tnx!!
 
I can't image what computer would not come packed with Arial... regardless, you can include the font file as an embedded resource and either load it into your application (I think you can only use it for GDI+ in this case, not for fonts on controls) or you can install it into Windows (I don't know the specifics of this). However, there is still the issue of licensing. If you are not licensed to distribute this font then it may be technically illegal for you to do so.
 
I can't image what computer would not come packed with Arial... regardless, you can include the font file as an embedded resource and either load it into your application (I think you can only use it for GDI+ in this case, not for fonts on controls) or you can install it into Windows (I don't know the specifics of this). However, there is still the issue of licensing. If you are not licensed to distribute this font then it may be technically illegal for you to do so.

LOL...the computer has Arial...what doesn't have is VB .NET!
i'm trying this approach:
imports system.drawing.text

Dim bfBOLD, bfBOLD2, Arial As BaseFont
Dim black As color
Dim myfont As New Font(Arial, 10, FontStyle.Bold, black)

but now i'm with a new problem, when i try to use the variables bfBOLD n bfBOLD2 to use my font to print ina pdf doc, VB is not leting my use "myfont" cause "myfont" is not a member of com.lowagie.text.pdf.BaseFont.

please help! xD

tnx
 
no more help needed yall!!!

i've just figured how to solve my issue!
the code is:

dim variable as BaseFont
variable = BaseFont.createFont("c:\windows\fonts\fontname.TTF", BaseFont.CP1252, BaseFont.NOT_EMBEDDED)

and tcharam, done! and works just fine XD

tnx for all the help!!
 
Java in VB.Net?

com.lowagie.text.pdf.BaseFont is a Java class.

Out of curiosity, how have you managed to use Java classes in VB.Net? :eek:
 
Back
Top