Print using your own fonts using C#

WBOY
Release: 2023-09-15 12:29:09
forward
1005 people have browsed it

使用 C# 使用您自己的字体进行打印

To print your own font in C#, first construct -

  • FontFamily object
  • Font object

FontFamily object sets fonts such as Arial, TimesNewRoman, etc., while the Font object sets the size and style of the font.

Let's create an Arial font style.

FontFamily myFontFamily = new FontFamily("Arial");
Font myFont = new Font(
myFontFamily,
20,
FontStyle.Bold,
GraphicsUnit.Pixel);
Copy after login

Above, we set up the FontFamily object. The first argument passed to Font() is the FontFamily object "myFontFamily", followed by the size of the font. The third parameter sets the style.

The above is the detailed content of Print using your own fonts using C#. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!