~ubuntu-branches/ubuntu/trusty/pyx/trusty

« back to all changes in this revision

Viewing changes to examples/text/textbox.txt

  • Committer: Bazaar Package Importer
  • Author(s): Stuart Prescott
  • Date: 2011-05-20 00:13:52 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110520001352-7jfc1unuvduxji05
Tags: 0.11.1-1
* New upstream release.
* Change documentation build system to sphinx in line with new upstream docs.
* Rebuild lfs files as part of build process.
* Refresh patchs for new version:
  - drop manual-latex-define.patch no longer needed with sphinx.
  - drop siteconfig-static.patch: not needed with new build system
  - drop pyx-text-warnings26.patch: warnings fixed upstream
* Add patch sphinx-mathjax.patch to use pngmath in sphinx rather than mathjax
  which is not yet in Debian.
* Add patch createlfs-no-foiltex.patch to skip generation of foiltex-based
  lfs files that would require non-free components.
* Switch to dpkg-source 3.0 (quilt) format.
* Switch from python-support to dh_python2 as build helper.
* Update copyright format to newer DEP-5 specification.
* Add new files to copyright file.
* Bump standards version to 3.9.2 (no changes required).
* Set DM-Upload-Allowed: yes

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Enlarge the surrounding of a textbox
 
2
 
 
3
! This example introduces the concept of the `textbox`, which is a canvas-like
 
4
structure containing the text and its surrounding path and reference point. We
 
5
demonstrate how to enlarge the surrounding box a little and use it as a
 
6
decoration of the path. ...
 
7
 
 
8
! The `textbox` is a specialized version of the [`box` concept
 
9
../../roadmap.html] which has been introduced into PyX in a preliminary
 
10
version. In the example, we obtain the bounding box (this is a `bbox` instance,
 
11
not to be mixed up with the `box`) and enlarge it a bit. We then draw the path
 
12
of the bounding box.
 
13
 
 
14
! In future releases of PyX, the boxes will have generic support for enlarging.
 
15
The syntax will then be
 
16
 
 
17
    tpath = tbox.enlarged(3*unit.x_pt).path()
 
18
 
 
19
! An alternative, geometrically different approach to enlarging the textbox path
 
20
is via an appropriate transformation, such as
 
21
 
 
22
    tbox = text.text(0, 0, r"Boxed text", [text.halign.boxcenter, text.valign.middle])
 
23
    tpath = tbox.path().transformed(trafo.scale(1.5, 1.5, 0, 0))
 
24
 
 
25