1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 08:27:22 +03:00
Commit Graph

3517 Commits

Author SHA1 Message Date
Konstantin Alekseev
1571528da3 dlopen shared library symlink using major version name.
cffi.dlopen should use .so.N symlinks instead of .so to
make sure we load ABI compatible version of the library and
the same library used by the rest of the system.

cffi uses `ctypes.util.find_library` to search for libraries
and the docs for `find_library` states that
"The exact functionality is system dependent."
so different system may expect different names for the same library.

To overcome that problem we try to load several names until success
among these names exact file name with `.so` suffix
eg. `libcairo.so` but .so symlink is not always safe to use.

Shared library usually consist of two of three files:
- libcairo.so.N.M - N.M exact version number
- libcairo.so.N - symlink to library.so.N.M with major ABI version
- libcairo.so - symlink to library.so.N

When -lcairo flag is used linker search for libcairo.so,
but when the programm loaded it loads libcairo.so.N where N
is the version that it was linked with.

Some downsides of .so usage:
- .so may point to the wrong ABI version, e.g. we expect libcairo
  version 2 but libcairo.so points at libcairo.so.1
- usually .so files are shipped with development packages `-dev`
  in debian and `-devel` in centos and they are just symlinks
  to the .so.N files. So it safer to search for .so.N files they
  will exist even if dev package is not installed.
- hard symlink .so -> .so.N not always preserved, eg. if we zip
  them we get two copies of the library and while the rest of the
  system will use .so.N file we will load .so files that may lead
  to crash
2020-05-03 22:01:41 +03:00
Guillaume Ayoub
29309aa673 Don’t display template tags
Fix #1080.
2020-04-13 11:44:37 +02:00
Guillaume Ayoub
fda14c0ff4 Fix typo 2020-04-10 14:07:12 +02:00
Guillaume Ayoub
b1b5e3ee98 Simplify renderer’s argparse code
Related to #1099.
2020-04-10 13:50:33 +02:00
Guillaume Ayoub
d7b26e3b6f
Merge pull request #1099 from eyseman/feature-WeasyPrint-v51
added function for port specification
2020-04-10 13:42:20 +02:00
Thomas J. Lampoltshammer
61b4865bec
added function for port specification
Added a new function which allows the user to select a specific port. If no port is specified, port 5000 is used as default port.
2020-04-10 10:53:52 +02:00
Guillaume Ayoub
ee316cdb78
Merge pull request #1096 from hejsan/signature-support
Digital signature support
2020-04-09 09:49:10 +02:00
Bjarni Þórisson
74d5c4faf1 remove trailing whitespace 2020-04-09 00:51:15 +00:00
Bjarni Þórisson
fb867f9b4e Support for post-processing by passing a finisher function to write_pdf 2020-04-08 23:46:11 +00:00
Guillaume Ayoub
ba1abecc31 Fix column background position for rtl tables
Related to #1097.
2020-04-08 15:31:24 +02:00
Guillaume Ayoub
c22fcb1b36 Add failing test 2020-04-08 14:28:57 +02:00
Guillaume Ayoub
15e0314405 Fix names and comments for table tests 2020-04-08 13:40:23 +02:00
Guillaume Ayoub
dca03a92af
Merge pull request #1097 from mohdnajdy/rtl_tables
cover more rtl tests
2020-04-07 16:15:58 +02:00
Mohammed Y. Alnajdi
0d55bd9307 cover more rtl tests 2020-04-07 12:36:29 +03:00
Guillaume Ayoub
2e7031fe71 Merge branch 'master' into rtl_tables 2020-04-06 18:13:12 +02:00
Bjarni Þórisson
9575595b55 Added hooks to support Digital Signatures and allowed for writing multiple trailers.
Upped version number
2020-04-06 15:15:25 +00:00
Guillaume Ayoub
f50feef83f Fix positions of rtl rows, row groups and colspan cells 2020-04-06 14:11:06 +02:00
Guillaume Ayoub
079f21251d Revert "Try not to use DejaVu fonts for Windows tests"
This reverts commit 9ae77aff62.
2020-04-05 23:10:14 +02:00
Guillaume Ayoub
9ae77aff62 Try not to use DejaVu fonts for Windows tests 2020-04-05 23:00:41 +02:00
Guillaume Ayoub
6ad3bae86a Fix some flex tests 2020-04-05 22:56:40 +02:00
Guillaume Ayoub
bac3d8c064 Remove workaround for tests on macOS
The bug related to fonts separated by commas is now fixed in Pango for macOS.
2020-04-05 14:47:40 +02:00
Guillaume Ayoub
b33a8d11d4 Fix the footer repetition on split tables
Fix #1027.

Footers of split tables have a wrong position: they keep their position before
splitting the table. This commit is an improvement (it doesn’t crash anymore,
data are OK on each page) but it’s far from perfect.

We also have to take care of absolute and fixed elements in footers. It’s
probably already broken (see related #138), so…

TODOs have been added where things have to be improved.
2020-04-03 21:44:27 +02:00
Guillaume Ayoub
21b534ea0b Fix complex table break test 2020-04-03 19:24:07 +02:00
Guillaume Ayoub
cbf31172cd Merge branch 'master' of github.com:Kozea/WeasyPrint 2020-04-02 16:50:55 +02:00
Guillaume Ayoub
da146c639a Don’t try to break tables after the header or before the footer
Related to #1027.
2020-04-02 16:49:48 +02:00
Guillaume Ayoub
87b24f2859
Merge pull request #1061 from mPyth/patch-1
Update instructions for install on Windows
2020-04-02 10:12:20 +02:00
Guillaume Ayoub
880e9e2eaa
Merge pull request #1089 from bartbroere/patch-1
Try fixing a bug encountered when using weasyprint in Pyinstaller context
2020-03-27 15:48:32 +01:00
Bart Broere
9e90c91535
Try fixing a bug encountered when using weasyprint in Pyinstaller context 2020-03-25 18:43:05 +01:00
Guillaume Ayoub
ab47de3a27 Remove useless assert
Related to #1083.
2020-03-22 11:18:27 +01:00
Guillaume Ayoub
5f780ea83b Merge branch 'master' of github.com:Kozea/WeasyPrint 2020-03-22 11:10:06 +01:00
Guillaume Ayoub
9db50fe234 Fix warnings in Travis file 2020-03-22 11:09:09 +01:00
Guillaume Ayoub
bd08ab2c94
Merge pull request #1083 from FelixSchwarz/master
HTML: prevent FutureWarning from xml.etree.ElementTree.Element
2020-03-22 11:08:00 +01:00
Felix Schwarz
dd48b5004c HTML: prevent FutureWarning from xml.etree.ElementTree.Element
__bool__()/__nonzero__() is deprecated and raises a FutureWarning. This warning
is usually not visible with CPython. However it is highly irritating with
pypy3 (v7.1.1).
2020-03-22 08:31:25 +01:00
Guillaume Ayoub
aeb00c576b Only apply text-indent to lineboxes
Fix #1000.
2020-03-16 23:55:39 +01:00
Guillaume Ayoub
22187402d7 Explicitely list included packages
Setuptools doesn’t automatically find packages with no __init__.py file. We
have to manually list packages to avoid this limitation, for example for
ReadTheDocs installations.
2020-03-16 17:56:57 +01:00
Guillaume Ayoub
736639dfcb Fix condition avoiding line recalculation
At the end of a linebox layout, we have to check that the new linebox has the
same position as the originally calculated one. If the position is different,
it means that a floating element needs to push the linebox to a lower position.

With ltr lines, the box horizontal position is calculated related to the left
border of the box. It’s different with rtl lines, because the left border has
to be translated to the left each time the linebox width changes. We thus need
to rely on the right border for rtl lines.
2020-03-15 01:06:59 +01:00
Guillaume Ayoub
6d9b9aa7fa Use start/end instead of left/right to define text alignment offset
As the rtl lineboxes are now right aligned (just like any other block-level
box), we don’t have to take care about direction when calculating offset.

Text is now translated when text-align is different from start. It’s translated
to the right with ltr and to the left with rtl.
2020-03-15 01:06:54 +01:00
Guillaume Ayoub
1419e9433d Fix borders for rtl tables 2020-03-14 23:09:23 +01:00
Guillaume Ayoub
97c0ebf14e Fix tests for rtl tables
When tables are in rtl direction, their columns are mirrored.
2020-03-14 23:08:51 +01:00
Guillaume Ayoub
8d3e3d485b Handle rtl when drawing tables 2020-03-14 19:25:07 +01:00
Guillaume Ayoub
b06406d4d3 Handle rtl when avoiding floats 2020-03-14 19:24:31 +01:00
Guillaume Ayoub
ba4079d9a3 Fix and test position of columns in rtl tables 2020-03-14 18:27:41 +01:00
Guillaume Ayoub
1b6a41b6ed Set rtl on body to test rtl tables
This setup moves the table to the right, we’re thus able to test real-life rtl
tables in rtl documents.
2020-03-14 18:26:35 +01:00
Guillaume Ayoub
4e7ced8c04 Merge branch 'mohdnajdy-rtl-table-borders' into rtl_tables 2020-03-14 17:02:05 +01:00
Guillaume Ayoub
c44a9a7459 Merge branch 'rtl-table-borders' of https://github.com/mohdnajdy/WeasyPrint into mohdnajdy-rtl-table-borders 2020-03-14 17:01:03 +01:00
Guillaume Ayoub
86fb08c0f3 Merge branch 'rtl-table-direction' of https://github.com/mohdnajdy/WeasyPrint into mohdnajdy-rtl-table-direction 2020-03-14 17:00:27 +01:00
Guillaume Ayoub
a756ea121f Merge branch 'master' of github.com:Kozea/WeasyPrint 2020-03-14 16:53:57 +01:00
Guillaume Ayoub
42d802da4f Use high-level functions to create temprorary files
Using low-level functions forces us to handle low-level file descriptors and
encodings, while we could safely rely on Python for that.

Related to #1074.
2020-03-14 16:51:41 +01:00
Guillaume Ayoub
a430b30322 Use filesystem encoding instead of ASCII for fonts config files
This is needed when temporary filenames are generated with non-ASCII
characters.

Close #1074.
2020-03-14 16:50:01 +01:00
Guillaume Ayoub
2b7ec23c5e
Merge pull request #1072 from gentooboontoo/drop-extraneous-font-config
Drop extraneous font matching
2020-03-14 16:19:21 +01:00