domino-richtext Reference
This page describes the @domino/richtext API. To navigate between sections, use the table of contents on the right.
BidiTextRun Class
BidiTextRun
appears in paragraphs where right-to-left appearance of text is
indicated. It is identical to [TextRun
][#textrun-class] except for the signature.
constructor
Parameters
options
{Object
}:
text
{string
}: Textual data.fontId
{number
}: 32-bit unsigned integer that represents the font characteristics associated with this text run (see FontIdFields).maxTextSize
{number}: An optional value between 16k (default) and 64k that controls the maximum size of a text run. It is recommended to use the default when creating rich text documents as this is considered an optimal value by the Notes editor, but there may be existing documents that exceed this limit.
Properties
SIGNATURE
static, read-only {number}: Constant value that represents the signature of this rich text record.text
read-write {string
}: The text represented by this text run. Note that this text is translated to LMBCS when this text run is written to a RichTextField.fontId
read-write {number
}: The fontId associated with this text run.fontIdFields
read-only {FontIdFields
}: FontIdFields object that corresponds to the fontId associated with this TextRun.
Color Namespace
This namespace is a collection of constants used when working with color-related properties.
colors
The color
property is a set of commonly-used indices into the color table.
colors
{Object}:
- NOTES_COLOR_BLACK
- NOTES_COLOR_WHITE
- NOTES_COLOR_RED
- NOTES_COLOR_GREEN
- NOTES_COLOR_BLUE
- NOTES_COLOR_MAGENTA
- NOTES_COLOR_YELLOW
- NOTES_COLOR_CYAN
- NOTES_COLOR_DKRED
- NOTES_COLOR_DKGREEN
- NOTES_COLOR_DKBLUE
- NOTES_COLOR_DKMAGENTA
- NOTES_COLOR_DKYELLOW
- NOTES_COLOR_DKCYAN
- NOTES_COLOR_GRAY
- NOTES_COLOR_LTGRAY
colorTable
The colortable
property is an array of color names and associated rgb values
used by the Notes client.
{ name: 'Black', red: 0x00, blue: 0x00, green: 0x00 },
{ name: 'White', red: 0xff, blue: 0xff, green: 0xff },
{ name: 'Red', red: 0xff, blue: 0x00, green: 0x00 },
{ name: 'Green', red: 0x00, blue: 0x00, green: 0xff },
{ name: 'Blue', red: 0x00, blue: 0xff, green: 0x00 },
{ name: 'Magenta', red: 0xff, blue: 0x00, green: 0xff },
{ name: 'Yellow', red: 0xff, blue: 0xff, green: 0x00 },
{ name: 'Cyan', red: 0x00, blue: 0xff, green: 0xff },
{ name: 'DarkRed', red: 0x80, blue: 0x00, green: 0x00 },
{ name: 'DarkGreen', red: 0x00, blue: 0x80, green: 0x00 },
{ name: 'DarkBlue', red: 0x00, blue: 0x00, green: 0x80 },
{ name: 'DarkMagenta', red: 0x80, blue: 0x00, green: 0x80 },
{ name: 'DarkYellow', red: 0x80, blue: 0x80, green: 0x00 },
{ name: 'DarkCyan', red: 0x00, blue: 0x80, green: 0x80 },
{ name: 'Gray', red: 0x80, blue: 0x80, green: 0x80 },
{ name: 'LightGray', red: 0xc0, blue: 0xc0, green: 0xc0 },
{ name: 'White', red: 0xff, blue: 0xff, green: 0xff },
{ name: 'Vanilla', red: 0xff, blue: 0xef, green: 0xce },
{ name: 'Parchment', red: 0xff, blue: 0xff, green: 0xc2 },
{ name: 'Ivory', red: 0xff, blue: 0xff, green: 0xd0 },
{ name: 'PaleGreen', red: 0xe0, blue: 0xff, green: 0xbf },
{ name: 'SeaMist', red: 0xe0, blue: 0xff, green: 0xdf },
{ name: 'IceBlue', red: 0xe0, blue: 0xff, green: 0xff },
{ name: 'PowderBlue', red: 0xc2, blue: 0xef, green: 0xff },
{ name: 'ArcticBlue', red: 0xe0, blue: 0xf1, green: 0xff },
{ name: 'LilacMist', red: 0xe0, blue: 0xe0, green: 0xff },
{ name: 'PurpleWash', red: 0xe8, blue: 0xe0, green: 0xff },
{ name: 'VioletFrost', red: 0xf1, blue: 0xe0, green: 0xff },
{ name: 'Seashell', red: 0xff, blue: 0xe0, green: 0xff },
{ name: 'RosePearl', red: 0xff, blue: 0xe0, green: 0xf5 },
{ name: 'PaleCherry', red: 0xff, blue: 0xe0, green: 0xe6 },
{ name: 'White', red: 0xff, blue: 0xff, green: 0xff },
{ name: 'Blush', red: 0xff, blue: 0xe1, green: 0xdc },
{ name: 'Sand', red: 0xff, blue: 0xe1, green: 0xb0 },
{ name: 'LightYellow', red: 0xff, blue: 0xff, green: 0x80 },
{ name: 'Honeydew', red: 0xf1, blue: 0xf1, green: 0xb4 },
{ name: 'Celery', red: 0xc2, blue: 0xff, green: 0x91 },
{ name: 'PaleAqua', red: 0xc1, blue: 0xff, green: 0xd5 },
{ name: 'PaleBlue', red: 0xc1, blue: 0xff, green: 0xff },
{ name: 'CrystalBlue', red: 0xa1, blue: 0xe2, green: 0xff },
{ name: 'LightCornflower', red: 0xc0, blue: 0xe1, green: 0xff },
{ name: 'PaleLavender', red: 0xbf, blue: 0xbf, green: 0xff },
{ name: 'GrapeFizz', red: 0xd2, blue: 0xbf, green: 0xff },
{ name: 'PalePlum', red: 0xe1, blue: 0xbf, green: 0xff },
{ name: 'PalePink', red: 0xff, blue: 0xc1, green: 0xfd },
{ name: 'PaleRose', red: 0xff, blue: 0xc0, green: 0xe4 },
{ name: 'RoseQuartz', red: 0xff, blue: 0xc0, green: 0xce },
{ name: 'Gray5', red: 0xf7, blue: 0xf7, green: 0xf7 },
{ name: 'RedSand', red: 0xff, blue: 0xc0, green: 0xb6 },
{ name: 'Buff', red: 0xff, blue: 0xc2, green: 0x81 },
{ name: 'Lemon', red: 0xff, blue: 0xff, green: 0x35 },
{ name: 'PaleLemonLime', red: 0xf1, blue: 0xf1, green: 0x80 },
{ name: 'MintGreen', red: 0x80, blue: 0xff, green: 0x80 },
{ name: 'PastelGreen', red: 0x82, blue: 0xff, green: 0xca },
{ name: 'PastelBlue', red: 0x80, blue: 0xff, green: 0xff },
{ name: 'Sapphire', red: 0x82, blue: 0xe0, green: 0xff },
{ name: 'Cornflower', red: 0x82, blue: 0xc0, green: 0xff },
{ name: 'LightLavender', red: 0x9f, blue: 0x9f, green: 0xff },
{ name: 'PalePurple', red: 0xc2, blue: 0x9f, green: 0xff },
{ name: 'LightOrchid', red: 0xe2, blue: 0x9f, green: 0xff },
{ name: 'PinkOrchid', red: 0xff, blue: 0x9f, green: 0xff },
{ name: 'AppleBlossom', red: 0xff, blue: 0x9f, green: 0xcf },
{ name: 'PinkCoral', red: 0xff, blue: 0x9f, green: 0xa9 },
{ name: 'Gray10', red: 0xef, blue: 0xef, green: 0xef },
{ name: 'LightSalmon', red: 0xff, blue: 0x9f, green: 0x9f },
{ name: 'LightPeach', red: 0xff, blue: 0x9f, green: 0x71 },
{ name: 'Yellow', red: 0xff, blue: 0xff, green: 0x00 },
{ name: 'Avocado', red: 0xe0, blue: 0xe0, green: 0x74 },
{ name: 'LeafGreen', red: 0x41, blue: 0xff, green: 0x32 },
{ name: 'LightAqua', red: 0x42, blue: 0xff, green: 0xc7 },
{ name: 'LightTurquoise', red: 0x42, blue: 0xff, green: 0xff },
{ name: 'LightCerulean', red: 0x00, blue: 0xbf, green: 0xff },
{ name: 'Azure', red: 0x52, blue: 0x91, green: 0xef },
{ name: 'Lavender', red: 0x80, blue: 0x80, green: 0xff },
{ name: 'LightPurple', red: 0xc0, blue: 0x82, green: 0xff },
{ name: 'DustyViolet', red: 0xe0, blue: 0x81, green: 0xff },
{ name: 'Pink', red: 0xff, blue: 0x7f, green: 0xff },
{ name: 'PastelPink', red: 0xff, blue: 0x82, green: 0xc2 },
{ name: 'PastelRed', red: 0xff, blue: 0x82, green: 0xa0 },
{ name: 'Gray15', red: 0xe1, blue: 0xe1, green: 0xe1 },
{ name: 'Salmon', red: 0xff, blue: 0x80, green: 0x80 },
{ name: 'Peach', red: 0xff, blue: 0x81, green: 0x41 },
{ name: 'Mustard', red: 0xff, blue: 0xe1, green: 0x18 },
{ name: 'LemonLime', red: 0xe1, blue: 0xe1, green: 0x40 },
{ name: 'NeonGreen', red: 0x00, blue: 0xff, green: 0x00 },
{ name: 'Aqua', red: 0x00, blue: 0xff, green: 0xb2 },
{ name: 'Turquoise', red: 0x00, blue: 0xff, green: 0xff },
{ name: 'Cerulean', red: 0x00, blue: 0xa1, green: 0xe0 },
{ name: 'Wedgewood', red: 0x21, blue: 0x81, green: 0xff },
{ name: 'Heather', red: 0x61, blue: 0x81, green: 0xff },
{ name: 'PurpleHaze', red: 0xa1, blue: 0x60, green: 0xff },
{ name: 'Orchid', red: 0xc0, blue: 0x62, green: 0xff },
{ name: 'Flamingo', red: 0xff, blue: 0x5f, green: 0xff },
{ name: 'CherryPink', red: 0xff, blue: 0x60, green: 0xaf },
{ name: 'RedCoral', red: 0xff, blue: 0x60, green: 0x88 },
{ name: 'Gray20', red: 0xd2, blue: 0xd2, green: 0xd2 },
{ name: 'DarkSalmon', red: 0xff, blue: 0x40, green: 0x40 },
{ name: 'DarkPeach', red: 0xff, blue: 0x42, green: 0x1e },
{ name: 'Gold', red: 0xff, blue: 0xbf, green: 0x18 },
{ name: 'YellowGreen', red: 0xe1, blue: 0xe1, green: 0x00 },
{ name: 'LightGreen', red: 0x00, blue: 0xe1, green: 0x00 },
{ name: 'Caribbean', red: 0x00, blue: 0xe1, green: 0xad },
{ name: 'DarkPastelBlue', red: 0x00, blue: 0xe0, green: 0xe0 },
{ name: 'DarkCerulean', red: 0x00, blue: 0x82, green: 0xbf },
{ name: 'ManganeseBlue', red: 0x00, blue: 0x80, green: 0xff },
{ name: 'Lilac', red: 0x41, blue: 0x81, green: 0xff },
{ name: 'Purple', red: 0x82, blue: 0x42, green: 0xff },
{ name: 'LightRedViolet', red: 0xc1, blue: 0x40, green: 0xff },
{ name: 'LightMagenta', red: 0xff, blue: 0x42, green: 0xf9 },
{ name: 'Rose', red: 0xff, blue: 0x40, green: 0xa0 },
{ name: 'CarnationPink', red: 0xff, blue: 0x40, green: 0x70 },
{ name: 'Gray25', red: 0xc0, blue: 0xc0, green: 0xc0 },
{ name: 'Watermelon', red: 0xff, blue: 0x1f, green: 0x35 },
{ name: 'Tangerine', red: 0xff, blue: 0x1f, green: 0x10 },
{ name: 'Orange', red: 0xff, blue: 0x81, green: 0x00 },
{ name: 'Chartreuse', red: 0xbf, blue: 0xbf, green: 0x00 },
{ name: 'Green', red: 0x00, blue: 0xc2, green: 0x00 },
{ name: 'Teal', red: 0x00, blue: 0xc1, green: 0x96 },
{ name: 'DarkTurquoise', red: 0x00, blue: 0xc1, green: 0xc2 },
{ name: 'LightSlateBlue', red: 0x41, blue: 0x81, green: 0xc0 },
{ name: 'MediumBlue', red: 0x00, blue: 0x62, green: 0xe1 },
{ name: 'DarkLilac', red: 0x41, blue: 0x41, green: 0xff },
{ name: 'RoyalPurple', red: 0x42, blue: 0x00, green: 0xff },
{ name: 'Fuchsia', red: 0xc2, blue: 0x00, green: 0xff },
{ name: 'ConfettiPink', red: 0xff, blue: 0x22, green: 0xff },
{ name: 'PaleBurgundy', red: 0xf5, blue: 0x2b, green: 0x97 },
{ name: 'Strawberry', red: 0xff, blue: 0x22, green: 0x59 },
{ name: 'Gray30', red: 0xb2, blue: 0xb2, green: 0xb2 },
{ name: 'Rouge', red: 0xe0, blue: 0x1f, green: 0x25 },
{ name: 'BurntOrange', red: 0xe1, blue: 0x20, green: 0x00 },
{ name: 'DarkOrange', red: 0xe2, blue: 0x62, green: 0x00 },
{ name: 'LightOlive', red: 0xa1, blue: 0xa1, green: 0x00 },
{ name: 'KellyGreen', red: 0x00, blue: 0xa0, green: 0x00 },
{ name: 'SeaGreen', red: 0x00, blue: 0x9f, green: 0x82 },
{ name: 'AztecBlue', red: 0x00, blue: 0x80, green: 0x80 },
{ name: 'DustyBlue', red: 0x00, blue: 0x60, green: 0xa0 },
{ name: 'Blueberry', red: 0x00, blue: 0x41, green: 0xc2 },
{ name: 'Violet', red: 0x00, blue: 0x21, green: 0xbf },
{ name: 'DeepPurple', red: 0x41, blue: 0x00, green: 0xc2 },
{ name: 'RedViolet', red: 0x81, blue: 0x00, green: 0xff },
{ name: 'HotPink', red: 0xff, blue: 0x00, green: 0xff },
{ name: 'DarkRose', red: 0xff, blue: 0x00, green: 0x80 },
{ name: 'PoppyRed', red: 0xff, blue: 0x00, green: 0x41 },
{ name: 'Gray35', red: 0xa2, blue: 0xa2, green: 0xa2 },
{ name: 'Crimson', red: 0xc2, blue: 0x00, green: 0x00 },
{ name: 'Red', red: 0xff, blue: 0x00, green: 0x00 },
{ name: 'LightBrown', red: 0xbf, blue: 0x41, green: 0x00 },
{ name: 'Olive', red: 0x80, blue: 0x80, green: 0x00 },
{ name: 'DarkGreen', red: 0x00, blue: 0x80, green: 0x00 },
{ name: 'DarkTeal', red: 0x00, blue: 0x82, green: 0x50 },
{ name: 'Spruce', red: 0x00, blue: 0x60, green: 0x62 },
{ name: 'SlateBlue', red: 0x00, blue: 0x40, green: 0x80 },
{ name: 'NavyBlue', red: 0x00, blue: 0x1f, green: 0xe2 },
{ name: 'BlueViolet', red: 0x40, blue: 0x40, green: 0xc2 },
{ name: 'Amethyst', red: 0x40, blue: 0x00, green: 0xa2 },
{ name: 'DarkRedViolet', red: 0x60, blue: 0x00, green: 0xa1 },
{ name: 'Magenta', red: 0xe0, blue: 0x00, green: 0xe0 },
{ name: 'LightBurgundy', red: 0xdf, blue: 0x00, green: 0x7f },
{ name: 'CherryRed', red: 0xc2, blue: 0x00, green: 0x41 },
{ name: 'Gray40', red: 0x8f, blue: 0x8f, green: 0x8f },
{ name: 'DarkCrimson', red: 0xa0, blue: 0x00, green: 0x00 },
{ name: 'DarkRed', red: 0xe1, blue: 0x00, green: 0x00 },
{ name: 'Hazelnut', red: 0xa1, blue: 0x3f, green: 0x00 },
{ name: 'DarkOlive', red: 0x62, blue: 0x62, green: 0x00 },
{ name: 'Emerald', red: 0x00, blue: 0x60, green: 0x00 },
{ name: 'Malachite', red: 0x00, blue: 0x60, green: 0x3c },
{ name: 'DarkSpruce', red: 0x00, blue: 0x40, green: 0x41 },
{ name: 'SteelBlue', red: 0x00, blue: 0x2f, green: 0x80 },
{ name: 'Blue', red: 0x00, blue: 0x00, green: 0xff },
{ name: 'Iris', red: 0x20, blue: 0x20, green: 0xa0 },
{ name: 'Grape', red: 0x22, blue: 0x00, green: 0xa1 },
{ name: 'Plum', red: 0x40, blue: 0x00, green: 0x80 },
{ name: 'DarkMagenta', red: 0xa1, blue: 0x00, green: 0x9f },
{ name: 'Burgundy', red: 0xc0, blue: 0x00, green: 0x7f },
{ name: 'Cranberry', red: 0x9f, blue: 0x00, green: 0x0f },
{ name: 'Gray50', red: 0x80, blue: 0x80, green: 0x80 },
{ name: 'Mahogany', red: 0x60, blue: 0x00, green: 0x00 },
{ name: 'Brick', red: 0xc2, blue: 0x12, green: 0x12 },
{ name: 'DarkBrown', red: 0x82, blue: 0x42, green: 0x00 },
{ name: 'DeepOlive', red: 0x42, blue: 0x42, green: 0x00 },
{ name: 'DarkEmerald', red: 0x00, blue: 0x42, green: 0x00 },
{ name: 'Evergreen', red: 0x00, blue: 0x40, green: 0x23 },
{ name: 'BalticBlue', red: 0x00, blue: 0x32, green: 0x3f },
{ name: 'BlueDenim', red: 0x00, blue: 0x20, green: 0x60 },
{ name: 'CobaltBlue', red: 0x00, blue: 0x20, green: 0xc2 },
{ name: 'DarkIris', red: 0x22, blue: 0x22, green: 0xc0 },
{ name: 'Midnight', red: 0x00, blue: 0x00, green: 0x80 },
{ name: 'DarkPlum', red: 0x1f, blue: 0x00, green: 0x7f },
{ name: 'PlumRed', red: 0x80, blue: 0x00, green: 0x80 },
{ name: 'DarkBurgundy', red: 0x82, blue: 0x00, green: 0x40 },
{ name: 'Scarlet', red: 0x80, blue: 0x00, green: 0x00 },
{ name: 'Gray60', red: 0x5f, blue: 0x5f, green: 0x5f },
{ name: 'Chestnut', red: 0x40, blue: 0x00, green: 0x00 },
{ name: 'TerraCotta', red: 0xa1, blue: 0x1f, green: 0x12 },
{ name: 'Umber', red: 0x60, blue: 0x42, green: 0x00 },
{ name: 'Amazon', red: 0x21, blue: 0x21, green: 0x00 },
{ name: 'PeacockGreen', red: 0x00, blue: 0x21, green: 0x00 },
{ name: 'Pine', red: 0x00, blue: 0x20, green: 0x1f },
{ name: 'SealBlue', red: 0x00, blue: 0x20, green: 0x41 },
{ name: 'DarkSlateBlue', red: 0x00, blue: 0x20, green: 0x4f },
{ name: 'RoyalBlue', red: 0x00, blue: 0x00, green: 0xe0 },
{ name: 'Lapis', red: 0x00, blue: 0x00, green: 0xa1 },
{ name: 'DarkGrape', red: 0x00, blue: 0x00, green: 0x61 },
{ name: 'Aubergine', red: 0x1f, blue: 0x00, green: 0x62 },
{ name: 'DarkPlumRed', red: 0x40, blue: 0x00, green: 0x5f },
{ name: 'Raspberry', red: 0x62, blue: 0x00, green: 0x42 },
{ name: 'DeepScarlet', red: 0x62, blue: 0x00, green: 0x12 },
{ name: 'Gray70', red: 0x4f, blue: 0x4f, green: 0x4f },
{ name: 'RedGray', red: 0xd0, blue: 0xb1, green: 0xa1 },
{ name: 'Tan', red: 0xe0, blue: 0xa1, green: 0x75 },
{ name: 'Khaki', red: 0xd2, blue: 0xb0, green: 0x6a },
{ name: 'Putty', red: 0xc0, blue: 0xc2, green: 0x7c },
{ name: 'BambooGreen', red: 0x82, blue: 0xc1, green: 0x68 },
{ name: 'GreenGray', red: 0x81, blue: 0xc0, green: 0x97 },
{ name: 'BalticGray', red: 0x7f, blue: 0xc2, green: 0xbc },
{ name: 'BlueGray', red: 0x71, blue: 0xb2, green: 0xcf },
{ name: 'RainCloud', red: 0xb1, blue: 0xb1, green: 0xd2 },
{ name: 'LilacGray', red: 0x9f, blue: 0x9f, green: 0xe0 },
{ name: 'LightPurpleGray', red: 0xc0, blue: 0xa1, green: 0xe0 },
{ name: 'LightMauve', red: 0xe2, blue: 0x9f, green: 0xde },
{ name: 'LightPlumGray', red: 0xef, blue: 0x91, green: 0xeb },
{ name: 'LightBurgundyGray', red: 0xe2, blue: 0x9f, green: 0xc8 },
{ name: 'RoseGray', red: 0xf1, blue: 0x8f, green: 0xbc },
{ name: 'Gray80', red: 0x2f, blue: 0x2f, green: 0x2f },
{ name: 'DarkRedGray', red: 0x7f, blue: 0x60, green: 0x4f },
{ name: 'DarkTan', red: 0xa1, blue: 0x62, green: 0x52 },
{ name: 'Safari', red: 0x80, blue: 0x62, green: 0x10 },
{ name: 'OliveGray', red: 0x82, blue: 0x82, green: 0x3f },
{ name: 'Jade', red: 0x3f, blue: 0x62, green: 0x1f },
{ name: 'DarkGreenGray', red: 0x3c, blue: 0x61, green: 0x3e },
{ name: 'SpruceGray', red: 0x37, blue: 0x60, green: 0x5e },
{ name: 'DarkBlueGray', red: 0x10, blue: 0x41, green: 0x60 },
{ name: 'AtlanticGray', red: 0x42, blue: 0x42, green: 0x82 },
{ name: 'DarkLilacGray', red: 0x62, blue: 0x60, green: 0xa1 },
{ name: 'PurpleGray', red: 0x62, blue: 0x41, green: 0x81 },
{ name: 'Mauve', red: 0x60, blue: 0x31, green: 0x81 },
{ name: 'PlumGray', red: 0x60, blue: 0x21, green: 0x62 },
{ name: 'BurgundyGray', red: 0x62, blue: 0x21, green: 0x52 },
{ name: 'DarkRoseGray', red: 0x81, blue: 0x3f, green: 0x62 },
{ name: 'Black', red: 0x00, blue: 0x00, green: 0x00 }
FontIdFields Class
Class that encodes/decodes the fontId integer value to and from it's constituent parts.
constructor
Creates a FontIdFields
class from a fontId value.
Parameters
fontId
{number}: Optional unsigned 32-bit integer that is used to encode font-related attributes in many rich text structures. Default value is 0.
Constants
These are static values referenced using the class name: FontIdFields.
FONT_FACE_XXX
- These symbols define the standard type faces identified in the face property of aFontIdFields
class:
FONT_FACE_ROMAN
: Text will be displayed in a Times Roman typeface.FONT_FACE_SWISS
: Text will be displayed in a Helvetica typeface.FONT_FACE_UNICODE
: Text will be displayed in a Monotype Sans WT typeface.FONT_FACE_USERINTERFACE
: Text will be displayed in an Arial typeface.FONT_FACE_TYPEWRITER
: Text will be displayed in a Courier typeface.STATIC_FONT_FACES
: The maximum index for the built-in font faces.
Properties
faceName
read-only {string
}: Name of the font face represented by the fontId. Currently only the built-in fonts are supported:Times Roman
,Helvetica
,Monotype Sans WT
Arial
,Courier
. If the fontId specifies a value not built-in, the valueFont table needed
is returned.face
read-write {number
}: Index that identifies the font face. SeeFONT_FACE_XXX
.pointSize
read-write {number
}: Integer value between 1 and 255 that represents the size of the font.bold
read-write {boolean
}: Text will be in boldfaceitalic
read-write {boolean
}: Text will be in italics.underline
read-write {boolean
}: Text will be underlined..strikeout
read-write {boolean
}: Text will be struck out.superScript
read-write {boolean
}: Text will be superscripted.sub
read-write {boolean
}: Text will be subscripted.effect
read-write {boolean
}: Enables the shadow, emboss and extrude attributes.shadow
read-write {boolean
}: Text will be shadowed.emboss
read-write {boolean
}: Text will be embossed. Embossed text is text that appears to be sticking out of the page.extrude
read-write {boolean
}: Text will be extruded. Extruded text is text that appears to be pushed into the page.colorName
read-only {string
}: Returns the name of the color that corresponds to the color attribute.colorRgb
read-only {`red:, green: . blue: }: Returns the rgb value that corresponds to the color attribute. color
read-write {number
}: Byte value that represents the font color.fontId
read-only {number
}: 32-bit unsigned value that encodes the FontIdFields attributes.
toString
Produces a string representation of this FontIdFields class.
Return Value
{string
} representing the fields of this class.
PabDefConstants Namespace
This is a collection of constant values that are used by the PabDefinition class.
Properties
All properties are read-only integer values.
TWIPS_PER_POINT
: Number of twips in a point.POINTS_PER_INCH
: Number of points in an inch.ONE_INCH
: One inch in twips.MAXTABS
: Maximum number of tab stops allowed.JUSTIFY_XXX
- Justification mode flags used by the justifyMode property:
JUSTIFY_LEFT
: Causes paragraph to be left justified.JUSTIFY_RIGHT
: Causes paragraph to be right justified.JUSTIFY_BLOCK
: Causes paragraph to be block justified.JUSTIFY_CENTER
: Causes paragraph to be centered.JUSTIFY_NONE
: Removes any justification from paragraph.MAX_MARGINS
: Maximum number of margin fields.TAB_TYPE_XXX
values that control the alignment of a tabstop.
TAB_LEFT
: Left aligned tab.TAB_RIGHT
: Right aligned tab.TAB_CENTER
: Center aligned tab.TAB_DECIMAL
: Aligns value on decimal point of a number.EXTENDEDPABFLAGS
: Flag that when found in the extendedPabFlags field indicates that the PabDefinition has the extended flags3 field. This flag is set by default for rich text created with V5 and later clients.flags
: Constants used by the flags field.
PABFLAG_PAGINATE_BEFORE
: Start new page with this paragraph.PABFLAG_KEEP_WITH_NEXT
: Don't separate this and next paragraph.PABFLAG_KEEP_TOGETHER
: Don't split lines in paragraph.PABFLAG_PROPAGATE
: Propagate even PAGINATE_BEFORE and KEEP_WITH_NEXT.PABFLAG_HIDE_RO
: Hide paragraph in read-only mode.PABFLAG_HIDE_RW
: Hide paragraph in read-write mode.PABFLAG_HIDE_PR
: Hide paragraph when printing.PABFLAG_DISPLAY_RM
: Not used in Release 5.0 and later. In earlier releases, this flag had to be set if the paragraph is in a table.PABFLAG_HIDE_UNLINK
: The paragraph definition was saved in Release 4. Set this bit or the Notes client will assume the pab was saved pre-Release 4 and will thus "link" these bit definitions (assign the right one to the left one) since preview did not exist pre-Release 4:PABFLAG_HIDE_PV
=PABFLAG_HIDE_RO
PABFLAG_HIDE_PVE
=PABFLAG_HIDE_RW
PABFLAG_HIDE_CO
: Hide paragraph when copying/forwarding.PABFLAG_BULLET
: Display paragraph with bullet.PABFLAG_HIDE_IF
: Use the hide when formula (if the formula is present).PABFLAG_NUMBEREDLIST
: Display paragraph with number.PABFLAG_HIDE_PV
: Hide paragraph when previewing.PABFLAG_HIDE_PVE
: Hide paragraph when editing in the preview pane.PABFLAG_HIDE_NOTES
: Hide paragraph from Notes clients.PABFLAG_HIDEBITS
: (PABFLAG_HIDE_RO
|PABFLAG_HIDE_RW
|PABFLAG_HIDE_CO
|PABFLAG_HIDE_PR
|PABFLAG_HIDE_PV
|PABFLAG_HIDE_PVE
|PABFLAG_HIDE_IF
|PABFLAG_HIDE_NOTES
).flags2
: Constants used by the flags2 field.
PABFLAG2_HIDE_WEB
: Hide paragraph when viewed with a Web browser.PABFLAG2_CHECKEDLIST
: Set if check list is checked off.PABFLAG2_LM_OFFSET
: LeftMargin is an offset value.PABFLAG2_LM_PERCENT
: LeftMargin is a percentage value.PABFLAG2_FLLM_OFFSET
: First Line LeftMargin is an offset value.PABFLAG2_FLLM_PERCENT
: First Line LeftMargin is a percentage value.PABFLAG2_RM_OFFSET
: RightMargin is an offset value.PABFLAG2_RM_PERCENT
: RightMargin is a percentage value.PABFLAG2_LM_DEFAULT
: LeftMargin Default.PABFLAG2_FLLM_DEFAULT
: First Line LeftMargin Default.PABFLAG2_RM_DEFAULT
: RightMargin Default.PABFLAG2_CIRCLELIST
: Paragraph contains a circle list.PABFLAG2_SQUARELIST
: Paragraph contains a square list.PABFLAG2_UNCHECKEDLIST
: Set if check list is unchecked.PABFLAG2_BIDI_RTLREADING
: Set if right to left reading order.PABFLAG2_MORE_FLAGS
: Set if one or two DWORD extensions follow the V4 PabDefinition structure.PABFLAG2_HIDEBITS
: PABFLAG2_HIDE_WEBPABFLAG2_CHECKLIST
: Paragraph contains a check list - PABFLAG2_UNCHECKEDLIST | PABFLAG2_CHECKEDLISTPABFLAG2_MARGIN_DEFAULTS_MASK
: PABFLAG2_LM_DEFAULT | PABFLAG2_RM_DEFAULT | PABFLAG2_FLLM_DEFAULTPABFLAG2_MARGIN_MASK
: PABFLAG2_MARGIN_STYLES_MASK | PABFLAG2_MARGIN_DEFAULTS_MASKPABFLAG2_MARGIN_STYLES_MASK
: PABFLAG2_LM_OFFSET | PABFLAG2_LM_PERCENT | PABFLAG2_FLLM_OFFSET | PABFLAG2_FLLM_PERCENT | PABFLAG2_RM_OFFSET | PABFLAG2_RM_PERCENTPABFLAG2_ROMANUPPERLIST
: PABFLAG2_CHECKEDLIST | PABFLAG2_CIRCLELISTPABFLAG2_ROMANLOWERLIST
: PABFLAG2_CHECKEDLIST | PABFLAG2_SQUARELISTPABFLAG2_ALPHAUPPERLIST
: PABFLAG2_SQUARELIST | PABFLAG2_CIRCLELISTPABFLAG2_ALPHALOWERLIST
: PABFLAG2_CHECKEDLIST | PABFLAG2_SQUARELIST | PABFLAG2_CIRCLELISTflags3
: Constants used by the flags3 field.
PABFLAG3_HIDE_EE
: Hide when embedded.PABFLAG3_HIDE_MOBILE
: Hide from mobile clients.PABFLAG3_LAYER_USES_DRM
: True if boxes in a layer have set PABFLAG_DISPLAY_RM on the PabDefinition.
PabDefinition Class
Class that represents a paragraph definition.
addTab
Adds a tab stop to the paragraph.
Parameters
position
{number}: Position in twips of the tab stop to add.type
{number}: The type of tab. See PabDefConstants TAB_TYPE_XXX.
deleteTab
Removes a tabstop at the specified position.
Parameters
position
{number}: Position in twips of the tab stop to remove.
tabStopsToString
Return Value
Returns a {string
} representation of this paragraph's tab configuration
encoded as
Properties
header
read-write {Object
}:signature
{number
}: Signature representing a PabDefinition.length
{number
}: Length of this PabDefinition.pabId
read-only {number
}: Unique identifier of this PabDefinition.justifyMode
read-write {number
}: Controls justification of the paragraph. See PabDefConstants JUSTIFY_XXX.lineSpacing
read-write {number
}: Controls the blank space between lines. The default is 0 which results in single-spaced text. A value of 1 results in a half-height blank line and a value of 2, results in double spaced text.paragraphSpacingBefore
read-write {number
}: The amount of spacing before this paragraph. This property uses the same units aslineSpacing
.paragraphSpacingAfter
read-write {number
}: The amount of spacing after this paragraph. This property uses the same units aslineSpacing
.tabs
read-only {Array[Tab]
}: Returns a copy of the tab stops contained by thisPabDefinition
.flags
read/write {number} 16-bit unsigned integer containing flags defined by PabDefConstants flags.PABDEF_FLAGS_XXX.flags2
read/write {number} 16-bit unsigned integer containing flags defined by PabDefConstants flags2.PABDEF2_FLAGS_XXX.margin
read/write {Uint16Array[6]}: An array of 6 values that control the margins of thisPabDefinition
.extendedPabFlags
read-write {number}: A 32-bit unsigned integer that indicates the presence of the extended paragraph definition fields (the default for v5 and later clients). If this value contains the flag PabDefConstants.EXTENDEDPABFLAGS3 (the default), then the flags3 value will be present.flags3
read/write {number}: 32-bit unsigned integer that may contain the flags defined in PabDefConstants.flags3.PABDEF3_FLAGS_XXX.
Note that the following three properties are ignored by v5 and later clients but are referenced here because they are likely to be present in documents where Notes versions predating v5 were in use.
leftMargin
read/write {number
} Offset in twips relative to absolute left.rightMargin
read/write {number
} Offset in twips relative to absolute right.firstLineLeftMargin
read/write {'number'} Left margin on the first line.
PabReference Class
PabReference
represents a reference to a PabDefinition in a rich text field. A
Pabreference follows a Paragraph record in a rich text field and causes the properties
of the referenced PabDefinition to be applied to that Paragraph.
constructor
Constructs a PabReference
. Note that typical usage of this class is through
RichTextField
where the PabReference is constructed internally
in conjunction with a Paragraph
. Therefore, it is usually not
necessary to construct a PabReference
outside of that context.
Parameters
options
{Object
}:
pabId
{number
}: Integer value that references the PabDefinition that will be applied to the associated paragraph.
Properties
SIGNATURE
static, read-only {number}: Constant value that represents the signature of this rich text record.pabId
read-write {number}: Integer value that references the PabDefinition that will be applied to the associated paragraph.
Paragraph Class
This class represents a paragraph in rich text. It serves as a marker and otherwise
has no properties aside from the signature. A PabReference
class immediately follows
and identifies the PabDefinition
that applies to the paragraph.
Properties
SIGNATURE
static, read-only {number}: Constant value that represents the signature of this rich text record.
RichTextField Class
This class represents a RichTextField. It provides the ability to create rich text as well as modify existing rich text.
constructor
Constructs a RichTextField class. Automatically adds a PabDefinition with pabId === 1 consisting of default values.
Parameters
options
{Object}:
- 'maxTextSize` {number}: An optional value between 16k (default) and 64k that controls the maximum size of a text run. It is recommended to use the default when creating rich text documents as this is considered an optimal value by the Notes editor, but there may be existing documents that exceed this limit.
Properties
length
{number}: Read-only value indicating the number of rich text records contained by this RichTextField.
at
Returns the rich text record at offset
.
Parameters
offset
{number}: Zero-based offset corresponding to a rich text record.
Return Value
{RichTextRecord | PabDefinition | PabReference | Paragraph | TextRun}
iterator
RichTextField implements the @@iterator method which allows it to be used in 'for..of' loops and in other syntaxes that expect iterables.
getPabDefinition
Returns a PabDefinition owned by this field.
Parameters
pabId
{number}: 1-based number identifying a PabDefinition contained by this RichTextField.
Return Value
{
PabDefinition
} Reference to a PabDefinition corresponding to the supplied pabId. Changes to the returned PabDefinition will be reflected in the RichTextField.
Throws
RangeError if pabId is not contained in the RichTextField.
addPabDefinition
Adds a PabDefinition to this RichTextField and assigns a unique identifier to it.
Parameters
options
{Object
}:
justifyMode
{number
}: One ofPabDefConstants.JUSTIFY_LEFT
,PabDefConstants.JUSTIFY_RIGHT
,PabDefConstants.JUSTIFY_BLOCK
,PabDefConstants.JUSTIFY_CENTER
,PabDefConstants.JUSTIFY_NONE
.lineSpacing
{number
}: A number between 0 and 2 where 0 is single-spaced text, 1 is one and one half spaces and 2 is double-spaced text.paragraphSpacingBefore
{number
}: Spacing before this paragraph. UseslineSpacing
units.paragraphSpacingAfter
{number
}: Spacing after this paragraph. UseslineSpacing
units.flags
{number
}: Paragraph definition flags. See PabDefConstants.flags.PABFLAG_XXX.flags2
{number
}: Additional paragraph definition flags. See PabDefConstants.flags2.PABFLAG2_XXX.margin
{Uint16Array
}: An array of 6 values that defines the margins for this PabDefinition. The flags PabDefConstants.flags2.PABFLAG2_LM_XX, PabDefConstants.flags2.PABFLAG2_RM_XX and PabDefConstants.flags2.PABFLAG2_RM_XX control how the Notes client consumes these values. Values are:flags3
{number
}: Additional paragraph definition flags. See PabDefConstants.flags2.PABFLAG3_XXX.
position
{number
}: Optional 0-based position at which to insert the PabDefinition.
Return Value
{
PabDefinition
} Returns a reference to the {PabDefinition
} object added to this field. Modifications can be made using this reference that will be reflected in this field.
addParagraph
Adds a Paragraph
and PabReference
to this rich text field.
Parameters
pabId
{number
}: Reference to the PabDefinition that is to be associated
with this paragraph. The PabDefinition must precede this reference in the field.
addRichTextRecord
Adds raw formatted rich text record to this field. Record must be formatted as valid rich text.
Parameters
record
{RichTextRecord
}: An instance of a RichTextRecord.position
{number
}: Optional 0-based offset indicating the position at which to insert record. Default is to insert at the end of this field.
addText
Adds text to this rich text field. Text will be converted automatically to LMBCS format as required by Domino. The default, recommended maximum size is 15 Kb but this can be increased by specifying the maxTextSize parameter when constructing a RichTextField. It's best to break large blocks of text into chunks that fit into the recommended size.
Parameters
options
{Object
}:
text
{string
}: Text data.fontId
{number
}: Bit field that encodes font face, point size, style attributes (bold, italic, etc.) and color. The FontIdFields class is a helper class that handles encoding and decoding of these attributes.position
{number
}: Optional 0-based offset indicating the position at which to insert record. Default is to insert at the end of this field.
toBuffer
Converts this rich text field to a Buffer
of rich text records.
Return Value
{
Buffer
} ABuffer
of rich text records.
fromBuffer
Constructs a RichTextField
from a Buffer
that contains rich text records.
Parameters
buffer {
Buffer
}: ABuffer of rich text records. options {
Object`}:
- maxTextSize {
number
}: An optional value between 16k (default) and 64k that controls the maximum size of a text run. It is recommended to use the default when creating rich text documents as this is considered an optimal value by the Notes editor, but there may be existing documents that exceed this limit.
RichTextRecord Class
RichTextRecord
represents a rich text record in raw format and
serves as placeholder in a RichTextField when an unsupported type is encountered.
Properties
header
read-only {Object
}:
signature
{number
}: Signature that identifies the type of rich text record.length
{length
}: Length of this rich text record including the header.data
read-only {Buffer
}: Raw rich text data including the header.
constructor
Parameters
header
{Object
}:
signature
{number
}: Signature that identifies the type of rich text record.length
{length
}: Length of this rich text record including the header.data
{Buffer
}: Raw rich text data including the header.
RichTextReader Class
The RichTextReader class enumerates the rich text records produced by the domino-db RichText API's.
readRichTextStream
Enumerates a Buffer of rich text records.
Parameters
buffer
{Buffer
}: Node.js Buffer class containing canonically formatted rich text. See bulkReadRichTextStream for details on extracting rich text from a note.
callback
{Function : boolean
}:
header
{Object
}:
signature
{number
}: Integer value indicating the signature of the current record. See RichTextSignatures.length
{number
}: Indicates the length of the rich text record including the header.record
{Buffer
}: Buffer containing the rich text record in canonical format including the header.return value
{boolean
}: Return true to continue processing, false to stop.
Example
See Enumerating a Rich Text Field
createInstance
Creates an instance of a class corresponding to the provided signature. This function is most useful in conjunction with readRichTextStream. Supported types are limited in this release to PabDefinition, PabReference, Paragraph, and TextRun.
Parameters
header
{Object}: The header portion of the rich text record.signature
{ number }: The signature identifying the rich text record.length
{number }: The total length of the rich text record.buffer
{Buffer}: Buffer containing the rich text record (starting with the header).
Tab Class
Class representing a tab stop in a paragraph definition.
Properties
position
{number}: Position in twips of the tab stop.type
{number}: The type of tab. See PabDefConstants TAB_TYPE_XXX.
TextRun Class
This class defines a run of text in a rich text field. Each TextRun
has
an associated fontId (see FontIdFields) that defines the
visual aspects the text will exhibit.
constructor
Parameters
options
{Object
}:
text
{string
}: Textual data.fontId
{number
}: 32-bit unsigned integer that represents the font characteristics associated with this text run (see FontIdFields).maxTextSize
{number}: An optional value between 16k (default) and 64k that controls the maximum size of a text run. It is recommended to use the default when creating rich text documents as this is considered an optimal value by
the Notes editor, but there may be existing documents that exceed this limit.
Properties
SIGNATURE
static, read-only {number}: Constant value that represents the signature of this rich text record.text
read-write {string
}: The text represented by this text run. Note that this text is translated to LMBCS when this text run is written to a RichTextField.fontId
read-write {number
}: The fontId associated with this text run.fontIdFields
read-only {FontIdFields
}: FontIdFields object that corresponds to the fontId associated with this TextRun.
lmbcsToUTF16
Converts a LMBCS string to UTF-16. Note that the TextRun
class automatically
converts the text
property to UTF-16. This function is provided for cases
where one may need to decode a string from RichTextRecord
containing raw rich text data and untranslated LMBCS.
Parameters
buffer
{Buffer
}: Buffer containing LMBCS-formatted text.
Return Value
- {
string
}: Javascript string containing translated text.
utf16ToLMBCS
Converts a Javascript string to LMBCS. Note that the TextRun
class automatically
converts the text
property to LMBCS when converting a RichTextField
to a Buffer
. This function is for implementors that want to create their own
conversions on raw rich text data..
Parameters
input
{string
}: Javascript string that can contain any Unicode defined code point.
Return Value
- {
Buffer
}: Returns aBuffer
containing text translated to LMBCS-format.