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

1896 Commits

Author SHA1 Message Date
Guillaume Ayoub
c813d45d61 First naive version of text-overflow support 2019-07-03 15:37:29 +02:00
Guillaume Ayoub
57f216cb91 Clean some code in draw module 2019-06-25 16:13:11 +02:00
Gabriel Corona
ef5c99a360 Implement text-decoration: wavy 2019-06-24 21:02:25 +02:00
Guillaume Ayoub
668ca840c7 Minor style fixes 2019-06-22 21:49:28 +02:00
Guillaume Ayoub
ae43048a49
Merge pull request #869 from randomstuff/text-decoration
Fix broken dash/dotted pattern in text-decoration with inline elements
2019-06-22 21:46:41 +02:00
Guillaume Ayoub
923e45b717 Add test for #885. 2019-06-22 21:43:08 +02:00
Guillaume Ayoub
5e0f6d494f Actually use the content box to resolve flex items percentages
Fix #885.
2019-06-22 21:37:27 +02:00
Guillaume Ayoub
8499379dd1 Don't repeat background images when it's not needed
For now, we only avoid the repetition when we have no-repeat for x and y
axes. We could do this when the painting area is smaller than the image and
when the position doesn't require a repetition. But… Who cares?

Fix #238.

There was also a bug in the size of the surface needed to draw images that are
not repeated. Before this commit, the repeat size was the painting size * 2 to
avoid glitches at the boundaries. But we have to be sure to draw at least the
whole image, as the image may be translated before being drawn. The
multiplication is not needed as we don't repeat the image anymore.

Related to #669.
2019-06-02 23:03:19 +02:00
Guillaume Ayoub
9f442be640 Move percentage function into percentages module 2019-06-02 18:06:25 +02:00
Guillaume Ayoub
846515b109 Merge branch 'master' of github.com:Kozea/WeasyPrint 2019-06-02 17:55:51 +02:00
Guillaume Ayoub
ef74806c8d
Merge pull request #875 from mbarkhau/feature_object_fit_and_pos
Feature object-fit and object-position
2019-06-02 17:55:05 +02:00
Guillaume Ayoub
dd6572b999 Simplify parse_pixels 2019-06-02 17:50:38 +02:00
Manuel Barkhau
f48fbf0923 lint fix 2019-06-02 16:18:56 +02:00
Manuel Barkhau
ce8ab0f4f0 use object-position for layout of images 2019-06-02 16:16:51 +02:00
Manuel Barkhau
d687c12ff7 refactor: add and use parse_pixels in tests 2019-06-02 12:40:45 +02:00
Manuel Barkhau
601b20864c add css parsing for object-position 2019-06-01 01:44:30 +02:00
Manuel Barkhau
20afa51175 refactor: factor out "precentage" function 2019-06-01 01:39:40 +02:00
Manuel Barkhau
9f61cd688b Add object-fit parsing and layout 2019-06-01 01:39:40 +02:00
Guillaume Ayoub
ec4504d23f Set a minimum height for empty list elements with outside marker
The spec says that we can do what we want to improve the rendering in such
cases. Adding a line would probably give exactly the same rendering as if there
were text, but the difference is so small that there's no need to hack the
formatting structure and keep the fix in 3 small lines during the layout.

Fix #873.
2019-05-31 16:56:52 +02:00
Guillaume Ayoub
9b2cbb8943 Remove testing code 2019-05-31 07:19:43 +02:00
Guillaume Ayoub
d753b301a1 Always set outside_list_marker property on boxes 2019-05-31 07:18:25 +02:00
Guillaume Ayoub
a23d4658fc Set marker layout only when needed 2019-05-31 06:36:41 +02:00
Guillaume Ayoub
2ce03092f1 Small code and style improvements around bookmark-state
Related to #870.
2019-05-23 23:55:56 +02:00
Guillaume Ayoub
e881b66859
Merge pull request #870 from randomstuff/bookmark-state
Implement bookmark-state support
2019-05-23 23:15:37 +02:00
Guillaume Ayoub
37e788e8c3 Force SVG size
Related to #867.
2019-05-20 12:31:30 +02:00
Gabriel Corona
34127350b6 Implement bookmark-state support 2019-05-19 19:31:32 +02:00
Gabriel Corona
e704b8f8e2 Fix broken dashed/dotted pattern in text-decoration with inline elements
Example:

~~~html
<style>
p {
  text-decoration: underline green dotted;
}
span {
  color: red;
  text-decoration: underline red dotted;
}
</style>

<p> Lorem <span>ipsum</span> dolor sit amet, <span>consectetur</span>
  adipiscing elit, sed do eiusmod tempor <span>incididunt</span> ut
  labore et dolore <span>magna aliqua</span>. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
  commodo consequat. Duis aute irure dolor in reprehenderit in
  voluptate velit esse cillum dolore eu fugiat nulla
  pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
  culpa qui officia deserunt mollit anim id est laborum.</p>
~~~
2019-05-18 00:17:38 +02:00
Guillaume Ayoub
76479de01f Don't align lines larger than their parents
Related to #867.
2019-05-17 16:19:42 +02:00
Guillaume Ayoub
9012888df2 Set inline table baseline
"The baseline of an 'inline-table' is the baseline of the first row of the
table."

Related to #867.
2019-05-17 15:49:13 +02:00
Guillaume Ayoub
58770563be Set row baseline when no cells are baseline-aligned
"If a row has no cell box aligned to its baseline, the baseline of that row is
the bottom content edge of the lowest cell in the row."

Related to #867.
2019-05-17 13:03:02 +02:00
Guillaume Ayoub
99f85beac6 Don't use translations to align flex items
As the children's layout has not been done yet, their own children are not yet
positioned and thus can't be translated. We have to change the child position
instead and let the child layout move its own children.

Fix #811.
2019-05-16 11:06:28 +02:00
Guillaume Ayoub
36630ab532 Don't change position of block children to avoid rounded float error
To fix #860 and #851, we decided to move block children a little bit to keep
them in the page. It's a bad idea, because children position is altered (and it
breaks many tests, by the way).

Increasing the allowed max_position_y is a better workaround as it doesn't
move blocks.
2019-05-15 13:39:05 +02:00
Guillaume Ayoub
75cf2b61eb Don't cut pages when content overflows a very little bit
Here's another floating point rounding error we have to deal with. The original
issue comes from flex layout, but there are probably plenty of rounding
problems in other flows, so it's safe to put the workaround here.

Fix #851.
2019-05-15 12:02:04 +02:00
Guillaume Ayoub
b88cf3654b Add documentation for text decoration 2019-05-14 23:45:53 +02:00
Guillaume Ayoub
b5cdddfb3f Minor code style changes 2019-05-14 23:35:26 +02:00
Guillaume Ayoub
9fcfdfc24c Ignore wavy value for text-decoration-style
Ignoring values can help to use stylesheets with fallbacks, and it's better to
log these values than to silently ignore them.
2019-05-14 23:33:50 +02:00
Guillaume Ayoub
ed2f4f384a Allow blink as a text-decoration value
It will only be ignored while drawing, but it doesn't harm to keep the value
and makes code and tests more readable.

Also use a set instead of a frozenset to store text-decoration-line, bringing
more readability even if it may be a little, little, little bit slower.
2019-05-14 23:31:27 +02:00
Guillaume Ayoub
f5373db74e
Merge pull request #855 from randomstuff/text-decoration
Add support for full CSS3 text-decoration [RFC]
2019-05-14 18:11:43 +02:00
Guillaume Ayoub
840c4a6d92 Don't crash when using UTC timezones
Fix #862.
2019-05-14 15:32:17 +02:00
Gabriel Corona
9a73fff1cf Add support for full CSS3 text-decoration
* parse text-decoration as shorthand
* draw different colors
* basic text-decoration-style
* no 'wavy' support for now
2019-04-29 21:13:01 +02:00
Guillaume Ayoub
2fa7c2fc18 Version 47 2019-04-12 16:45:24 +02:00
Guillaume Ayoub
5ffdc8270a Update default_url_fetcher's documentation 2019-04-12 16:34:19 +02:00
Guillaume Ayoub
cc512b3ec0 Fix line breaking tests 2019-04-12 16:27:33 +02:00
Guillaume Ayoub
039b0a680d Don't rely on iter_get_index to get current line break index
pango_layout_iter_get_index gives the visual order, not the logical order, so
we can't rely on this to fix the line break index.

Fix #828.
2019-04-12 16:04:25 +02:00
Guillaume Ayoub
5ceddcb2ca
Merge pull request #843 from Kozea/variables
Add CSS variables
2019-04-10 13:46:28 +02:00
Guillaume Ayoub
5a2553e893
Merge pull request #846 from Kozea/nth-page
Support the `:nth()` page selector.
2019-04-10 13:46:18 +02:00
mohdnajdy
87d586f431
remove ssl import 2019-04-04 15:12:05 +03:00
mohdnajdy
afc244123f
set parameter name to ssl_context and pass directly to urlopen 2019-04-04 15:04:05 +03:00
mohdnajdy
35389682a9
fixed issue of line to long 2019-04-04 14:49:30 +03:00
mohdnajdy
81f0002233
fixed import order 2019-04-04 14:41:04 +03:00