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: CHANGELOG.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ This can also be enabled programmatically with `warnings.simplefilter('default',
88
88
*[`FPDF.write_html()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html): `tag_indents` introduced in the last version - Now the indentation can be provided through the `tag_styles` parameter, using the `.l_margin` of `TextStyle` instances
89
89
### Changed
90
90
*[`FPDF.local_context()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.local_context) used to treat `font_size` as a value in points. Now this is the role of `font_size_pt`, whereas `font_size` allows to set the font size into chosen document units (specified with `FPDF(unit=)`) - MR: [#1207](https://github.com/py-pdf/fpdf2/pulls/1207)
91
-
*[`FPDF.circle()`](https://py-pdf.github.io/fpdf2/fpdf.html#fpdf.fpdf.FPDF.circle) : the previous `r` parameter, that in fact defined the diameter, has been replaced by a new `radius`paremeter. The `x` & `y` parameters now define the circle **center**, instead of its top-left corner as it used to be - [issue #1245](https://github.com/py-pdf/fpdf2/issues/1245)
91
+
*[`FPDF.circle()`](https://py-pdf.github.io/fpdf2/fpdf.html#fpdf.fpdf.FPDF.circle) : the previous `r` parameter, that in fact defined the diameter, has been replaced by a new `radius`parameter. The `x` & `y` parameters now define the circle **center**, instead of its top-left corner as it used to be - [issue #1245](https://github.com/py-pdf/fpdf2/issues/1245)
92
92
*[`FPDF.table()`](https://py-pdf.github.io/fpdf2/Tables.html) now raises an error when a single row is too high to be rendered on a single page
93
93
*[`FPDF.write_html()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html): indentation of HTML elements can now be non-integer (float), and is now independent of font size and bullet strings.
94
94
* improved performance of font glyph selection by using functools cache
@@ -572,23 +572,23 @@ This has been fixed, and a warning is now triggered by the [`FPDF.code39`](https
572
572
-[`FPDF.circle`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.circle): new method added, thanks to @viraj-shah18 !
573
573
-`write_html`: support setting HTML font colors by name and short hex codes
utility method to let users know in advance when adding an elemnt will trigger a page break.
576
-
This can be useful to repeat table headers on each page for exemple,
575
+
utility method to let users know in advance when adding an element will trigger a page break.
576
+
This can be useful to repeat table headers on each page for example,
577
577
_cf._[documentation on Tables](https://py-pdf.github.io/fpdf2/Tables.html#repeat-table-header-on-each-page).
578
578
-[`FPDF.set_link`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_link) now support a new optional `x` parameter to set the horizontal position after following the link
579
579
### Fixed
580
580
- fixed a bug when `fpdf.Template` was used to render QRCodes, due to a forced conversion to string (#175)
581
581
582
582
## [2.4.1] - 2021-06-12
583
583
### Fixed
584
-
- erroneous page breaks occured for full-width / full-height images
585
-
- rendering issue of non-ASCII characaters with unicode fonts
584
+
- erroneous page breaks occurred for full-width / full-height images
585
+
- rendering issue of non-ASCII characters with unicode fonts
586
586
587
587
## [2.4.0] - 2021-06-11
588
588
### Changed
589
589
- now `fpdf2` uses the newly supported `DCTDecode` image filter for JPEG images,
590
590
instead of `FlateDecode` before, in order to improve the compression ratio without any image quality loss.
591
-
On test images, this reduced the size of embeded JPEG images by 90%.
591
+
On test images, this reduced the size of embedded JPEG images by 90%.
592
592
-`FPDF.cell`: the `w` (width) parameter becomes optional, with a default value of `None`, meaning to generate a cell with the size of the text content provided
593
593
- the `h` (height) parameter of the `cell`, `multi_cell` & `write` methods gets a default value change, `None`, meaning to use the current font size
594
594
- removed the useless `w` & `h` parameters of the `FPDF.text_annotation()` method
@@ -712,7 +712,7 @@ prevented strings passed first to the text-rendering methods to be displayed.
712
712
## [2.0.4] - 2020-03-26
713
713
### Fixed
714
714
* images centering - thanks `cgfrost`!
715
-
* added missing import statment for `urlopen` in `image_parsing` module
715
+
* added missing import statement for `urlopen` in `image_parsing` module
716
716
* changed urlopen import from `six` library to maintain python2 compatibility
Copy file name to clipboardexpand all lines: docs/Development.md
+9-2
Original file line number
Diff line number
Diff line change
@@ -208,6 +208,15 @@ static code analysis with `pylint`, unit tests...
208
208
_Pull Requests_ submitted must pass all those checks in order to be approved.
209
209
Ask maintainers through comments if some errors in the pipeline seem obscure to you.
210
210
211
+
### typos
212
+
[typos](https://github.com/crate-ci/typos) is a handy CLI tool to detect & auto-fix [typos](https://en.wikipedia.org/wiki/Typographical_error) in source files.
213
+
Installation is relatively straightfoward ([read the docs](https://github.com/crate-ci/typos?tab=readme-ov-file#install)).
214
+
215
+
This tool is invoked in our CI pipeline.
216
+
If it fails, you should either:
217
+
* auto-fix the errors detected by invoking `typos --write-changes`
218
+
* add an exclusion rule to `.typos.toml`
219
+
211
220
### Release checklist
212
221
1. complete `CHANGELOG.md` and add the version & date of the new release
213
222
2. bump `FPDF_VERSION` in `fpdf/fpdf.py`.
@@ -261,7 +270,6 @@ there are still many PDF features that this library does not support.
261
270
## Useful tools to manipulate PDFs
262
271
263
272
### qpdf
264
-
265
273
[qpdf](https://qpdf.sourceforge.io/) is a very powerful tool to analyze PDF documents.
266
274
267
275
One of it most useful features is the [QDF mode](https://qpdf.readthedocs.io/en/stable/qdf.html) that can convert any PDF file to a human-readable, decompressed & annotated new PDF document:
Copy file name to clipboardexpand all lines: docs/EmojisSymbolsDingbats.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -75,4 +75,4 @@ For reference, it was built using this script: [zapfdingbats.py](zapfdingbats.py
75
75
76
76
## Fallback fonts ##
77
77
78
-
If you need to mix special characters and emojis within normal text, it is possible to specify alternative fonts for FPDF to use as fallback fonts. See an exemple of use [Here](Unicode.md#fallback-fonts)
78
+
If you need to mix special characters and emojis within normal text, it is possible to specify alternative fonts for FPDF to use as fallback fonts. See an example of use [Here](Unicode.md#fallback-fonts)
_New in [:octicons-tag-24: 2.8.0](https://github.com/py-pdf/fpdf2/blob/master/CHANGELOG.md)_
182
182
183
183
Page breaks can be triggered explicitly using the [break-before](https://developer.mozilla.org/en-US/docs/Web/CSS/break-before) or [break-after](https://developer.mozilla.org/en-US/docs/Web/CSS/break-after) CSS properties.
Copy file name to clipboardexpand all lines: docs/Patterns.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -119,9 +119,9 @@ Both linear and radial gradients support **multiple colors**. If you pass, for e
119
119
For **linear gradients** or **radial gradients**, passing `bounds=[0.2, 0.4, 0.7, ...]` (values between 0 and 1) fine-tunes where each color transition occurs. For instance, if you have 5 colors, you can specify 3 boundary values that partition the color progression among them.
120
120
121
121
For example, taking a gradient with 5 colors and `bounds=[0.1, 0.8, 0.9]`:
122
-
- The transition from color 1 to color 2 start at the beggining (0%) and ends at 10%
123
-
- The transition from color 2 to color 3 start at 10% and ends at 80%
124
-
- The transition from color 3 to color 4 start at 80% and ends at 90%
125
-
- The transition from color 4 to color 5 start at 90% and goes to the end (100%)
122
+
- The transition from color 1 to color 2 starts at the beginning (0%) and ends at 10%
123
+
- The transition from color 2 to color 3 starts at 10% and ends at 80%
124
+
- The transition from color 3 to color 4 starts at 80% and ends at 90%
125
+
- The transition from color 4 to color 5 starts at 90% and goes to the end (100%)
126
126
127
127
In other words, each boundary value dictates where the color transitions will occur along the total gradient length.
Copy file name to clipboardexpand all lines: docs/Text.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ With supporting Unicode fonts, `fpdf2` should handle the following text shaping
30
30
There are a few advanced typesetting features that `fpdf2` doesn't currently support:
31
31
32
32
* Contextual forms - In some writing systems (eg. Arabic, Mongolian, etc.), characters may take a different shape, depending on whether they appear at the beginning, in the middle, or at the end of a word, or isolated. Fpdf will always use the same standard shape in those cases.
33
-
* Vertical writing - Some writing systems are meant to be written vertically. Doing so is not directly supported. In cases where this just means to stack characters on top of each other (eg. Chinese, Japanese, etc.), client software can implement this by placing each character individuall at the correct location. In cases where the characters are connected with each other (eg. Mongolian), this may be more difficult, if possible at all.
33
+
* Vertical writing - Some writing systems are meant to be written vertically. Doing so is not directly supported. In cases where this just means to stack characters on top of each other (eg. Chinese, Japanese, etc.), client software can implement this by placing each character individually at the correct location. In cases where the characters are connected with each other (eg. Mongolian), this may be more difficult, if possible at all.
34
34
35
35
### Character or Word Based Line Wrapping
36
36
By default, `multi_cell()` and `write()` will wrap lines based on words, using space characters and soft hyphens as separators.
Copy file name to clipboardexpand all lines: docs/TextRegion.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ All types of text regions have the following constructor parameters in common:
58
58
*`image` (str or PIL.Image.Image or io.BytesIO, optional) - An image to add to the region. This is a convenience parameter for cases when no further text or images need to be added to the paragraph. If both `text` and `image` arguments are present, the text will be inserted first. (Default: None)
59
59
*`image_fill_width` (bool, optional) - Indicates whether to increase the size of the image to fill the width of the column. Larger images will always be reduced to column width. (Default: False)
60
60
61
-
All of those values can be overriden for each individual paragraph.
61
+
All of those values can be overridden for each individual paragraph.
Copy file name to clipboardexpand all lines: docs/TextShaping.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ _New in [:octicons-tag-24: 2.7.5](https://github.com/py-pdf/fpdf2/blob/master/CH
7
7
## What is text shaping? ##
8
8
Text shaping is a fundamental process in typography and computer typesetting that influences the aesthetics and readability of text in various languages and scripts. It involves the transformation of Unicode text into glyphs, which are then positioned for display or print.
9
9
10
-
For texts in latin script, text shaping can improve the aesthetics by replacing characters that would colide or overlap by a single glyph specially crafted to look harmonious.
10
+
For texts in latin script, text shaping can improve the aesthetics by replacing characters that would collide or overlap by a single glyph specially crafted to look harmonious.
Copy file name to clipboardexpand all lines: docs/TextStyling.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ This method changes the distance between individual characters of a test string.
53
53
54
54
Character spacing works best for formatting single line text created by any method, or for highlighting individual words included in a block of text with `.write()`.
55
55
56
-
**Limitations**: Spacing will only be changed *within* a sequence of characters that `fpdf2` adds to the PDF in one go. This means that there will be no extra distance _eg._ between text parts that are placed successivly with `write()`. Also, if you apply different font styles using the Markdown functionality of `.cell()` and `.multi_cell()` or by using `html_write()`, then any parts given different styles will have the original distance between them. This is so because `fpdf2` has to add each styled fragment to the PDF file seperately.
56
+
**Limitations**: Spacing will only be changed *within* a sequence of characters that `fpdf2` adds to the PDF in one go. This means that there will be no extra distance _eg._ between text parts that are placed successively with `write()`. Also, if you apply different font styles using the Markdown functionality of `.cell()` and `.multi_cell()` or by using `html_write()`, then any parts given different styles will have the original distance between them. This is so because `fpdf2` has to add each styled fragment to the PDF file separately.
57
57
58
58
The example shows the same text justified to the same width, with char_spacing values of 0 and 10 (font size 8 pt).
Copy file name to clipboardexpand all lines: docs/Unicode.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Besides the limited set of latin fonts built into the PDF format, `fpdf2` offers
5
5
To make use of that functionality, you have to install at least one Unicode font, either in the system font folder or in some other location accessible to your program.
6
6
For professional work, many designers prefer commercial fonts, suitable to their specific needs. There are also many sources of free TTF fonts that can be downloaded online and used free of cost (some of them may have restrictions on commercial redistribution, such as server installations or including them in a software project).
7
7
8
-
*[Font Library](https://fontlibrary.org/) - A collection of fonts for many languates with an open source type license.
8
+
*[Font Library](https://fontlibrary.org/) - A collection of fonts for many languages with an open source type license.
9
9
10
10
*[Google Fonts](https://fonts.google.com/) - A collection of free to use fonts for many languages.
11
11
@@ -214,5 +214,5 @@ When a glyph cannot be rendered uing the current font,
214
214
By default, if it does not find such matching font, the character will not be rendered using any fallback font. This behaviour can be relaxed by passing `exact_match=False` to [`set_fallback_fonts()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_fallback_fonts).
215
215
216
216
Moreover, for more control over font fallback election logic,
217
-
the [`get_fallback_font()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.get_fallback_font) can be overriden.
217
+
the [`get_fallback_font()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.get_fallback_font) can be overridden.
218
218
An example of this can be found in [test/fonts/test_font_fallback.py](https://github.com/py-pdf/fpdf2/blob/master/test/fonts/test_font_fallback.py).
0 commit comments