docx
    Preparing search index...

    Type Alias EstimatePageNumbersOptions

    How estimatePageNumbersWith lays out the pages.

    type EstimatePageNumbersOptions = {
        fonts?: readonly FontFile[];
        guess?: boolean;
        measureWidth?: MeasureWidth;
    }
    Index
    fonts?: readonly FontFile[]

    Font files to measure text in, with their own widths, kerning, ligatures and line heights, as Word measures it. Give a file for each of a font's faces the document uses, such as Aptos, Aptos Bold and Aptos Italic: text in fonts without files is measured as it is without them, and so is bold text, or text that isn't bold, in a font without a file for it, which stops the layout when the font isn't in the width tables. Italic text in a font without an italic file is measured with the upright one. The layout stops at a character a font's file has no glyph for, as Word draws it in another font. A font the document embeds is measured from the document's own file. Text in a font Office also offers, such as Pacifico, stops the layout, as Word for Mac draws it in Office's own copy of the font, but for Office's fonts of the width tables, such as Aptos

    guess?: boolean

    Whether to lay out past what the layout can't lay out as Word does yet with the best guess it has, rather than leave the page numbers after it blank. Text in a font that isn't in the width tables, and isn't given as a file or embedded, is measured as the most similar font that is, such as Roboto as Arial, text in a font given as a file or embedded that Office also offers is measured from the file, and a character whose width isn't known as an average letter of its font. A date is measured as it is written, and a setting or formatting the layout doesn't follow, such as hyphenation or a compatibility setting, is left as if it weren't there. What it can't read, such as a drawing that text flows around or an equation, is left out, and a page laid out as the rule it follows nearest to Word's lays it out. It still stops where it has no guess, such as at an imported document.

    The page numbers may then not be Word's, so guesses, in what the estimator gives, says where it guessed. Default is off, so the numbers written are Word's, as near as the layout knows, or blank.

    measureWidth?: MeasureWidth

    Measures how wide text is, such as measureWithPretext, which measures it with the fonts a browser has. Default is the widths of the fonts Word documents use most, which estimatePageNumbers uses. Lines still break, and tabs move to their stops, as Word lays them out, and lines are as tall as Word makes them, from the width tables, so the layout stops at text in a font that isn't in them and isn't given as a file or embedded.