I havent had much luck in getting sound advice from embedding but heres another stab at it. I use the code from VB.NET F.A.Q for telling me how to embedd and use fonts so I don't have to install them on users computers that have my programs. Everything is the same that I have used but it don't work for me unless I install the font on my computer and this defeats the purpose of embedding it since I can't share it.
The only code I use diffrent is the part about accessing the resource:
I have tried to replace it with this: By the way... the name of my embedded font is DotMatrix and it's a true type font.Code:Me.Font = New Font(FntFC.Families(0), 10)
Code:Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint Dim g As Graphics = e.Graphics 'Text to be drawn to the form Dim txt As String = "Hello" g.DrawString(txt, New Font("FntFC.DotMatrix", 18, FontStyle.Regular), Brushes.Black, New RectangleF(20, 20, 180, 30)) End Sub




Reply With Quote