開発環境 |
Microsoft Visual Studio Community 2019 |
実行環境 |
Microsoft Windows 10 Home (64bit) |
プロジェクト テンプレート |
C# Windows フォーム アプリケーション (.NET Framework) |
プロジェクト名 |
FontView |
Form1.cs
using System;
using System.Drawing;
using System.Windows.Forms;
namespace FontView
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
using (Graphics g = pictureBox1.CreateGraphics())
{
FontFamily[] families = FontFamily.Families;
int y = 0;
foreach (FontFamily family in families)
{
using (Font font = new Font(family, 10))
{
float h = font.GetHeight(g);
g.DrawString($"AB漢字 / {h} / {font.Name}",
font, Brushes.Black, 0, y);
y += (int)Math.Ceiling(h);
}
}
}
}
}
}
最終更新:2020年07月28日 17:41