Results 1 to 6 of 6

Thread: Using a new TTF (not installed)

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2016
    Posts
    216

    Using a new TTF (not installed)

    Google has been of no help (either it can't be done, or I am searching for the wrong things)..

    I have a TTF file (converted from a OTF i got online) that I would like to use in my program. The problem is I don't want to have to install said font on every computer that uses my program, and don't know how to do this..

    Help?

    PS. I converted the OTF to a TTF because everything I found online says OTF isn't supported in VS, if this is no longer the case I would be happy to stay with OTF (though I don't know how to use that either).

    Code:
            Dim myFonts As PrivateFontCollection
            Dim fontBuffer As IntPtr
            myFonts = New PrivateFontCollection
            Dim font() As Byte = My.Resources.Norse
            fontBuffer = Marshal.AllocCoTaskMem(font.Length)
            Marshal.Copy(font, 0, fontBuffer, font.Length)
            myFonts.AddMemoryFont(fontBuffer, font.Length)
    
            Label3.Font = New Font(myFonts.Families(0), 14)
    I have the above code.. but the font never actually gets used, just the size and the default font
    Last edited by CWITT; Feb 12th, 2019 at 01:48 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width