Class: Glyph#

Glyph object

see online docs: https://font.tomchen.org/bdfparser_js/glyph

Hierarchy#

  • Glyph

Constructors#

constructor#

+ new Glyph(meta_obj: GlyphMeta, font: Font): Glyph

Glyph object constructor

see online docs: https://font.tomchen.org/bdfparser_js/glyph

Parameters:#

NameTypeDescription
meta_objGlyphMetaMeta information
fontFontThe font the glyph belongs to

Returns: Glyph

Defined in: bdfparser.ts:970

Properties#

font#

• font: Font

Defined in: bdfparser.ts:970


meta#

• meta: GlyphMeta

Defined in: bdfparser.ts:969

Methods#

__draw_bb#

â–¸ Private__draw_bb(): Bitmap

Returns: Bitmap

Defined in: bdfparser.ts:1097


__draw_fbb#

â–¸ Private__draw_fbb(): Bitmap

Returns: Bitmap

Defined in: bdfparser.ts:1114


__draw_original#

â–¸ Private__draw_original(): Bitmap

Returns: Bitmap

Defined in: bdfparser.ts:1085


__draw_user_specified#

â–¸ Private__draw_user_specified(fbb: [number, number, number, number]): Bitmap

Parameters:#

NameType
fbb[number, number, number, number]

Returns: Bitmap

Defined in: bdfparser.ts:1077


chr#

â–¸ chr(): string

Get the character of the glyph.

see online docs: https://font.tomchen.org/bdfparser_js/glyph#chr

Returns: string

Character (one character string) of the glyph

Defined in: bdfparser.ts:1033


cp#

â–¸ cp(): number

Get the codepoint of the glyph.

see online docs: https://font.tomchen.org/bdfparser_js/glyph#cp

Returns: number

Codepoint of the glyph

Defined in: bdfparser.ts:1022


draw#

â–¸ draw(mode?: null | 0 | 1 | -1 | 2, bb?: null | [number, number, number, number]): Bitmap

Draw the glyph to a Bitmap object.

see online docs: https://font.tomchen.org/bdfparser_js/glyph#draw

Parameters:#

NameTypeDescription
mode?null | 0 | 1 | -1 | 2Mode
bb?null | [number, number, number, number]Bounding box

Returns: Bitmap

Bitmap object

Defined in: bdfparser.ts:1047


origin#

â–¸ origin(options?: { fromorigin?: undefined | null | boolean ; mode?: undefined | null | 0 | 1 | -1 | 2 ; xoff?: undefined | null | number ; yoff?: undefined | null | number }): [number, number]

Get the relative position (displacement) of the origin from the left bottom corner of the bitmap drawn by the method .draw(), or vice versa.

see online docs: https://font.tomchen.org/bdfparser_js/glyph#origin

Parameters:#

NameTypeDefault value
options{ fromorigin?: undefined | null | boolean ; mode?: undefined | null | 0 | 1 | -1 | 2 ; xoff?: undefined | null | number ; yoff?: undefined | null | number }...

Returns: [number, number]

The relative position (displacement) represented by [x, y] array / tuple (where right and top directions are positive)

Defined in: bdfparser.ts:1139


repr#

â–¸ repr(): string

Gets a programmer-readable string representation of the Glyph object.

see online docs: https://font.tomchen.org/bdfparser_js/glyph#repr

Returns: string

String representation

Defined in: bdfparser.ts:1003


toString#

â–¸ toString(): string

Gets a human-readable (multi-line) string representation of the Glyph object.

see online docs: https://font.tomchen.org/bdfparser_js/glyph#tostring

Returns: string

String representation

Defined in: bdfparser.ts:992