We have frozen the document schema (V1.0.0)/ Can't introduce new properties. That is why page_fill_tint and text_stroke_tint are not functional yet.
There are also API call's to override the document setup properties.
See end of this document.
// ─── Page defaults ────────────────────────────────────────────────────────────
// Set the fill colour applied to every new page.
// The swatch UUID must exist in the document's swatch library.
g_typograph_document.set_default_page_fill('PAPER'); // full opacity
g_typograph_document.set_default_page_fill('PAPER', 0.85); // 85 % tint
// Fine-grained control via the partial-update helper:
g_typograph_document.set_page_defaults({ fill_swatch_uuid: 'WHITE', fill_tint: 1.0 });
// Read the current page defaults:
const pageDefs = g_typograph_document.get_page_defaults();
console.log(pageDefs.fill_swatch_uuid, pageDefs.fill_tint);
// Clear all page defaults (new pages revert to their built-in defaults):
g_typograph_document.reset_page_defaults();
// ─── Text defaults ────────────────────────────────────────────────────────────
// Set the text fill colour applied to every new rich-text element.
g_typograph_document.set_default_text_fill('BLACK'); // full opacity
g_typograph_document.set_default_text_fill('BRAND_BLUE'); // custom swatch
// Set the text stroke colour:
g_typograph_document.set_default_text_stroke('NONE'); // no stroke (default)
g_typograph_document.set_default_text_stroke('BLACK'); // solid black stroke
// Set the text stroke dash pattern:
g_typograph_document.set_default_text_stroke_dash({ name: 'solid', pattern: [] });
g_typograph_document.set_default_text_stroke_dash({ name: 'dashed', pattern: [4, 2] });
// Fine-grained control via the partial-update helper:
g_typograph_document.set_text_defaults({
fill_swatch_uuid: 'BLACK',
stroke_swatch_uuid: 'NONE',
stroke_dash: { name: 'solid', pattern: [] },
});
// Read the current text defaults:
const textDefs = g_typograph_document.get_text_defaults();
console.log(textDefs.fill_swatch_uuid, textDefs.stroke_swatch_uuid);
// Clear all text defaults:
g_typograph_document.reset_text_defaults();
// ─── Notes ───────────────────────────────────────────────────────────────────
//
// Page defaults are applied when the user adds a new page via the page bar.
// They are NOT applied to pages loaded from a saved document.
//
// Text defaults are applied when a new rich-text frame is created.
// They are NOT applied to rich-text elements loaded from a saved document.
//
// text_fill_tint and text_stroke_tint are accepted by set_default_text_fill /
// set_default_text_stroke and stored in the defaults object, but are not yet
// written to the document JSON. They will become functional in a future release.
g_typograph_document.show_add_page_control(false); // hide + button
g_typograph_document.show_add_page_control(true); // show + button
g_typograph_document.set_show_rulers(false); //hide
g_typograph_document.set_show_rulers(true); //show