You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,8 @@ Within `docs` update the associated restructured text (`.rst`) files. These file
14
14
15
15
### Conventions
16
16
17
-
- Code parameters should be referenced within backticks, not italics, double backtick is better for safety
18
-
- When referencing names of common things surround with | , e.g. |PyMuPDF| , not PyMuPDF, see `header.rst` for names listing
17
+
- Code parameters and referenced code objects should be referenced within backticks, not italics, double backtick is better for safety
18
+
- When referencing names of some of our products surround with | , e.g. |PyMuPDF| , not PyMuPDF, see `header.rst` for products names listing
19
19
- When hyperlinking, avoid inline hyperlinks and try to references link from common location at page bottom, also avoid the use of "here" or "click here" as this provides little information about the link content. e.g.
20
20
21
21
"`Click here <link>` for our Story class". Should be re-written to something more like "Find out more `on our Story class <link>`"
Copy file name to clipboardExpand all lines: docs/font.rst
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ Font
8
8
9
9
* New in v1.16.18
10
10
11
-
This class represents a font as defined in MuPDF (*fz_font_s* structure). It is required for the new class :ref:`TextWriter` and the new :meth:`Page.write_text`. Currently, it has no connection to how fonts are used in methods :meth:`Page.insert_text` or :meth:`Page.insert_textbox`, respectively.
11
+
This class represents a font as defined in |MuPDF| (``fz_font_s`` structure). It is required for the new class :ref:`TextWriter` and the new :meth:`Page.write_text`. Currently, it has no connection to how fonts are used in methods :meth:`Page.insert_text` or :meth:`Page.insert_textbox`, respectively.
12
12
13
-
A Font object also contains useful general information, like the font bbox, the number of defined glyphs, glyph names or the bbox of a single glyph.
13
+
A ``Font`` object also contains useful general information, like the font bbox, the number of defined glyphs, glyph names or the ``bbox`` of a single glyph.
Check whether the unicode *chr* exists in the font or (option) some fallback font. May be used to check whether any "TOFU" symbols will appear on output.
141
+
Check whether the unicode ``chr`` exists in the font or (option) some fallback font. May be used to check whether any "TOFU" symbols will appear on output.
142
142
143
-
:arg int chr: the unicode of the character (i.e. *ord()*).
143
+
:arg int chr: the unicode of the character (i.e. ``ord()``).
144
144
:arg str language: the language -- currently unused.
145
145
:arg int script: the UCDN script number.
146
146
:arg bool fallback: *(new in v1.17.5)* perform an extended search in fallback fonts or restrict to current font (default).
@@ -152,7 +152,7 @@ A Font object also contains useful general information, like the font bbox, the
152
152
153
153
Return an array of unicodes supported by this font.
154
154
155
-
:returns: an *array.array* [#f2]_ of length at most :attr:`Font.glyph_count`. I.e. *chr()* of every item in this array has a glyph in the font without using fallbacks. This is an example display of the supported glyphs:
155
+
:returns: an ``array.array`` [#f2]_ of length at most :attr:`Font.glyph_count`. I.e. ``chr()`` of every item in this array has a glyph in the font without using fallbacks. This is an example display of the supported glyphs:
156
156
157
157
>>> import pymupdf
158
158
>>> font = pymupdf.Font("math")
@@ -191,8 +191,8 @@ A Font object also contains useful general information, like the font bbox, the
191
191
192
192
Calculate the "width" of the character's glyph (visual representation).
193
193
194
-
:arg int chr: the unicode number of the character. Use *ord()*, not the character itself. Again, this should normally work even if a character is not supported by that font, because fallback fonts will be checked where necessary.
:arg int chr: the unicode number of the character. Use ``ord()``, not the character itself. Again, this should normally work even if a character is not supported by that font, because fallback fonts will be checked where necessary.
@@ -218,7 +218,7 @@ A Font object also contains useful general information, like the font bbox, the
218
218
219
219
The glyph rectangle relative to :data:`fontsize` 1.
220
220
221
-
:arg int chr:*ord()* of the character.
221
+
:arg int chr:``ord()`` of the character.
222
222
223
223
:returns: a :ref:`Rect`.
224
224
@@ -227,7 +227,7 @@ A Font object also contains useful general information, like the font bbox, the
227
227
228
228
Show the name of the character's glyph.
229
229
230
-
:arg int ch: the unicode number of the character. Use *ord()*, not the character itself.
230
+
:arg int ch: the unicode number of the character. Use ``ord()``, not the character itself.
231
231
232
232
:returns: a string representing the glyph's name. E.g. `font.glyph_name(ord("#")) = "numbersign"`. For an invalid code ".notfound" is returned.
233
233
@@ -340,15 +340,15 @@ A Font object also contains useful general information, like the font bbox, the
340
340
341
341
* New in v1.18.0
342
342
343
-
The ascender value of the font, see `here<https://en.wikipedia.org/wiki/Ascender_(typography)>`_ for details. Please note that there is a difference to the strict definition: our value includes everything above the baseline -- not just the height difference between upper case "A" and and lower case "a".
343
+
The ascender value of the font, see `ascender typography<https://en.wikipedia.org/wiki/Ascender_(typography)>`_ for details. Please note that there is a difference to the strict definition: our value includes everything above the baseline -- not just the height difference between upper case "A" and and lower case "a".
344
344
345
345
:rtype: float
346
346
347
347
.. attribute:: descender
348
348
349
349
* New in v1.18.0
350
350
351
-
The descender value of the font, see `here<https://en.wikipedia.org/wiki/Descender>`_ for details. This value always is negative and is the portion that some glyphs descend below the base line, for example "g" or "y". As a consequence, the value `ascender - descender` is the total height, that every glyph of the font fits into. This is true at least for most fonts -- as always, there are exceptions, especially for calligraphic fonts, etc.
351
+
The descender value of the font, see `descender typography<https://en.wikipedia.org/wiki/Descender>`_ for details. This value always is negative and is the portion that some glyphs descend below the base line, for example "g" or "y". As a consequence, the value `ascender - descender` is the total height, that every glyph of the font fits into. This is true at least for most fonts -- as always, there are exceptions, especially for calligraphic fonts, etc.
@@ -172,7 +172,7 @@ Yet others are handy, general-purpose utilities.
172
172
:arg str name: the name of some glyph. The function is based on the `Adobe Glyph List <https://github.com/adobe-type-tools/agl-aglfn/blob/master/glyphlist.txt>`_.
173
173
174
174
:rtype: int
175
-
:returns: the unicode. Invalid *name* entries return `0xfffd (65533)`.
175
+
:returns: the unicode. Invalid ``name`` entries return `0xfffd (65533)`.
176
176
177
177
.. note:: A similar functionality is provided by package `fontTools <https://pypi.org/project/fonttools/>`_ in its *agl* sub-package.
178
178
@@ -412,7 +412,7 @@ Yet others are handy, general-purpose utilities.
412
412
Calculate the length of text on output with a given **builtin** font, :data:`fontsize` and encoding.
413
413
414
414
:arg str text: the text string.
415
-
:arg str fontname: the fontname. Must be one of either the :ref:`Base-14-Fonts` or the CJK fonts, identified by their "reserved" fontnames (see table in :meth:`Page.insert_font`).
415
+
:arg str fontname: the font name. Must be one of either the :ref:`Base-14-Fonts` or the CJK fonts, identified by their "reserved" fontnames (see table in :meth:`Page.insert_font`).
416
416
:arg float fontsize: the :data:`fontsize`.
417
417
:arg int encoding: the encoding to use. Besides 0 = Latin, 1 = Greek and 2 = Cyrillic (Russian) are available. Relevant for Base-14 fonts "Helvetica", "Courier" and "Times" and their variants only. Make sure to use the same value as in the corresponding text insertion.
Copy file name to clipboardExpand all lines: docs/how-to-open-a-file.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ To open a file, do the following:
32
32
doc = pymupdf.open("a.pdf")
33
33
34
34
35
-
.. note:: The above creates a :ref:`Document`. The instruction `doc = pymupdf.Document("a.pdf")` does exactly the same. So, `open` is just a convenient alias and you can find its full API documented in that chapter.
35
+
.. note:: The above creates a :ref:`Document`. The instruction `doc = pymupdf.Document("a.pdf")` does exactly the same. So, `open` is just a convenient alias and you can find its full API documented in that chapter.
Copy file name to clipboardExpand all lines: docs/irect.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ IRect is a rectangular bounding box, very similar to :ref:`Rect`, except that al
75
75
Checks whether *x* is contained in the rectangle. It may be :data:`rect_like`, :data:`point_like` or a number. If *x* is an empty rectangle, this is always true. Conversely, if the rectangle is empty this is always ``False``, if *x* is not an empty rectangle and not a number. If *x* is a number, it will be checked to be one of the four components. *x in irect* and *irect.contains(x)* are equivalent.
76
76
77
77
:arg x: the object to check.
78
-
:type x::ref:`IRect` or :ref:`Rect` or :ref:`Point` or int
78
+
:type x::ref:`IRect` or :ref:`Rect` or :ref:`Point` or `int`.
Copy file name to clipboardExpand all lines: docs/matrix.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Matrix
9
9
Matrix is a row-major 3x3 matrix used by image transformations in MuPDF (which complies with the respective concepts laid down in the :ref:`AdobeManual`). With matrices you can manipulate the rendered image of a page in a variety of ways: (parts of) the page can be rotated, zoomed, flipped, sheared and shifted by setting some or all of just six float values.
10
10
11
11
12
-
Since all points or pixels live in a two-dimensional space, one column vector of that matrix is a constant unit vector, and only the remaining six elements are used for manipulations. These six elements are usually represented by *[a, b, c, d, e, f]*. Here is how they are positioned in the matrix:
12
+
Since all points or pixels live in a two-dimensional space, one column vector of that matrix is a constant unit vector, and only the remaining six elements are used for manipulations. These six elements are usually represented by `[a, b, c, d, e, f]`. Here is how they are positioned in the matrix:
Copy file name to clipboardExpand all lines: docs/outline.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
Outline
7
7
================
8
8
9
-
*outline* (or "bookmark"), is a property of *Document*. If not ``None``, it stands for the first outline item of the document. Its properties in turn define the characteristics of this item and also point to other outline items in "horizontal" or downward direction. The full tree of all outline items for e.g. a conventional table of contents (TOC) can be recovered by following these "pointers".
9
+
The document outline (otherwise known as "bookmarks") is a property of :ref:`Document` (see :attr:`Document.outline`). If not ``None``, it stands for the first outline item of the document. Its properties in turn define the characteristics of this item and also point to other outline items in "horizontal" or downward direction. The full tree of all outline items for e.g. a conventional table of contents (TOC) can be recovered by following these "pointers".
**Copy and scale:** Copy *source* pixmap, scaling new width and height values -- the image will appear stretched or shrunk accordingly. Supports partial copying. The source colorspace may be ``None``.
111
111
112
112
:arg source: the source pixmap.
113
-
:type source:``Pixmap``
113
+
:type source::ref:`Pixmap`.
114
114
115
115
:arg float width: desired target width.
116
116
@@ -125,7 +125,7 @@ Have a look at the :ref:`FAQ` section to see some pixmap usage "at work".
125
125
**Copy and add or drop alpha:** Copy *source* and add or drop its alpha channel. Identical copy if *alpha* equals *source.alpha*. If an alpha channel is added, its values will be set to 255.
126
126
127
127
:arg source: source pixmap.
128
-
:type source:``Pixmap``
128
+
:type source::ref:`Pixmap`.
129
129
130
130
:arg bool alpha: whether the target will have an alpha channel, default and mandatory if source colorspace is ``None``.
131
131
@@ -394,7 +394,7 @@ Have a look at the :ref:`FAQ` section to see some pixmap usage "at work".
394
394
Create a Pillow Image from the pixmap. PIL / Pillow must be installed.
@@ -406,7 +406,7 @@ Have a look at the :ref:`FAQ` section to see some pixmap usage "at work".
406
406
407
407
A simple example: `pix.pil_save("some.webp", optimize=True, dpi=(150, 150))`.
408
408
409
-
:arg bool unmultiply: If the pixmap's colorspace is RGB with transparency, the alpha values may or may not already be multiplied into the color components ref/green/blue (called "premultiplied"). To enforce undoing premultiplication, set this parameter to `True`. To learn about some background, e.g. look for "Premultiplied alpha" `here<https://en.wikipedia.org/wiki/Glossary_of_computer_graphics#P>`_.
409
+
:arg bool unmultiply: If the pixmap's colorspace is RGB with transparency, the alpha values may or may not already be multiplied into the color components ref/green/blue (called "premultiplied"). To enforce undoing premultiplication, set this parameter to `True`. To learn about some background, e.g. look for `"Premultiplied alpha" on this page<https://en.wikipedia.org/wiki/Glossary_of_computer_graphics#P>`_.
410
410
411
411
412
412
For details on other parameters see the Pillow documentation.
0 commit comments