Table of Contents

BiffFontRecord Struct

Definition

Namespace
Bodu.IO.Biff
Assembly
Bodu.IO.Biff.dll
Package
Bodu.IO.Biff 1.0.0
Source
BiffFontRecord.cs

Represents a decoded FONT record: size, style attributes, color, character set, and face name. The name is an 8-bit-length string in both versions - a Unicode string in BIFF8, a code-page byte string in BIFF5.

public readonly ref struct BiffFontRecord
Inherited Members

Remarks

The record identifier is Font. The payload is fourteen fixed bytes - height, attribute flags, color index, weight, escapement, underline, family, character set, and a reserved byte - followed by the name. Font indices used by FontIndex count these records in stream order, skipping index 4, which Excel never writes.

Properties

Attributes

Gets the raw attribute flags: italic (bit 1), strikeout (bit 3), outline (bit 4), shadow (bit 5).

public ushort Attributes { get; }

Property Value

ushort

The flags.

CharacterSet

Gets the character set.

public byte CharacterSet { get; }

Property Value

byte

The Windows character set code.

ColorIndex

Gets the index of the font color in the workbook palette.

public ushort ColorIndex { get; }

Property Value

ushort

The color index; 0x7FFF selects the automatic color.

Escapement

Gets the escapement type.

public ushort Escapement { get; }

Property Value

ushort

0 none, 1 superscript, 2 subscript.

Family

Gets the font family.

public byte Family { get; }

Property Value

byte

The Windows font family code.

Height

Gets the font height in twips (twentieths of a point).

public ushort Height { get; }

Property Value

ushort

The height.

IsBold

Gets a value indicating whether the font is bold.

public bool IsBold { get; }

Property Value

bool

true when Weight is at least 700.

IsItalic

Gets a value indicating whether the font is italic.

public bool IsItalic { get; }

Property Value

bool

true when bit 1 of Attributes is set.

IsStrikeout

Gets a value indicating whether the font is struck out.

public bool IsStrikeout { get; }

Property Value

bool

true when bit 3 of Attributes is set.

Name

Gets the face name.

public BiffString Name { get; }

Property Value

BiffString

The name as a span-backed view.

Underline

Gets the underline type.

public byte Underline { get; }

Property Value

byte

0 none, 1 single, 2 double, 0x21 single accounting, 0x22 double accounting.

Weight

Gets the font weight.

public ushort Weight { get; }

Property Value

ushort

The weight on the Windows scale: 400 normal, 700 bold.

Applies to

ProductVersions
.NET8, 10

See Also