
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
Print with your own font using C#
To print your own font in C#, firstly construct −
- FontFamily object
- Font Object
The FontFamily object sets the typeface like Arial, TimesNewRoman, etc, whereas the Font object sets the size and style of font.
Let us create an Arial font style.
FontFamily myFontFamily = new FontFamily("Arial"); Font myFont = new Font( myFontFamily, 20, FontStyle.Bold, GraphicsUnit.Pixel);
Above, we have set the FontFamily object. The first parameter passed to the Font() is the FontFamily object “myFontFamily”, then comes the size of the font. The third argument sets the style.
- Related Articles
- Print with your own font using Python?
- Implement your own sizeof operator using C++
- Write your own memcpy() in C
- Implement your own itoa() in C
- Write your own atoi() in C++
- How will implement Your Own sizeof in C
- Write your own memcpy() and memmove() in C++
- Build Your Own Botnet
- Set different font families for screen and print with CSS
- How to Build your own website using Django in Python
- Write your own strcmp that ignores cases in C++
- Create Your Own Q&A Forum Like Stack Overflow using Askbot
- How to write your own header file in C?\n
- Set Font Size with Pixels using CSS
- Set Font Size with em using CSS

Advertisements