comparison mupdf-source/docs/reference/javascript/functions.rst @ 3:2c135c81b16c

MERGE: upstream PyMuPDF 1.26.4 with MuPDF 1.26.7
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:44:09 +0200
parents b50eed0cc0ef
children
comparison
equal deleted inserted replaced
0:6015a75abc2d 3:2c135c81b16c
1 .. default-domain:: js
2
3 .. highlight:: javascript
4
5 Functions
6 =========
7
8 Most functionality is provided by member functions of class objects.
9 There are just a couple of top level configuration functions listed
10 here.
11
12 .. function:: mupdf.installLoadFontFunction(callback)
13
14 Install a handler to load system (or missing) fonts.
15
16 The callback function will be called with four arguments:
17
18 .. code-block::
19
20 callback(fontName, scriptName, isBold, isItalic)
21
22 The callback should return either a `Font` object for the requested
23 font, or ``null`` if an exact match cannot be found (so that the font
24 loading machinery can keep looking through the chain of fallback
25 fonts).
26
27 .. function:: mupdf.enableICC()
28
29 Enable ICC-profiles based operation.
30
31 .. function:: mupdf.disableICC()
32
33 Disable ICC-profiles based operation.
34
35 .. function:: mupdf.setUserCSS(stylesheet, useDocumentStyles)
36
37 Set a style sheet to apply to all reflowable documents.
38
39 :param string stylesheet: The CSS text to use.
40 :param boolean useDocumentStyles:
41 Whether to respect the document's own style sheet.