textmode.figlet.js 1.0.1 → 1.0.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -134
- package/dist/textmode.figlet.esm.js +1 -1
- package/dist/textmode.figlet.umd.js +1 -1
- package/dist/types/augmentations/index.d.ts +0 -1
- package/dist/types/augmentations/textmode.d.ts +28 -1
- package/dist/types/error/FigletError.d.ts +0 -1
- package/dist/types/extensions/index.d.ts +0 -1
- package/dist/types/extensions/textmodifier.d.ts +0 -1
- package/dist/types/figfont/FigFontParser.d.ts +0 -1
- package/dist/types/figfont/FigLayoutEngine.d.ts +0 -1
- package/dist/types/figfont/FigSmushRules.d.ts +0 -1
- package/dist/types/figfont/TextmodeFigFont.d.ts +30 -1
- package/dist/types/figfont/index.d.ts +0 -1
- package/dist/types/figfont/types.d.ts +193 -30
- package/dist/types/index.d.ts +40 -2
- package/dist/types/plugin/FigletPlugin.d.ts +4 -1
- package/dist/types/plugin/index.d.ts +0 -1
- package/dist/types/state/figletState.d.ts +0 -1
- package/dist/types/utils/Disposable.d.ts +0 -1
- package/package.json +84 -47
- package/dist/types/augmentations/index.d.ts.map +0 -1
- package/dist/types/augmentations/textmode.d.ts.map +0 -1
- package/dist/types/error/FigletError.d.ts.map +0 -1
- package/dist/types/extensions/index.d.ts.map +0 -1
- package/dist/types/extensions/textmodifier.d.ts.map +0 -1
- package/dist/types/figfont/FigFontParser.d.ts.map +0 -1
- package/dist/types/figfont/FigLayoutEngine.d.ts.map +0 -1
- package/dist/types/figfont/FigSmushRules.d.ts.map +0 -1
- package/dist/types/figfont/TextmodeFigFont.d.ts.map +0 -1
- package/dist/types/figfont/index.d.ts.map +0 -1
- package/dist/types/figfont/types.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/plugin/FigletPlugin.d.ts.map +0 -1
- package/dist/types/plugin/index.d.ts.map +0 -1
- package/dist/types/state/figletState.d.ts.map +0 -1
- package/dist/types/utils/Disposable.d.ts.map +0 -1
|
@@ -2,6 +2,10 @@ import { Disposable } from '../utils/Disposable';
|
|
|
2
2
|
import type { FigCharacter, FigFontHeader, FigHorizontalLayout, FigRenderPlan, FigTextOptions, FigTextResult, FigVerticalLayout } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Parsed FIGfont resource used by `figText()` rendering.
|
|
5
|
+
*
|
|
6
|
+
* @category FIGfont resources
|
|
7
|
+
*
|
|
8
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont | TextmodeFigFont API reference}
|
|
5
9
|
*/
|
|
6
10
|
export declare class TextmodeFigFont extends Disposable {
|
|
7
11
|
private readonly _name;
|
|
@@ -36,6 +40,8 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
36
40
|
*
|
|
37
41
|
* @example
|
|
38
42
|
* {@includeCode ../../examples/TextmodeFigFont/getCharacter/sketch.js}
|
|
43
|
+
*
|
|
44
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont/methods/getCharacter | TextmodeFigFont.getCharacter API reference}
|
|
39
45
|
*/
|
|
40
46
|
getCharacter(value: number | string): FigCharacter | undefined;
|
|
41
47
|
/**
|
|
@@ -43,6 +49,8 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
43
49
|
*
|
|
44
50
|
* @example
|
|
45
51
|
* {@includeCode ../../examples/TextmodeFigFont/planText/sketch.js}
|
|
52
|
+
*
|
|
53
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont/methods/planText | TextmodeFigFont.planText API reference}
|
|
46
54
|
*/
|
|
47
55
|
planText(text: string, options?: FigTextOptions): FigRenderPlan;
|
|
48
56
|
/**
|
|
@@ -50,6 +58,8 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
50
58
|
*
|
|
51
59
|
* @example
|
|
52
60
|
* {@includeCode ../../examples/TextmodeFigFont/renderText/sketch.js}
|
|
61
|
+
*
|
|
62
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont/methods/renderText | TextmodeFigFont.renderText API reference}
|
|
53
63
|
*/
|
|
54
64
|
renderText(text: string, options?: FigTextOptions): FigTextResult;
|
|
55
65
|
/**
|
|
@@ -57,6 +67,8 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
57
67
|
*
|
|
58
68
|
* @example
|
|
59
69
|
* {@includeCode ../../examples/TextmodeFigFont/measureText/sketch.js}
|
|
70
|
+
*
|
|
71
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont/methods/measureText | TextmodeFigFont.measureText API reference}
|
|
60
72
|
*/
|
|
61
73
|
measureText(text: string, options?: FigTextOptions): {
|
|
62
74
|
cols: number;
|
|
@@ -67,6 +79,8 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
67
79
|
*
|
|
68
80
|
* @example
|
|
69
81
|
* {@includeCode ../../examples/TextmodeFigFont/name/sketch.js}
|
|
82
|
+
*
|
|
83
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont/accessors/name | TextmodeFigFont.name API reference}
|
|
70
84
|
*/
|
|
71
85
|
get name(): string;
|
|
72
86
|
/**
|
|
@@ -74,6 +88,8 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
74
88
|
*
|
|
75
89
|
* @example
|
|
76
90
|
* {@includeCode ../../examples/TextmodeFigFont/header/sketch.js}
|
|
91
|
+
*
|
|
92
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont/accessors/header | TextmodeFigFont.header API reference}
|
|
77
93
|
*/
|
|
78
94
|
get header(): FigFontHeader;
|
|
79
95
|
/**
|
|
@@ -81,6 +97,8 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
81
97
|
*
|
|
82
98
|
* @example
|
|
83
99
|
* {@includeCode ../../examples/TextmodeFigFont/characters/sketch.js}
|
|
100
|
+
*
|
|
101
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont/accessors/characters | TextmodeFigFont.characters API reference}
|
|
84
102
|
*/
|
|
85
103
|
get characters(): Map<number, FigCharacter>;
|
|
86
104
|
/**
|
|
@@ -88,6 +106,8 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
88
106
|
*
|
|
89
107
|
* @example
|
|
90
108
|
* {@includeCode ../../examples/TextmodeFigFont/hardblank/sketch.js}
|
|
109
|
+
*
|
|
110
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont/accessors/hardblank | TextmodeFigFont.hardblank API reference}
|
|
91
111
|
*/
|
|
92
112
|
get hardblank(): string;
|
|
93
113
|
/**
|
|
@@ -95,6 +115,8 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
95
115
|
*
|
|
96
116
|
* @example
|
|
97
117
|
* {@includeCode ../../examples/TextmodeFigFont/height/sketch.js}
|
|
118
|
+
*
|
|
119
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont/accessors/height | TextmodeFigFont.height API reference}
|
|
98
120
|
*/
|
|
99
121
|
get height(): number;
|
|
100
122
|
/**
|
|
@@ -102,6 +124,8 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
102
124
|
*
|
|
103
125
|
* @example
|
|
104
126
|
* {@includeCode ../../examples/TextmodeFigFont/baseline/sketch.js}
|
|
127
|
+
*
|
|
128
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont/accessors/baseline | TextmodeFigFont.baseline API reference}
|
|
105
129
|
*/
|
|
106
130
|
get baseline(): number;
|
|
107
131
|
/**
|
|
@@ -109,6 +133,8 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
109
133
|
*
|
|
110
134
|
* @example
|
|
111
135
|
* {@includeCode ../../examples/TextmodeFigFont/defaultLayout/sketch.js}
|
|
136
|
+
*
|
|
137
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont/accessors/defaultLayout | TextmodeFigFont.defaultLayout API reference}
|
|
112
138
|
*/
|
|
113
139
|
get defaultLayout(): FigHorizontalLayout;
|
|
114
140
|
/**
|
|
@@ -116,6 +142,8 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
116
142
|
*
|
|
117
143
|
* @example
|
|
118
144
|
* {@includeCode ../../examples/TextmodeFigFont/defaultPrintDirection/sketch.js}
|
|
145
|
+
*
|
|
146
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont/accessors/defaultPrintDirection | TextmodeFigFont.defaultPrintDirection API reference}
|
|
119
147
|
*/
|
|
120
148
|
get defaultPrintDirection(): 'ltr' | 'rtl';
|
|
121
149
|
/**
|
|
@@ -123,6 +151,8 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
123
151
|
*
|
|
124
152
|
* @example
|
|
125
153
|
* {@includeCode ../../examples/TextmodeFigFont/defaultVerticalLayout/sketch.js}
|
|
154
|
+
*
|
|
155
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/classes/TextmodeFigFont/accessors/defaultVerticalLayout | TextmodeFigFont.defaultVerticalLayout API reference}
|
|
126
156
|
*/
|
|
127
157
|
get defaultVerticalLayout(): FigVerticalLayout;
|
|
128
158
|
private static _resolveName;
|
|
@@ -136,4 +166,3 @@ export declare class TextmodeFigFont extends Disposable {
|
|
|
136
166
|
private _tokenizeByWhitespace;
|
|
137
167
|
private _resolveDirection;
|
|
138
168
|
}
|
|
139
|
-
//# sourceMappingURL=TextmodeFigFont.d.ts.map
|
|
@@ -4,4 +4,3 @@ export { FigSmushRules } from './FigSmushRules';
|
|
|
4
4
|
export { TextmodeFigFont } from './TextmodeFigFont';
|
|
5
5
|
export type { FigCharacter, FigFontHeader, FigHorizontalLayout, FigPrintDirection, FigRenderCell, FigRenderLine, FigRenderPlan, FigTextAlign, FigTextBaseline, FigTextCellContext, FigTextColorResolver, FigTextColorValue, FigTextOptions, FigTextResult, FigVerticalLayout, FigWrapMode, ParsedFigFontData, } from './types';
|
|
6
6
|
export { FIGFONT_REQUIRED_CODEPOINTS } from './types';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -8,38 +8,98 @@ import type { color } from 'textmode.js';
|
|
|
8
8
|
export declare const FIGFONT_REQUIRED_CODEPOINTS: readonly number[];
|
|
9
9
|
/**
|
|
10
10
|
* Parsed FIGfont header metadata from the `.flf` header line.
|
|
11
|
+
*
|
|
12
|
+
* @category FIGfont resources
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigFontHeader | FigFontHeader API reference}
|
|
11
15
|
*/
|
|
12
16
|
export interface FigFontHeader {
|
|
13
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Always `flf2a` for supported FIGfont v2 files.
|
|
19
|
+
*
|
|
20
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigFontHeader#signature | FigFontHeader.signature API reference}
|
|
21
|
+
*/
|
|
14
22
|
signature: string;
|
|
15
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Hardblank character used by the font.
|
|
25
|
+
*
|
|
26
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigFontHeader#hardblank | FigFontHeader.hardblank API reference}
|
|
27
|
+
*/
|
|
16
28
|
hardblank: string;
|
|
17
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Number of rows in every FIGcharacter.
|
|
31
|
+
*
|
|
32
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigFontHeader#height | FigFontHeader.height API reference}
|
|
33
|
+
*/
|
|
18
34
|
height: number;
|
|
19
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Baseline row reported by the font.
|
|
37
|
+
*
|
|
38
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigFontHeader#baseline | FigFontHeader.baseline API reference}
|
|
39
|
+
*/
|
|
20
40
|
baseline: number;
|
|
21
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Maximum line length declared by the font.
|
|
43
|
+
*
|
|
44
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigFontHeader#maxlength | FigFontHeader.maxLength API reference}
|
|
45
|
+
*/
|
|
22
46
|
maxLength: number;
|
|
23
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Legacy horizontal layout bitfield.
|
|
49
|
+
*
|
|
50
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigFontHeader#oldlayout | FigFontHeader.oldLayout API reference}
|
|
51
|
+
*/
|
|
24
52
|
oldLayout: number;
|
|
25
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Number of comment lines immediately following the header.
|
|
55
|
+
*
|
|
56
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigFontHeader#commentlines | FigFontHeader.commentLines API reference}
|
|
57
|
+
*/
|
|
26
58
|
commentLines: number;
|
|
27
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Font print direction: `0` left-to-right, `1` right-to-left.
|
|
61
|
+
*
|
|
62
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigFontHeader#printdirection | FigFontHeader.printDirection API reference}
|
|
63
|
+
*/
|
|
28
64
|
printDirection: number;
|
|
29
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Full FIGfont layout flags when present.
|
|
67
|
+
*
|
|
68
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigFontHeader#fulllayout | FigFontHeader.fullLayout API reference}
|
|
69
|
+
*/
|
|
30
70
|
fullLayout: number;
|
|
31
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* Number of code-tagged characters declared by the font.
|
|
73
|
+
*
|
|
74
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigFontHeader#codetagcount | FigFontHeader.codetagCount API reference}
|
|
75
|
+
*/
|
|
32
76
|
codetagCount: number;
|
|
33
77
|
}
|
|
34
78
|
/**
|
|
35
79
|
* A single parsed FIGcharacter from a FIGfont.
|
|
80
|
+
*
|
|
81
|
+
* @category FIGfont resources
|
|
82
|
+
*
|
|
83
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigCharacter | FigCharacter API reference}
|
|
36
84
|
*/
|
|
37
85
|
export interface FigCharacter {
|
|
38
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* Unicode code point represented by the FIGcharacter.
|
|
88
|
+
*
|
|
89
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigCharacter#code | FigCharacter.code API reference}
|
|
90
|
+
*/
|
|
39
91
|
code: number;
|
|
40
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* Raw FIGcharacter rows with endmarks removed.
|
|
94
|
+
*
|
|
95
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigCharacter#lines | FigCharacter.lines API reference}
|
|
96
|
+
*/
|
|
41
97
|
lines: string[];
|
|
42
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* Maximum row width after endmark removal.
|
|
100
|
+
*
|
|
101
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigCharacter#width | FigCharacter.width API reference}
|
|
102
|
+
*/
|
|
43
103
|
width: number;
|
|
44
104
|
}
|
|
45
105
|
/**
|
|
@@ -53,68 +113,164 @@ export interface ParsedFigFontData {
|
|
|
53
113
|
}
|
|
54
114
|
/**
|
|
55
115
|
* Supported horizontal layout modes for FIGlet rendering.
|
|
116
|
+
*
|
|
117
|
+
* @category Layout and rendering
|
|
118
|
+
*
|
|
119
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/type-aliases/FigHorizontalLayout | FigHorizontalLayout API reference}
|
|
56
120
|
*/
|
|
57
121
|
export type FigHorizontalLayout = 'full' | 'fitted' | 'smushed';
|
|
58
122
|
/**
|
|
59
123
|
* Supported vertical layout modes for multi-line FIGlet rendering.
|
|
124
|
+
*
|
|
125
|
+
* @category Layout and rendering
|
|
126
|
+
*
|
|
127
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/type-aliases/FigVerticalLayout | FigVerticalLayout API reference}
|
|
60
128
|
*/
|
|
61
129
|
export type FigVerticalLayout = 'full' | 'fitted' | 'smushed';
|
|
62
130
|
/**
|
|
63
131
|
* Supported wrap modes for FIGlet text layout.
|
|
132
|
+
*
|
|
133
|
+
* @category Layout and rendering
|
|
134
|
+
*
|
|
135
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/type-aliases/FigWrapMode | FigWrapMode API reference}
|
|
64
136
|
*/
|
|
65
137
|
export type FigWrapMode = 'none' | 'word' | 'char';
|
|
66
138
|
/**
|
|
67
139
|
* Supported print directions for FIGlet text layout.
|
|
140
|
+
*
|
|
141
|
+
* @category Layout and rendering
|
|
142
|
+
*
|
|
143
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/type-aliases/FigPrintDirection | FigPrintDirection API reference}
|
|
68
144
|
*/
|
|
69
145
|
export type FigPrintDirection = 'font' | 'ltr' | 'rtl';
|
|
70
146
|
/**
|
|
71
147
|
* Accepted color input for per-cell FIGlet styling.
|
|
148
|
+
*
|
|
149
|
+
* @category Styling
|
|
150
|
+
*
|
|
151
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/type-aliases/FigTextColorValue | FigTextColorValue API reference}
|
|
72
152
|
*/
|
|
73
153
|
export type FigTextColorValue = number | string | color.TextmodeColor | [number, number, number] | [number, number, number, number];
|
|
74
154
|
/**
|
|
75
155
|
* Public cell metadata exposed to FIGlet styling callbacks.
|
|
156
|
+
*
|
|
157
|
+
* @category Styling
|
|
158
|
+
*
|
|
159
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextCellContext | FigTextCellContext API reference}
|
|
76
160
|
*/
|
|
77
161
|
export interface FigTextCellContext {
|
|
78
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* Final drawable sub-character after layout normalization.
|
|
164
|
+
*
|
|
165
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextCellContext#char | FigTextCellContext.char API reference}
|
|
166
|
+
*/
|
|
79
167
|
char: string;
|
|
80
|
-
/**
|
|
168
|
+
/**
|
|
169
|
+
* Absolute column within the rendered result.
|
|
170
|
+
*
|
|
171
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextCellContext#col | FigTextCellContext.col API reference}
|
|
172
|
+
*/
|
|
81
173
|
col: number;
|
|
82
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* Absolute row within the rendered result.
|
|
176
|
+
*
|
|
177
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextCellContext#row | FigTextCellContext.row API reference}
|
|
178
|
+
*/
|
|
83
179
|
row: number;
|
|
84
|
-
/**
|
|
180
|
+
/**
|
|
181
|
+
* Zero-based index into the original input string's character sequence.
|
|
182
|
+
*
|
|
183
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextCellContext#inputindex | FigTextCellContext.inputIndex API reference}
|
|
184
|
+
*/
|
|
85
185
|
inputIndex: number;
|
|
86
|
-
/**
|
|
186
|
+
/**
|
|
187
|
+
* Original input character that produced this cell.
|
|
188
|
+
*
|
|
189
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextCellContext#inputchar | FigTextCellContext.inputChar API reference}
|
|
190
|
+
*/
|
|
87
191
|
inputChar: string;
|
|
88
|
-
/**
|
|
192
|
+
/**
|
|
193
|
+
* FIGcharacter code used to produce this cell.
|
|
194
|
+
*
|
|
195
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextCellContext#figcharcode | FigTextCellContext.figCharCode API reference}
|
|
196
|
+
*/
|
|
89
197
|
figCharCode: number;
|
|
90
|
-
/**
|
|
198
|
+
/**
|
|
199
|
+
* Row within the source FIGcharacter.
|
|
200
|
+
*
|
|
201
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextCellContext#subrow | FigTextCellContext.subRow API reference}
|
|
202
|
+
*/
|
|
91
203
|
subRow: number;
|
|
92
|
-
/**
|
|
204
|
+
/**
|
|
205
|
+
* Column within the source FIGcharacter.
|
|
206
|
+
*
|
|
207
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextCellContext#subcol | FigTextCellContext.subCol API reference}
|
|
208
|
+
*/
|
|
93
209
|
subCol: number;
|
|
94
|
-
/**
|
|
210
|
+
/**
|
|
211
|
+
* Logical rendered line index after explicit newline splitting.
|
|
212
|
+
*
|
|
213
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextCellContext#lineindex | FigTextCellContext.lineIndex API reference}
|
|
214
|
+
*/
|
|
95
215
|
lineIndex: number;
|
|
96
216
|
}
|
|
97
217
|
/**
|
|
98
218
|
* Resolver for per-cell FIGlet colors.
|
|
219
|
+
*
|
|
220
|
+
* @category Styling
|
|
221
|
+
*
|
|
222
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/type-aliases/FigTextColorResolver | FigTextColorResolver API reference}
|
|
99
223
|
*/
|
|
100
224
|
export type FigTextColorResolver = FigTextColorValue | ((cell: FigTextCellContext) => FigTextColorValue | undefined);
|
|
101
225
|
/**
|
|
102
226
|
* Layout options for rendering FIGlet text.
|
|
227
|
+
*
|
|
228
|
+
* @category Layout and rendering
|
|
229
|
+
*
|
|
230
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextOptions | FigTextOptions API reference}
|
|
103
231
|
*/
|
|
104
232
|
export interface FigTextOptions {
|
|
105
|
-
/**
|
|
233
|
+
/**
|
|
234
|
+
* Override the font's default horizontal layout.
|
|
235
|
+
*
|
|
236
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextOptions#horizontallayout | FigTextOptions.horizontalLayout API reference}
|
|
237
|
+
*/
|
|
106
238
|
horizontalLayout?: FigHorizontalLayout;
|
|
107
|
-
/**
|
|
239
|
+
/**
|
|
240
|
+
* Override the vertical composition mode for multi-line FIGlet layout.
|
|
241
|
+
*
|
|
242
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextOptions#verticallayout | FigTextOptions.verticalLayout API reference}
|
|
243
|
+
*/
|
|
108
244
|
verticalLayout?: FigVerticalLayout;
|
|
109
|
-
/**
|
|
245
|
+
/**
|
|
246
|
+
* Override the effective print direction for layout.
|
|
247
|
+
*
|
|
248
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextOptions#direction | FigTextOptions.direction API reference}
|
|
249
|
+
*/
|
|
110
250
|
direction?: FigPrintDirection;
|
|
111
|
-
/**
|
|
251
|
+
/**
|
|
252
|
+
* Optional wrap strategy for multi-line layout.
|
|
253
|
+
*
|
|
254
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextOptions#wrap | FigTextOptions.wrap API reference}
|
|
255
|
+
*/
|
|
112
256
|
wrap?: FigWrapMode;
|
|
113
|
-
/**
|
|
257
|
+
/**
|
|
258
|
+
* Maximum rendered columns per logical line before wrapping occurs.
|
|
259
|
+
*
|
|
260
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextOptions#maxcols | FigTextOptions.maxCols API reference}
|
|
261
|
+
*/
|
|
114
262
|
maxCols?: number;
|
|
115
|
-
/**
|
|
263
|
+
/**
|
|
264
|
+
* Override or resolve the foreground color for each rendered FIGlet cell.
|
|
265
|
+
*
|
|
266
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextOptions#charcolor | FigTextOptions.charColor API reference}
|
|
267
|
+
*/
|
|
116
268
|
charColor?: FigTextColorResolver;
|
|
117
|
-
/**
|
|
269
|
+
/**
|
|
270
|
+
* Override or resolve the background color for each rendered FIGlet cell.
|
|
271
|
+
*
|
|
272
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/interfaces/FigTextOptions#cellcolor | FigTextOptions.cellColor API reference}
|
|
273
|
+
*/
|
|
118
274
|
cellColor?: FigTextColorResolver;
|
|
119
275
|
}
|
|
120
276
|
/**
|
|
@@ -170,10 +326,17 @@ export interface FigTextResult {
|
|
|
170
326
|
}
|
|
171
327
|
/**
|
|
172
328
|
* Horizontal alignment options for `figText()` placement.
|
|
329
|
+
*
|
|
330
|
+
* @category Layout and rendering
|
|
331
|
+
*
|
|
332
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/type-aliases/FigTextAlign | FigTextAlign API reference}
|
|
173
333
|
*/
|
|
174
334
|
export type FigTextAlign = 'left' | 'center' | 'right';
|
|
175
335
|
/**
|
|
176
336
|
* Vertical alignment options for `figText()` placement.
|
|
337
|
+
*
|
|
338
|
+
* @category Layout and rendering
|
|
339
|
+
*
|
|
340
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/type-aliases/FigTextBaseline | FigTextBaseline API reference}
|
|
177
341
|
*/
|
|
178
342
|
export type FigTextBaseline = 'top' | 'center' | 'bottom' | 'baseline';
|
|
179
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* Add FIGlet display typography to a textmode.js sketch.
|
|
5
|
+
*
|
|
6
|
+
* Install {@link FigletPlugin} to add FIGfont loading, selection, drawing, and
|
|
7
|
+
* measurement helpers to the sketch's `Textmodifier`. Use
|
|
8
|
+
* {@link TextmodeFigFont} when you need to inspect a parsed font, plan its
|
|
9
|
+
* layout, or render it without drawing to the canvas.
|
|
10
|
+
*
|
|
11
|
+
* ## Sketch workflow
|
|
12
|
+
*
|
|
13
|
+
* 1. Add {@link FigletPlugin} to the sketch's plugins.
|
|
14
|
+
* 2. Load a `.flf` file with {@link TextmodifierFigletExtensions.loadFigFont}
|
|
15
|
+
* or parse raw font data with {@link TextmodifierFigletExtensions.parseFigFont}.
|
|
16
|
+
* 3. Select the returned font with {@link TextmodifierFigletExtensions.figFont}.
|
|
17
|
+
* 4. Draw with {@link TextmodifierFigletExtensions.figText}, or measure first
|
|
18
|
+
* with its width, height, and bounds helpers.
|
|
19
|
+
*
|
|
20
|
+
* {@link FigTextOptions} controls layout, wrapping, direction, and per-cell
|
|
21
|
+
* colors. Use {@link TextmodeFigFont} for reusable FIGfont resources and
|
|
22
|
+
* lower-level planning.
|
|
23
|
+
*
|
|
24
|
+
* @categoryDescription FIGfont resources
|
|
25
|
+
* Parsed FIGfont resources and metadata for inspecting characters and
|
|
26
|
+
* font-defined defaults.
|
|
27
|
+
*
|
|
28
|
+
* @categoryDescription Layout and rendering
|
|
29
|
+
* Options and value types that control FIGlet composition, wrapping,
|
|
30
|
+
* direction, and placement.
|
|
31
|
+
*
|
|
32
|
+
* @categoryDescription Styling
|
|
33
|
+
* Per-cell color values and callback context for styling rendered FIGlet text.
|
|
34
|
+
*
|
|
35
|
+
* @categoryDescription Textmodifier extensions
|
|
36
|
+
* Methods that {@link FigletPlugin} adds to a textmode.js sketch.
|
|
37
|
+
*
|
|
38
|
+
* @categoryDescription Workflow
|
|
39
|
+
* The plugin entrypoint that enables the FIGlet sketch workflow.
|
|
40
|
+
*
|
|
41
|
+
* @showCategories
|
|
3
42
|
*/
|
|
4
43
|
import './augmentations';
|
|
5
44
|
export { FigletPlugin } from './plugin';
|
|
6
45
|
export type { TextmodifierFigletExtensions } from './augmentations';
|
|
7
46
|
export * from './figfont';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -2,8 +2,11 @@ import type { TextmodePlugin } from 'textmode.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Plugin entrypoint for the FIGlet add-on.
|
|
4
4
|
*
|
|
5
|
+
* @category Workflow
|
|
6
|
+
*
|
|
5
7
|
* @example
|
|
6
8
|
* {@includeCode ../../examples/FigletPlugin/init/sketch.js}
|
|
9
|
+
*
|
|
10
|
+
* @see {@link https://code.textmode.art/api/textmode.figlet.js/variables/FigletPlugin | FigletPlugin API reference}
|
|
7
11
|
*/
|
|
8
12
|
export declare const FigletPlugin: TextmodePlugin;
|
|
9
|
-
//# sourceMappingURL=FigletPlugin.d.ts.map
|