Module for spacing text output (in Arial font) to optimize formatting of admin instructions to copy and paste to Epic.
Members
(inner, constant) charWidths :Object
Width in px of characters in Arial font at 14.66667px (11pt)
Methods
(static) padArray(rows, extraopt) → {Array.<string>}
Pads each member of an array with sufficient nonbreaking spaces to make them all the same width in 11 pt Arial font.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
rows |
Array.<string> |
Strings to be padded to the same width |
||
extra |
number |
<optional> |
4 |
Number of extra spaces to pad longest string with |
(static) underline(str, charopt, extraopt) → {String}
Returns a divider the length of a given string.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
str |
String |
The string to be underlined |
||
char |
String |
<optional> |
"-" |
The character to use as the divider |
extra |
Number |
<optional> |
0 |
Number of extra characters to add beyond the length of the string |
(inner) getWidth(str) → {number}
Get the width of a character or string in pixels (11pt Arial font)
Parameters:
Name | Type | Description |
---|---|---|
str |
string |
string you want the width of |
Throws:
Will log an error to the console if no width is defined for a character