本文整理汇总了C#中System.Drawing.FontFamily.GetLineSpacing方法的典型用法代码示例。如果您正苦于以下问题:C# FontFamily.GetLineSpacing方法的具体用法?C# FontFamily.GetLineSpacing怎么用?C# FontFamily.GetLineSpacing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.FontFamily
的用法示例。
在下文中一共展示了FontFamily.GetLineSpacing方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLineSpacing_Example
public void GetLineSpacing_Example(PaintEventArgs e)
{
// Create a FontFamily object.
FontFamily myFontFamily = new FontFamily("Arial");
// Get the line spacing for myFontFamily.
int lineSpacing = myFontFamily.GetLineSpacing(FontStyle.Regular);
// Draw the value of lineSpacing to the screen as a string.
e.Graphics.DrawString(
"lineSpacing = " + lineSpacing.ToString(),
new Font(myFontFamily, 16),
Brushes.Black,
new PointF(0, 0));
}
示例2: Main
//引入命名空间
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
public class Test{
static void Main() {
FontFamily myFamily = new FontFamily("Verdana");
Font myFont = new Font(myFamily, 12);
int fontHeight = myFont.Height;
Console.WriteLine("Measurements are in GraphicsUnit." + myFont.Unit.ToString());
Console.WriteLine("The Verdana family.");
// Print our Family ties...
Console.WriteLine("Ascent for bold Verdana: " + myFamily.GetCellAscent(FontStyle.Bold));
Console.WriteLine("Descent for bold Verdana: " + myFamily.GetCellDescent(FontStyle.Bold));
Console.WriteLine("Line spacing for bold Verdana: " + myFamily.GetLineSpacing(FontStyle.Bold));
Console.WriteLine("Height for bold Verdana: " + myFamily.GetEmHeight(FontStyle.Bold));
}
}