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

Font support changed in .NET ?

P: n/a
Hi!

I'm trying to print barcodes paper printings of my VB .NET (2003) Windows
forms application. Earlier I used Code39.TTF (True Type Font) with VB6, and
it was working fine, but now can't get barcodes with VB .NET with the same
font !? I downloaded demo .OTF-barcode font (Open Type Font), and using it
with VB.NET I can get barcode printings using Crystal Reports .rpt-files of
my application, and using Printing.PrintDocument too.

I'm using Printing.PrintDocument-object like...

Private Sub pd_PrintPage(ByVal sender As System.Object, ByVal e As
System.Drawing.Printing.PrintPageEventArgs)
Dim fntText As New Font("Arial", 12)
Dim fntBarc As New Font("DemoFont39", 8)

'// Human readable text
e.Graphics.DrawString("READABLE", fntText, Brushes.Black,
e.MarginBounds.Left, 200)

'// Barcode
e.Graphics.DrawString("*BARCODE*", fntBarc, Brushes.Black,
e.MarginBounds.Left + 200, 200)

e.HasMorePages = False
End Sub

Is this TTF-font support changed in VB.NET or what may be reason for I can't
use it any more? Is the only possibility to use .OTF-barcode font (Open Type
Font) these days - ie. buy other type expensive barcode font because earlier
font is no more working :( ? Whick font types are supported in .NET?

--
Thanks in advance!

Mika
Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi,

I downloaded and installed the code39 barcode font from here. Your code
worked fine.
http://www.dafont.com/dl.php?os=win&fichier=code39

Ken
-------------

"Mika M" <mika.mahonen@nospam_kolumbus.fi> wrote in message
news:O7**************@tk2msftngp13.phx.gbl:
Hi!

I'm trying to print barcodes paper printings of my VB .NET (2003) Windows

forms application. Earlier I used Code39.TTF (True Type Font) with VB6,
and
it was working fine, but now can't get barcodes with VB .NET with the same

font !? I downloaded demo .OTF-barcode font (Open Type Font), and using it

with VB.NET I can get barcode printings using Crystal Reports .rpt-files
of
my application, and using Printing.PrintDocument too.

I'm using Printing.PrintDocument-object like...

Private Sub pd_PrintPage(ByVal sender As System.Object, ByVal e As
System.Drawing.Printing.PrintPageEventArgs)
Dim fntText As New Font("Arial", 12)
Dim fntBarc As New Font("DemoFont39", 8)

'// Human readable text
e.Graphics.DrawString("READABLE", fntText, Brushes.Black,
e.MarginBounds.Left, 200)

'// Barcode
e.Graphics.DrawString("*BARCODE*", fntBarc, Brushes.Black,
e.MarginBounds.Left + 200, 200)

e.HasMorePages = False
End Sub

Is this TTF-font support changed in VB.NET or what may be reason for I
can't
use it any more? Is the only possibility to use .OTF-barcode font (Open
Type
Font) these days - ie. buy other type expensive barcode font because
earlier
font is no more working :( ? Whick font types are supported in .NET?

--
Thanks in advance!

Mika


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.0.0 - Release Date: 6/2/2004
Nov 20 '05 #2

P: n/a
Hi Ken!

Thanks for your reply. Yes barcode font of the link seems to work, but it
converts into barcode only uppercase letters. Before I noticed this, all
lovercase content was human readable and uppercase content was barcode -
funny looking :)

-- Mika

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ub**************@TK2MSFTNGP10.phx.gbl...
Hi,

I downloaded and installed the code39 barcode font from here. Your code
worked fine.
http://www.dafont.com/dl.php?os=win&fichier=code39

Ken

Nov 20 '05 #3

P: n/a
Hi,

This one works better. The app should install the font and draw
barcoding made easy in the new font.

http://www.onteorasoftware.com/downloads/barcode.zip

Ken
--------------

"Mika M" <mika.mahonen@nospam_kolumbus.fi> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl:
Hi Ken!

Thanks for your reply. Yes barcode font of the link seems to work, but it

converts into barcode only uppercase letters. Before I noticed this, all

lovercase content was human readable and uppercase content was barcode -

funny looking :)

-- Mika

"Ken Tucker [MVP]" <HYPERLINK
"mailto:vb***@bellsouth.net"vb***@bellsouth.ne t> wrote in message
news:ub**************@TK2MSFTNGP10.phx.gbl...
Hi,

I downloaded and installed the code39 barcode font from here. Your
code
worked fine.
HYPERLINK
"http://www.dafont.com/dl.php?os=win&fichier=code39"http://www.dafont.com/dl
.php?os=win&fichier=code39

Ken


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.0.0 - Release Date: 6/2/2004
Nov 20 '05 #4

P: n/a
Hi Ken!

Thanks again of your reply and helping me. Well coding is little too high
mathematics for my skill level, especially those API's, but I can copy
coding into my application :)

Anyway application will stuck when it's executing line ...

SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0)

.... and does not execute following lines below this line :(

Other question: How can I get correct Font-directory (or folder) if it not
is 'C:\Windows\Fonts'? It possible to be for example 'C:\WinNT\Fonts'.

-- Mika

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OR**************@TK2MSFTNGP11.phx.gbl...
Hi,

This one works better. The app should install the font and draw
barcoding made easy in the new font.

http://www.onteorasoftware.com/downloads/barcode.zip

Nov 20 '05 #5

P: n/a
Hi,

Dim strWindows As String =
Environment.GetEnvironmentVariable("WINDIR")
Dim strPath As String = String.Format("{0}\barcoding.ttf",
fi.DirectoryName)
Dim strFont As String =
String.Format("{0}\Fonts\barcoding.ttf", strWindows)

Ken
-----------------

"Mika M" <mika.mahonen@nospam_kolumbus.fi> wrote in message
news:us*************@TK2MSFTNGP11.phx.gbl:
Hi Ken!

Thanks again of your reply and helping me. Well coding is little too high

mathematics for my skill level, especially those API's, but I can copy
coding into my application :)

Anyway application will stuck when it's executing line ...

SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0)

... and does not execute following lines below this line :(

Other question: How can I get correct Font-directory (or folder) if it not

is 'C:\Windows\Fonts'? It possible to be for example 'C:\WinNT\Fonts'.

-- Mika

"Ken Tucker [MVP]" <HYPERLINK
"mailto:vb***@bellsouth.net"vb***@bellsouth.ne t> wrote in message
news:OR**************@TK2MSFTNGP11.phx.gbl...
Hi,

This one works better. The app should install the font and draw
barcoding made easy in the new font.

HYPERLINK
"http://www.onteorasoftware.com/downloads/barcode.zip"http://www.onteorasoft
ware.com/downloads/barcode.zip


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.0.0 - Release Date: 6/2/2004
Nov 20 '05 #6

P: n/a
Hi Ken!

Thanks very much! Your helped me lot! :)

-- Mika
Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.