Subversion Repositories Scribus


Rev 17163 | Blame | Compare with Previous | Last modification | View Log | RSS feed

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Predefined Constants</title>
<h2>Predefined Constants</h2>

<p>There are some Constants defined to help using the Commands: </p>

<h4>Scribus Version:</h4>
        <p>The script interface provides two variables containing the current Scribus version in the <code>scribus</code> module. Scripts can use these variables to check that they're running under the version of Scribus they expect, and to report information about incompatibilities to the user. These two variables, <code>scribus_version</code> and <code>scribus_version_info</code>, were added in 1.2.1 and 1.3.0cvs and will not be present in earlier versions. If you need to, you can check for their presence with <code>hasattr(scribus, 'scribus_version')</code>.</p>
        <p><code>scribus_version</code> contains the current Scribus version as a string. It will usually look like <code>'1.2.1cvs'</code> or <code>'1.3.0'</code>, for example, but is not guaranteed to always follow that format. This variable is useful when you need to display the version to the user, for example when reporting an incompatibility. Do not parse or compare this variable, that is what <code>scribus_version_info</code> is for.</p>
        <p><code>scribus_version_info</code> is a tuple similar to the <code>sys.version_info</code> tuple provided by Python. It is a tuple of the form (majorversion, minorversion, patchlevel, extraversion, build) for example, 1.2.1cvs will have <code>(1,2,1,'cvs',0)</code> and 1.3.2 will have <code>(1,3,2,'',0)<code> . These tuples are ideal for checking for minimum versions, etc, because Python compares tuples element-by-element, left-to-right. For example:</p>
if scribus.scribus_version_info[:3] &lt; (1,2,2):
    messageBox("Scribus - Python script",
        "This script requires Scribus 1.2.2 or newer. "+\
        "You're running %s." % scribus.scribus_version,

<h4>Unit Definitions: </h4>
        <dd>Measurement Unit Point = 0</dd>
        <dd>Measurement Unit Millimeter = 1</dd>
        <dd>Measurement Unit Inch = 2</dd>
        <dd>Measurement Unit Pica = 3</dd>

<h4>Page Orientation Definitions: </h4>
        <dd>Pageformat Portrait = 0</dd>
        <dd>Pageformat Landscape = 1</dd>

<h4>Definitions for Page Formats: </h4>
        <dd>Paperformat A0 = 2380 x 3368 Points</dd>
        <dd>Paperformat A1 = 1684 x 2380 Points</dd>
        <dd>Paperformat A2 = 1190 x 1684 Points</dd>
        <dd>Paperformat A3 = 842 x 1190 Points</dd>
        <dd>Paperformat A4 = 595 x 842 Points</dd>
        <dd>Paperformat A5 = 421 x 595 Points</dd>
        <dd>Paperformat A6 = 297 x 421 Points</dd>
        <dd>Paperformat A7 = 210 x 297 Points</dd>
        <dd>Paperformat A8 = 148 x 210 Points</dd>
        <dd>Paperformat A9 = 105 x 148 Points</dd>
        <dd>Paperformat B0 = 2836 x 4008 Points</dd>
        <dd>Paperformat B1 = 2004 x 2836 Points</dd>
        <dd>Paperformat B2 = 1418 x 2004 Points</dd>
        <dd>Paperformat B3 = 1002 x 1418 Points</dd>
        <dd>Paperformat B4 = 709 x 1002 Points</dd>
        <dd>Paperformat B5 = 501 x 709 Points</dd>
        <dd>Paperformat B6 = 355 x 501 Points</dd>
        <dd>Paperformat B7 = 250 x 355 Points</dd>
        <dd>Paperformat B8 = 178 x 250 Points</dd>
        <dd>Paperformat B9 = 125 x 178 Points</dd>
        <dd>Paperformat B10 = 89 x 125 Points</dd>
        <dd>Paperformat C5E = 462 x 649 Points</dd>
        <dd>Paperformat Comm10E = 298 x 683 Points</dd>
        <dd>Paperformat DLE = 312 x 624 Points</dd>
        <dd>Paperformat Executive = 542 x 720 Points</dd>
        <dd>Paperformat Folio = 595 x 935 Points</dd>
        <dd>Paperformat Ledger = 1224 x 792 Points</dd>
        <dd>Paperformat Legal = 612 x 1008 Points</dd>
        <dd>Paperformat Letter = 612 x 792 Points</dd>
        <dd>Paperformat Tabloid = 792 x 1224 Points</dd>

<h4>Definitions for Document Layout:</h4>
        <dd>Layout with facing Pages.</dd>
        <dd>Normal Layout of the Document.</dd>
        <dd>The first Page of the Document is a left Page.</dd>
        <dd>The first Page of the Document is a right Page.</dd>

<h4>Alignment Definitions </h4>
        <dd>Text is aligned to the Left.</dd>
        <dd>The Text is centered in the Textframe.</dd>
        <dd>The Text is aligned to the Right Side of the Textframe</dd>
        <dd>The Text has forced Alignment</dd>
        <dd>The Text has block Alignment</dd>

<h4>Line related Definitions: </h4>

<h4>Fill related Definitions: </h4>
    <dd>No gradient, plain color</dd>

<h4>Dialog Buttons</h4>

<h4>Dialog Icons</h4>