Table of Contents

ShxFont

from OpenCAD2D import ShxFont

class ShxFont(System.Object) ยท ShxFont in the .NET reference

A compiled SHX font read from the bytes of its file, of the three forms AutoCAD writes (ShxFontKind), its letters drawn by their pen codes into strokes as AutoCAD draws them: romans.shx's capitals reach ShxFont.Above 21 units above the baseline, so that a text 2.5 high draws them at 2.5 / 21 of a millimetre to the unit.

Properties and fields

Above

.NET

@property
def Above(self) -> float

Gets how far the capitals reach above the baseline in the font's units, the height of a text: 6 for txt.shx, 21 for romans.shx.

Below

.NET

@property
def Below(self) -> float

Gets how far the letters reach below the baseline in the font's units: 2 for txt.shx, 7 for romans.shx.

Count

.NET

@property
def Count(self) -> int

Gets the number of letters and shapes the font holds, shape 0 left out.

Kind

.NET

@property
def Kind(self) -> ShxFontKind

Gets the form of the file.

Methods

GlyphOf

.NET

def GlyphOf(self, number: int) -> ShxGlyph

Gets a letter of the font drawn into its strokes, drawn once and kept; null where the font has none of that number.

Has

.NET

def Has(self, number: int) -> bool

Gets whether the font has a letter or shape of a number: a byte in a font of shapes, a Unicode number in a unifont, two bytes in a big font.

Opens

.NET

def Opens(self, lead: int) -> bool

Gets whether a byte opens a letter of two bytes in a big font, by its ranges: 0xD6 in gbcbig.shx; false in a font of another form.

Read

.NET

@staticmethod
def Read(bytes: Sequence[int] | System.Array[int]) -> ShxFont

Reads a font from the bytes of a compiled SHX file; null where they are no font of the forms of ShxFontKind, are cut short, or give a font of letters no height above its baseline.