typograph-editor-documentation
    Preparing search index...

    Release Notes - Version 1.0.0-20260508

    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.

    • More more document setup properties
    • More editor defaults (page and text)
    • When a new page is added it will copy the bleed values of the first page in the document
    • Pagebar page add control show/hide
    • There is a new MenuAPI (see MenuAPI in online typograph-editor_ui-documentation)
    • show_add_page_control (off in canvas/viewer on in editor)
    • show_rulers (off in canvas/viewer)

    There are also API call's to override the document setup properties.
    See end of this document.

    • page_fill_swatch_uuid: 'PAPER'
    • page_fill_tint: 1.0
    • text_fill_swatch_uuid: 'BLACK'
    • text_fill_tint: 1.0 (new property none functional in this release text_fill_tint is always 1.0)
    • text_stroke_swatch_uuid: 'NONE'
    • text_stroke_tint: 1.0 (new property none functional in this release text_stoke_tint is always 1.0)
    • text_stroke_dash: { name: 'solid', pattern: [] }
      // ─── 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.
    • Now when the users add's a page (menu or pagebar) the new page will copy the bleed values of the first page.
    • the + button in the page can be hidden or shown
      g_typograph_document.show_add_page_control(false);  // hide + button                                                                                                     
    g_typograph_document.show_add_page_control(true); // show + button
    • in the editor there is also a menuitem that can add a page
      See the MenuAPI how to remove or disable this menu item (see )
      g_typograph_document.set_show_rulers(false); //hide
    g_typograph_document.set_show_rulers(true); //show