# IOfficeFontProgram

Decoded font program used by OfficeIMO measurement and outline rendering.

Interface 

`OfficeIMO.Drawing`

**Namespace**

`OfficeIMO.Drawing`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficeFontPrograms.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontPrograms.cs#L9)

**Modifiers**

abstract

Decoded font program used by OfficeIMO measurement and outline rendering. Implementations may be supplied by specialized packages to override the first-party engine.

## Usage

Explore 3 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 2

- Property [OfficeFontFace.Program](/api/core/officeimo-drawing-officefontface/#property-program)
- Property [OfficeFontProgramLoadResult.Program](/api/core/officeimo-drawing-officefontprogramloadresult/#property-program)

### Accepted by parameters 1

- Constructor [OfficeFontProgramLoadResult.OfficeFontProgramLoadResult](/api/core/officeimo-drawing-officefontprogramloadresult/#constructor-ctor-officeimo-drawing-iofficefontprogram-int32-byte) parameter `program`

Filter members 

Show inherited

## Methods

`public abstract byte[] GetFontDataForShaping()` [#](#method-getfontdataforshaping)

Returns an independent font-data snapshot suitable for an external shaping provider.

Returns

`byte[]`

`public abstract List<List<OfficePoint>> GetShapedTextContours(string text, OfficeTextShapingResult result, double x, double y, double fontSize)` [#](#method-getshapedtextcontours-string-officeimo-drawing-officetextshapingresult-double-double-double)

Returns filled contours for a validated externally shaped run.

Parameters

**text string required**

**result OfficeIMO.Drawing.OfficeTextShapingResult required**

**x double required**

**y double required**

**fontSize double required**

Returns

`List<List<OfficePoint>>`

`public abstract List<List<OfficePoint>> GetTextContours(string text, double x, double y, double fontSize)` [#](#method-gettextcontours-string-double-double-double)

Returns filled contours for the supplied text.

Parameters

**text string required**

**x double required**

**y double required**

**fontSize double required**

Returns

`List<List<OfficePoint>>`

`public abstract bool HasGlyphs(string text)` [#](#method-hasglyphs-string)

Tests whether the selected program contains glyphs for every text element.

Parameters

**text string required**

Returns

`bool`

`public abstract double LineHeight(double fontSize)` [#](#method-lineheight-double)

Returns the line height at the requested font size.

Parameters

**fontSize double required**

Returns

`double`

`public abstract double Measure(string text, double fontSize)` [#](#method-measure-string-double)

Measures text at the requested font size.

Parameters

**text string required**

**fontSize double required**

Returns

`double`

`public abstract double MeasureShapedText(string text, OfficeTextShapingResult result, double fontSize)` [#](#method-measureshapedtext-string-officeimo-drawing-officetextshapingresult-double)

Measures a validated externally shaped run.

Parameters

**text string required**

**result OfficeIMO.Drawing.OfficeTextShapingResult required**

**fontSize double required**

Returns

`double`

`public abstract IReadOnlyList<double> MeasureTextElements(IReadOnlyList<string> elements, double fontSize)` [#](#method-measuretextelements-collections-generic-ireadonlylist-system-string-double)

Measures the supplied grapheme-safe text elements.

Parameters

**elements System.Collections.Generic.IReadOnlyList<string> required**

**fontSize double required**

Returns

`IReadOnlyList<double>`

`public abstract bool TryGetGlyphMetrics(int scalar, out int glyphId, out int advanceWidth)` [#](#method-trygetglyphmetrics-int32-int32-int32)

Maps one Unicode scalar to a glyph and design-unit advance.

Parameters

**scalar int required**

**glyphId int required**

**advanceWidth int required**

Returns

`bool`

## Properties

`public abstract string Fingerprint { get; }` [#](#property-fingerprint)

Stable provider-defined identity for the decoded program and selected instance. The value must change when rendering-relevant configuration, such as variable-font axes, changes.

`public abstract string? DisplayName { get; }` [#](#property-displayname)

Best available human-readable face name.

`public abstract int? CollectionIndex { get; }` [#](#property-collectionindex)

Selected collection face index, when the source is a font collection.

`public abstract int UnitsPerEm { get; }` [#](#property-unitsperem)

Font design units per em.

`public abstract bool IsOpenTypeCff { get; }` [#](#property-isopentypecff)

Whether the source uses CFF or CFF2 outlines.

`public abstract bool ProvidesComplexTextLayout { get; }` [#](#property-providescomplextextlayout)

Whether measurement and contours already apply complete script shaping and bidirectional layout.

`public abstract double LineSpacingRatio { get; }` [#](#property-linespacingratio)

Returns the face line-spacing ratio.

<!-- PowerForge markdown artifact sha256:E31C318225982E43123FDDDB4905FD186F55EF9480827D2F1F09D3B7AF0BC86A -->
