1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Rep Power

    Question drawing text with algerian font

    I have coded a program that allows me to draw text via button click. However, the font I want isn't available. How would I install the font so I can use it?

    MainForm.vb(Code to draw text):
    Private Sub BtnCustomText_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCustomText.Click
            Dim g As Graphics = Me.CreateGraphics()
            'Call sub. Specify x and y coordinates (in this case 10 and 50) and the text to draw 
            markInvalid(New System.Windows.Forms.PaintEventArgs(g, New Rectangle(431, 150, Me.Width, Me.Height)), 10, 50, "THIS IS A STRING USING THE ALGERIAN FONT, SIZE 16, IN BOLD TEXT")
        End Sub
        Private Sub markInvalid(ByVal e As System.Windows.Forms.PaintEventArgs, ByVal xco As Single, ByVal yco As Single, ByVal drawString As String)
            'Specify text parameters, like font, size, color and location
            Dim aFont As New System.Drawing.Font("Algeria", 16, FontStyle.Bold)
            Dim drawBrush As New SolidBrush(Color.Blue)
            Dim drawPoint As New PointF(xco, yco)
            'Execute DrawString
            e.Graphics.DrawString(drawString, aFont, drawBrush, drawPoint)
        End Sub
    Last edited by darthvader45; July 24th, 2013 at 02:33 PM. Reason: Changing question

IMN logo majestic logo threadwatch logo seochat tools logo