Class FontUnit

Class FontUnit

Namespace: Aspose.BarCode.Generation
Assembly: Aspose.BarCode.dll (25.1.0)

定义文本的特定格式,包括字体样式、大小和样式属性,其中大小为单位值属性。

public sealed class FontUnit

继承

objectFontUnit

继承成员

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

示例

此示例演示如何创建并保存条形码图像。

  using (BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.Code128))
  {
      generator.CodeTextStyle.Font.Style = FontStyle.Italic;
      generator.CodeTextStyle.Font.Size.Point = 18;
      generator.Save("test.png");
  }

属性

FamilyName

获取或设置此字体的字体名称。

[XmlSerialization(Type = XmlSerializationType.Element)]
public string FamilyName { get; set; }

属性值

string

Size

获取或设置此 FontUnit 的大小,单位值。

[XmlSerialization(Type = XmlSerializationType.Element, Name = "Size")]
public Unit Size { get; }

属性值

Unit

异常

ArgumentException

参数 Size 的值小于或等于 0。

Style

获取或设置此 FontUnit 的样式信息。

[XmlSerialization(Type = XmlSerializationType.Element)]
public FontStyle Style { get; set; }

属性值

FontStyle

 中文