1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 16:37:47 +03:00
Commit Graph

973 Commits

Author SHA1 Message Date
Guillaume Ayoub
fac5ee94e5 Don't split a line when drawing it
To draw a text line, the previous behaviour didn't rely only on the text
actually set on the layout, but also relied on the fact that the line
was cut again when drawn. This change removes the line cutting when
drawing, and thus only relies on the line splitting done during the
layout. This fixes a bug causing some words not being displayed at the
end of a text line drawn with hinting, and the actual drawing size with
hinting was bigger than the size calculated during the layout.

The text included in the drawn layout object was sometimes not cut at
the right position, it was longer but cut when actually drawn. This
commit also fixes this, by always setting the right text in the layout
object.

Fixing this bug enables us to remove a hack introduced to fight against
an "accumulation of floating point errors". I now think that "it wasn't
our war"™. I think that the real reasons of this hack were probably:

- a problem with trailing spaces in the shrink-to-fit functions fixed in
  commit 3a620db, and
- this line-cutting bug while drawing, fixed now.

I've tried hard to reproduce the shink-to-fit problem without this hack,
with no success. I don't see anymore how it can theorically happen with
the current code of the "preferred" module. The only bug fixed by this
hack that I've been able to reproduce is the hinting problem explained
in the first paragraph, and this bug is now really fixed.

Moreover, this hack used to cause another problem: as the maximum size
allowed to an inline block was actually bigger than the real size
available in the line, an inline block whose size was between the real
and the allowed sizes was put on a new line by the split_inline_box
function. This commit fixes #288, the bug reported about this problem.
2016-01-01 16:48:15 +01:00
Guillaume Ayoub
d09ba47ac2 Fix attachments support for command line
How about quality control and unit tests? Well, tests have been added,
wow, such hope they are many helpful.

Oh, and it probably fixes #286.
2015-12-31 13:22:30 +01:00
Guillaume Ayoub
c47ed0c8f6 Version 0.25 2015-12-17 12:01:34 +01:00
Guillaume Ayoub
e06d44d0d3 Fix a dirty bug in line splitting (fix #285) 2015-12-16 19:04:53 +01:00
Guillaume Ayoub
0719aa096b Fix pdf_escape for python 2 again 2015-12-16 18:45:41 +01:00
Guillaume Ayoub
ff04ba8513 Fix pdf_escape for Python 2 2015-12-16 18:29:20 +01:00
Guillaume Ayoub
36338b4067 Escape parenthesis in URIs when generating PDFs
Fix #284
2015-12-16 17:16:10 +01:00
Guillaume Ayoub
09e14e5820 Fix typo 2015-12-16 13:50:04 +01:00
Alex Eftimie
93f497bf11 Replace utf8 with utf-8 for gettext compatibility 2015-11-25 09:38:01 +02:00
Guillaume Ayoub
b2688808a1 Fix flake8 again 2015-11-20 23:46:47 +01:00
Guillaume Ayoub
a310c61353 Fix a stupid flake8 error 2015-11-20 23:39:10 +01:00
Guillaume Ayoub
c582ac2c19 Merge branch 'master' of github.com:Kozea/WeasyPrint 2015-11-18 13:33:37 +01:00
Andrew Leech
a145bd12f6 Fix formatting to satisfy flake8 2015-09-28 14:08:41 +10:00
Andrew Leech
f44ae6d85f Add support for use when frozen
Use appropriate path to find resource when frozen (using py2exe etc.)
2015-09-25 11:30:56 +10:00
Guillaume Ayoub
ccfe7b76e0 Add the 'q' unit 2015-08-14 17:03:59 +02:00
Guillaume Ayoub
f0da0374bf Don't crash when attachments are not available (fix #250) 2015-08-14 13:51:56 +02:00
Simon Sapin
f5edde6c67 v0.24 2015-08-04 16:33:05 +02:00
Thomas Grainger
8c0a97a37d Fix ressource typo 2015-07-01 00:01:43 +01:00
Guillaume Ayoub
492619662f Fix some wrong conflict resolutions for table borders with inset and outset styles 2015-05-31 10:09:34 +02:00
Guillaume Ayoub
2d7f68e8a1 Use the same simple code for bookmark-labels and string-sets 2015-05-01 21:14:10 +02:00
Guillaume Ayoub
f0889c2589 Fix attr() and allow counters in string-set and bookmark-label 2015-05-01 20:28:42 +02:00
Guillaume Ayoub
862c334036 Don't try to compute attr() as it's been already replaced in computed_values 2015-05-01 11:14:24 +02:00
Guillaume Ayoub
273506d0ad Allow attr() in bookmark-label and string-set 2015-05-01 11:06:54 +02:00
Guillaume Ayoub
3a17bfa86e Remove useless import 2015-05-01 00:13:31 +02:00
Guillaume Ayoub
17abfbd1c9 Fix some comments 2015-05-01 00:12:43 +02:00
Guillaume Ayoub
f78eb3763e Use the <content-list> defined in GCPM for string-set and bookmark-label
In this content-list, here are the possibilities:
- string: implemented
- counter/counters: not implemented, but easily possible
- content: implemented (but what's exactly the "string value of an element"?)
- attr: not implemented (I don't know how to do this)
2015-04-30 21:54:19 +02:00
Guillaume Ayoub
0daaec844f Test the string-set property syntax 2015-04-30 14:41:25 +02:00
Guillaume Ayoub
c68240c5f4 Fix some pyflakes warnings 2015-04-30 10:58:51 +02:00
Guillaume Ayoub
790af1481a Merge pull request #246 from E-M-P-I-R-E/master
Support for named strings in margin-boxes
2015-04-30 10:30:23 +02:00
Guillaume Ayoub
94ca04812e Cut long line 2015-04-29 09:32:33 +02:00
Guillaume Ayoub
a97014c9af Remove useless if-block when validating the line-height property 2015-04-29 08:35:24 +02:00
Guillaume Ayoub
01a5ce742f Don't allow unknown units during line-height validation (fix #225) 2015-04-28 23:56:41 +02:00
Guillaume Ayoub
b4c43608fc Remove a useless nesting level 2015-04-28 23:11:22 +02:00
Johannes Duschl
94067db7ca This should fix #202. 2015-04-28 19:19:44 +02:00
Guillaume Ayoub
187e6d16b3 Draw rounded corners on replaced boxes (fix #207) 2015-04-25 20:00:20 +02:00
Guillaume Ayoub
4816788837 Merge pull request #224 from liZe/text-hack
Rely on the font size for rounding bug workaround
2015-04-25 19:13:43 +02:00
Guillaume Ayoub
f0e0829677 Fix PEP8 2015-04-25 19:05:53 +02:00
Guillaume Ayoub
8f11d27e48 Make the linear-gradient test require cairo-1.14 and other small test fixes 2015-04-25 18:36:39 +02:00
Guillaume Ayoub
6e82d6563e Merge branch 'master' of github.com:Kozea/WeasyPrint 2015-04-25 17:51:17 +02:00
Guillaume Ayoub
4ed0c3c987 Test vertical-align property in tables (fix #31) 2015-04-25 17:48:08 +02:00
Guillaume Ayoub
f4f8c252a7 Honor vertical-align for fixed-height cells (related to #31) 2015-04-25 15:16:47 +02:00
Guillaume Ayoub
54fde80346 Fix some tests relying on installed fonts 2015-04-24 23:55:06 +02:00
Guillaume Ayoub
b5080d2cc2 Make a linear-gradient test work with Cairo 1.14.x 2015-04-24 23:31:39 +02:00
Guillaume Ayoub
40413b06e0 Fix hyphenation tests by using ahem 2015-04-24 23:27:55 +02:00
Mike Z. Salem
a8a0141902 More changes for named strings [3]
PEP8/flake8 compliance again (sorry)
2015-03-22 00:30:38 -04:00
Mike Z. Salem
c603e92b55 More changes for named string support
Pep8/flake8 conformance
2015-03-21 19:24:13 -04:00
Mike Z. Salem
d4ce068854 More changes for named string support
Reinstate support for psuedo elements as an arugument to `content()`
Have to check if a box is a `ParentBox` when using `decendants()` in `TEXT_CONTENT_EXTRACTORS` for psuedo elements because it was returning the value twice in a row (ex. "stringstring")
2015-03-21 18:54:14 -04:00
Mike Z. Salem
abb560a762 PEP8/flake8 compliance 2015-03-21 00:50:22 -04:00
Mike Z. Salem
6e48c2e878 Set string-set default to 'none', altered validation & resolution [do nothing in that case]
Added validation to the second argument to `string()`
More info./discussion here: https://github.com/Kozea/WeasyPrint/pull/246#issuecomment-83994925
2015-03-21 00:08:12 -04:00
Mike Z. Salem
7db9be4005 Remove support of string set using psuedo elements. Was unsure of the change to the function in build.TEXT_CONTENT_EXTRACTORS. That would be part of the text anyways.
Combined test functions to conform to coding style of other tests.
2015-03-19 23:03:57 -04:00