Jump to content
Xtreme .Net Talk

How to add a font from windows...


Recommended Posts

Guest -OniKaze-
Posted

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!!

  • Leaders
Posted
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.
[sIGPIC]e[/sIGPIC]
Guest -OniKaze-
Posted
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

Guest -OniKaze-
Posted

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!!

Posted

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:

Never trouble another for what you can do for yourself.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...