TechSapphire Tuesday, 2024-05-21, 3:05 AM
Site menu
Login form
Play Games
  • Deep Freeze
  • Ice Slide
  • Gyroball
  • Fat Fish
  • Bush Royal Rampage
  • Add font at run time .Net Or Font VB Net Or Install Font run time
    You could install or add font at run time for particularly use in your project. This sample code is for installing font to project at run time in Vb.Net.
    Namespace required:

    Imports System

    Global Declaration:

       Dim PFC As Drawing.Text.PrivateFontCollection

      Dim NewFont_FF As Drawing.FontFamily        

    Function Call:

    CreateFont(Application.StartupPath & "\font.ttf", 20, FontStyle.Regular, GraphicsUnit.Point)

    Function Defination:

        Private Function CreateFont(ByVal name As String, ByVal size As Single, ByVal style As Drawing.FontStyle, ByVal unit As Drawing.GraphicsUnit) As Drawing.Font

            PFC = New Drawing.Text.PrivateFontCollection


            NewFont_FF = PFC.Families(0)

            Return New Drawing.Font(NewFont_FF, size, style, unit)

        End Function

    You need to have font file in your Debug folder for this. And you must edit Fontname in argument of CreateFont function
    If want to check live project example download this project. Here you would find installation of font run time using Vb.Net.
    Programming [27]
    Tips for programming
    Security [2]
    Security Tips
    Google [1]
    Use google faster then ever you use
    Project [14]
    HTML [2]
    Electronics [0]
    Data Structure [0]
    Database [16]
    SSRS [1]
    Sql Server Reporting Services
    Copyright MyCorp © 2024