Simon Sapin
0444be5fba
Fix PDF metadata with zoom != 1
2012-11-22 22:49:30 +01:00
Simon Sapin
e9013d0470
Add a test for PDF zoom.
2012-11-22 22:36:51 +01:00
Simon Sapin
85bbfa9258
Rename PDF scale to zoom, have the default be 1 rather than 0.75
...
The 0.75 factor is an implementation detail that should not be exposed
in the API.
2012-11-22 22:31:26 +01:00
Guillaume Ayoub
d2dea8ed56
Fix the size of the first line
2012-11-22 21:23:42 +01:00
Guillaume Ayoub
8c6f6a8189
Remove the width of space-character containers when line breaks are not preserved
2012-11-22 21:23:04 +01:00
Guillaume Ayoub
0b87357daf
Don't always use the whole text to get the first line of a pango layout
2012-11-22 21:21:28 +01:00
Simon Sapin
dda3817880
Merge branch 'patch-1' of https://github.com/mbarkhau/WeasyPrint
2012-11-22 20:10:09 +01:00
mbarkhau
0e09ce8ff9
Add scale factor to write_pdf of HTML class
2012-11-22 18:58:22 +01:00
mbarkhau
aa62d35664
Turn scale factor into parameter for write_pdf
2012-11-22 18:47:20 +01:00
Guillaume Ayoub
b54b9f54af
Fix the W3 testing suite web server
2012-11-16 02:07:56 +01:00
Simon Sapin
6f56613441
Do not require HtmlElement.
...
* Do not use element.base_url which only exists in lxml.html.HtmlElement
* Use lxml.etree.HtmlParser instead of lxml.html
This is one step toward using the html5lib parser, but see
https://github.com/Kozea/WeasyPrint/pull/12
2012-11-06 13:55:39 +01:00
Simon Sapin
ba987f0daf
Remove out-dated parts of the weasyprint.css docstring.
2012-10-09 17:10:45 +02:00
Simon Sapin
3072fff2e5
Docs docs docs.
...
But no ducks.
2012-10-08 19:51:18 +02:00
Simon Sapin
54b46c4b46
Typo fix
2012-10-08 12:13:33 +02:00
Simon Sapin
085d16cebf
Use the Sphinx syntax for command-line options.
2012-10-07 14:54:39 +02:00
Simon Sapin
f5bd8cf8ff
Defer warnings when PixBuf is not available.
...
Previously, a missing PixBuf caused a warning at import-time.
Now the exception is saved and re-raised when an image needs
to be loaded: there is no warning if PixBuf is not used at all.
2012-10-07 10:07:21 +02:00
Simon Sapin
f8457ba3a5
Move save_pixels_to_png() to the test_draw module.
...
This function is only used for tests.
2012-10-07 09:49:07 +02:00
Simon Sapin
a0bb1f2752
Have metadata account for CSS transforms.
2012-10-06 22:09:17 +02:00
Simon Sapin
28cb59fc8b
Pre-compute transformation matricies.
...
… so that they are available when getting meta-data.
2012-10-06 11:26:55 +02:00
Simon Sapin
a7131bd10f
Remove unused imports
2012-10-05 22:12:19 +02:00
Simon Sapin
ba06e7eecc
Nicer whitespace in PDF objects.
2012-10-05 22:06:38 +02:00
Simon Sapin
732f7187a4
Fix bookmarks writing in PDF.
...
The new prepare_metadata() already adds bookmark_root_id to
all values, no need to add it again in write_pdf_metadata()
2012-10-05 21:59:08 +02:00
Simon Sapin
bedcbfe4ed
Remove a debugging print()
2012-10-05 21:50:37 +02:00
Simon Sapin
17621bced0
Fix a crash when pygtk can be imported but not pango.
...
PyGObject 2 works on Python 3 and has a 'pygtk' package.
Importing pygtk does not imply that pango is available through it.
2012-10-05 21:49:26 +02:00
Simon Sapin
eda4bc604e
Move resolution to *.write_png only.
2012-10-05 20:12:05 +02:00
Simon Sapin
e1f5863bc8
Refine docstrings.
2012-10-05 18:50:40 +02:00
Simon Sapin
a05470d006
Remove with_size in Document.write_png
...
The method now always returns a tuple with the size.
HTML.write_png however still does not return the size.
2012-10-05 18:27:45 +02:00
Simon Sapin
c2b2b8c2ea
Escape non-ASCII characters in hyperlinks.
2012-10-04 19:12:34 +02:00
Simon Sapin
726faa9765
Make the Navigator use the public API.
2012-10-04 14:30:42 +02:00
Simon Sapin
6e63903a13
Add metadata in the low-level API.
2012-10-04 13:06:41 +02:00
Simon Sapin
ce484dd85e
Fix the low-level API tests.
2012-10-04 10:58:24 +02:00
Simon Sapin
09ff532828
The Document is back! (But different.)
2012-10-02 18:59:02 +02:00
Simon Sapin
7f033001b7
Remove HTML.get_png_pages
2012-10-02 15:59:59 +02:00
Simon Sapin
d17ee64fa1
Do not repeat a block’s margin-top after a break.
2012-10-02 15:59:58 +02:00
Simon Sapin
b17e807af1
Bug fix: inline-block with vertical-align
2012-10-01 19:30:25 +02:00
Simon Sapin
a564473882
Avoid re-using Pattern objects for images.
2012-09-26 16:59:40 +02:00
Simon Sapin
03d8817690
Cache failures to fetch/load images.
2012-09-26 14:44:43 +02:00
Simon Sapin
ac7f551055
Add tests for the new low-level API.
2012-09-26 14:26:24 +02:00
Simon Sapin
5f86288635
Make GDK-PixBuf truly optional.
2012-09-25 17:56:02 +02:00
Simon Sapin
f8f38f0d35
Compat with early pycairo versions.
2012-09-25 16:37:50 +02:00
Simon Sapin
1de2a00ecb
Use native strings in __main__.py, fix --help on 2.6
2012-09-25 16:37:18 +02:00
Simon Sapin
f33c91742d
Get rid of the Document class (finally!)
2012-09-25 16:37:18 +02:00
Simon Sapin
7984fbd3bc
Warn (not crash) on missing base_url for @import
2012-09-25 16:01:12 +02:00
Simon Sapin
a85c137754
Bug fix: unit conversion for PDF metadata.
2012-09-24 12:46:11 +02:00
Simon Sapin
b066fcf4e8
Doc details.
2012-09-24 12:46:07 +02:00
Simon Sapin
7966e9fed6
Generalize hinting and resolution
...
... in the low-level API, not just PNG output.
2012-09-20 19:24:58 +02:00
Simon Sapin
20fe60040d
Document low-level output functions.
2012-09-20 17:57:15 +02:00
Simon Sapin
933554f7ed
Moar docs for the low-level API.
2012-09-20 17:21:44 +02:00
Simon Sapin
19dd654678
Adapt docs for 0.15
2012-09-20 17:08:03 +02:00
Simon Sapin
a0853a3fc1
Merge branch 'sphinx-doc'
2012-09-20 16:53:33 +02:00
Simon Sapin
87d5741376
Integrate the sphinx docs with docstrings.
2012-09-19 17:37:52 +02:00
Simon Sapin
ac220e9a4d
Refactor the PNG output to use the low-level API
...
… not intermediate ImageSurface objects.
2012-09-18 12:58:58 +02:00
Simon Sapin
c7422f721d
Typo fix, thanks @jdahlin
2012-09-16 11:25:02 +03:00
Simon Sapin
0ff73c49bc
Cache intermediate results for intrinsic widths on tables.
...
This fixes huges performance problems when a large table is split
across many pages.
2012-09-13 11:46:13 +02:00
Simon Sapin
9834ccb7e6
Handle all of backgrounds at the end of layout.
2012-09-13 11:19:40 +02:00
Simon Sapin
ae26c87bfd
Handle background images at the end of layout
2012-09-13 10:41:22 +02:00
Simon Sapin
6354398139
Add a low-level public API
2012-09-12 19:33:16 +02:00
Simon Sapin
463a33c1af
Fetch background images early
...
This removes the need to have a reference to the image cache
in draw.py
2012-09-12 18:36:00 +02:00
Simon Sapin
43bccc7345
Remove the ContextProxy
...
Instead, pass around the two objects in every function.
This is a bit heavy, but I find it much cleaner.
2012-09-12 17:14:51 +02:00
Simon Sapin
a29a37073f
Merge commit 'FETCH_HEAD^' from git://github.com/jdahlin/WeasyPrint.git
2012-09-12 16:35:00 +02:00
Johan Dahlin
b0fb7a6e31
Convert drawing API to use context
...
Remove the need for a subclass and make it possible
to pass in other contextes such one created by the printing
functions in gtk+.
2012-09-12 16:31:00 +02:00
Simon Sapin
c0282bb000
Add a test for @page:blank
2012-09-12 16:22:38 +02:00
Simon Sapin
35540becb9
Add a work-around for some PyGTK installations.
2012-09-11 18:26:39 +02:00
Guillaume Ayoub
50210b266f
Add support for @page:blank pseudo-class
2012-08-24 00:05:28 +02:00
Simon Sapin
39b553fae7
Add support for font-stretch, fix #7
...
The value is passed to Pango as-is. It may have no effect if
(for example) the chosen font has no expanded variant.
2012-08-17 17:37:33 +02:00
Simon Sapin
a09eb52b97
Tag v0.14
2012-08-03 17:55:14 +02:00
Simon Sapin
c2a88cfafc
Fix saving of PNG images for failed tests.
2012-08-03 17:19:18 +02:00
Simon Sapin
20f46ea968
Fix #886 , only apply clip to absopos.
2012-08-03 17:19:04 +02:00
Simon Sapin
ba8a55d5c0
Add support for outlines.
2012-08-03 16:22:32 +02:00
Simon Sapin
2614821fa9
Add support for <base href="..."> element in HTML.
2012-08-03 15:22:26 +02:00
Simon Sapin
d1971b6e63
Remove unused imports.
2012-08-03 13:32:42 +02:00
Simon Sapin
4abf401f9e
Simplify Document and remove magic properties.
2012-08-03 13:00:14 +02:00
Simon Sapin
f4e6de438f
Remove/adapt tests using Document.formatting_structure
2012-08-03 12:11:34 +02:00
Simon Sapin
ec8cbc6c24
Remove one-line methods in Document.
2012-08-03 11:51:58 +02:00
Simon Sapin
a19c02f7b1
Add --resolution and --base-url to the command-line API.
2012-08-02 17:19:52 +02:00
Simon Sapin
eab2646dcc
Fix base_url set to a directory name.
...
With base_url='/a/b', a relative URL 'c' was resolved to '/a/c'.
Now it is resolved to '/a/b/c' if /a/b is a directory, '/a/c'
otherwise. This is most likely the expected behavior.
2012-08-02 17:19:34 +02:00
Simon Sapin
3b769e05c4
Add tests and changelog for the new media_type API.
2012-08-02 13:59:44 +02:00
Simon Sapin
1864d3365a
s/medium/media_type/ s/user_agent_stylesheets/ua_stylesheets/
2012-08-02 13:04:31 +02:00
Chung Wu
a51562149c
Can specify the @media medium to use (defaults to print)
2012-08-01 19:09:48 -07:00
Simon Sapin
4290b55d71
Remove a zip() pathologically slow on Py2.6
...
The Acid2 test used to take ~14 seconds on 2.6 vs. ~3 seconds in other
versions. Most of that time was in a zip() creating a list of millions
of tuples (one for each pixels.)
Switching to izip() removed the problem.
2012-07-31 18:13:25 +02:00
Simon Sapin
feece3d3c7
Always close pixbufs.
2012-07-31 18:10:44 +02:00
Simon Sapin
38129fabb6
Do not go to the network for the Acid2 test.
2012-07-31 17:33:55 +02:00
Simon Sapin
6809b5b7c9
Switch drawing tests back to RGBA.
2012-07-31 17:30:23 +02:00
Simon Sapin
cb659911d8
Add a specific error message for 0-byte images.
2012-07-31 15:08:01 +02:00
Simon Sapin
4c0bcc3b6e
Mention pixbuf in the changelog.
2012-07-31 13:01:52 +02:00
Simon Sapin
f6861a43b9
Merge branch 'pixbuf'
2012-07-31 12:48:18 +02:00
Simon Sapin
da74638d3d
Allow both RGB or RGBA PNG files in tests.
2012-07-30 17:33:31 +02:00
Simon Sapin
fb01c4c839
Work around getfilesystemencoding stupidity on Linux.
2012-07-30 12:01:20 +02:00
Simon Sapin
35c4c7cbe9
Merge branch 'master' into pixbuf
...
Conflicts:
tox.ini
2012-07-29 18:42:48 +02:00
Simon Sapin
41e14d6e14
Overall niceties.
2012-07-29 18:39:16 +02:00
Simon Sapin
a34fd1a616
Remove a deprecation warning.
2012-07-29 18:38:59 +02:00
Simon Sapin
eca3e872a3
Fix the PyGTK version of gdkpixbuf_loader()
2012-07-29 18:23:53 +02:00
Simon Sapin
f522eac201
Use the same get_pixbuf() for both PyGTK and introspection.
2012-07-29 18:21:33 +02:00
Simon Sapin
1efd026ad0
Warn if gdk-pixbuf istoo old for introspection.
2012-07-29 18:13:33 +02:00
Simon Sapin
f46c334fa0
Remove the Pystacia dependency in tox.ini
2012-07-29 16:55:05 +02:00
Simon Sapin
abf256a810
Merge branch 'master' into pixbuf
2012-07-29 16:53:08 +02:00
Simon Sapin
9476dd99b7
Add a warning when Pango is too old.
2012-07-29 16:37:13 +02:00
Simon Sapin
cf9f982ec5
Default to PyGTK instead of PyGObject introspection.
2012-07-29 16:25:43 +02:00
Simon Sapin
c39d4119c8
Fix MIME type registering: always use native strings.
2012-07-29 15:13:45 +02:00
Simon Sapin
4f4fc0ee8e
Make some drawing tests more robust ... maybe?
2012-07-29 15:13:16 +02:00