Если открыть Таблицу символов, то видно, что нужный шрифт регистрируется, но использовать его на форме не получается...
- Код: Выделить всё
Public Class Form1
Private Declare Unicode Function AddFontResource Lib "gdi32" Alias "AddFontResourceW" (ByVal lpFileName As String) As Integer
Private Declare Unicode Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceW" (ByVal lpFileName As String) As Integer
Private ReadOnly FontFile As String = System.IO.Path.Combine(My.Application.Info.DirectoryPath, "Stone Handwriting.ttf")
Private ReadOnly FontName As String = "Stone Handwriting"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AddFontResource(FontFile)
Me.Font = New Font(FontName, 16)
End Sub
Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
e.Graphics.DrawString(Me.Font.Name, Me.Font, Brushes.Black, 0, 0)
End Sub
Private Sub Form1_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed
RemoveFontResource(FontFile)
End Sub
End Class