[cairo-commit]
cairo-artwork BUGS, NONE, 1.1 cairo-slides.xsl, NONE,
1.1 slide01.xml, NONE, 1.1 slide02.xml, NONE, 1.1 slide03.xml,
NONE, 1.1 slides.xml, NONE, 1.1 ChangeLog, 1.2, 1.3 NEWS, 1.2,
1.3 README, 1.2, 1.3
Richard Worth
commit at pdx.freedesktop.org
Sat May 15 05:15:47 PDT 2004
Committed by: rworth
Update of /cvs/cairo/cairo-artwork
In directory pdx:/tmp/cvs-serv25406
Modified Files:
ChangeLog NEWS README
Added Files:
BUGS cairo-slides.xsl slide01.xml slide02.xml slide03.xml
slides.xml
Log Message:
* cairo-slides.xsl: added.
* slides.xml: added.
* slide01.xml: added.
* slide02.xml: added.
* slide03.xml: added.
* BUGS: added.
* README, NEWS: updated with information on cairo-slides.
--- NEW FILE: BUGS ---
---
cairo-slides.xsl only draws correctly one (or the first) <slide> in <slides>.
PROBLEM
The problem is with the preceding:: axis in template 'text_y'. On every slide after the first one, the preceding:: axis grabs all previous elements (including from earlier slides) in order to do vertical placement calculation. Slide 2 ends up starting where slide 1 ended off instead of back at the top. This will create a problem even when targeting only one slide as long as there are multiple slides above the targeted slide [see workaround].
SOLUTION
Vertical position should only be dependent on elements within the same <slide>. When this is fixed, all slides (if all displayed together) should appear stacked on top of one another instead of top-to-bottom (like a really long page) as they are now.
WORKAROUND
The workaround right now is to create one file: slides.xml, and then split each slide up into its own file: slide01.xml, slide02.xml, etc. with each file containing its slide in slides, as
<slides title="presentation title">
<slide title="slide 2 title">
<!-- slide 2 content -->
</slide>
</slides>
This is kind of a pain, and could be automated, but eventually should be fixed.
---
cairo-slides.xsl is hard-coded (in some places) for dimensions: 1024x768
PROBLEM
Parts of the main slide template (cairo logo, fd.o logo, title) in cairo-slides.xsl are hard-coded for the originally designed dimensions: 1024x768.
SOLUTION
This could be fixed by converting these to calculated values based on one or both of the variables: $slide_width, $slide_height. It's not a huge deal (right now font-size is explicitly specified in slides.xml, so the author is already targeting dimensions), but it does keep one from simply changing the $slide_width and $slide_height variables and having everything just show up nicely
---
--- NEW FILE: cairo-slides.xsl ---
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<xsl:variable name="NewLine"><xsl:value-of select="' '"/></xsl:variable>
<xsl:variable name="slide_width">1024</xsl:variable>
<xsl:variable name="slide_height">768</xsl:variable>
<xsl:variable name="body_width">824</xsl:variable>
<xsl:template match="/">
<svg width="{$slide_width}" height="{$slide_height}">
<defs id="cairo-artwork_defs">
<g id="hacker_emblem">
<!-- Note: This is similar though not identical to Keith Packard's SVG version
of the hacker emblem (http://www.catb.org/hacker-emblem/glider.svg) -->
<g id="hacker_emblem_grid" fill="white" stroke="none">
<!-- Outside: Top, Right, Bottom, Left -->
<rect x="-2.95" y="-3.05" width="6" height="0.1" />
<rect x="2.95" y="-2.95" width="0.1" height="6" />
<rect x="-3.05" y="2.95" width="6" height="0.1" />
<rect x="-3.05" y="-3.05" width="0.1" height="6" />
<!-- Vertical: Left, Right -->
<rect x="-1.05" y="-2.95" width="0.1" height="5.9" />
<rect x="0.95" y="-2.95" width="0.1" height="5.9" />
<!-- Horizontal: TopLeft, TopMiddle, TopRight -->
<rect x="-2.95" y="-1.05" width="1.9" height="0.1" />
<rect x="-0.95" y="-1.05" width="1.9" height="0.1" />
<rect x="1.05" y="-1.05" width="1.9" height="0.1" />
<!-- Horizontal: BottomLeft, BottomMiddle, BottomRight -->
<rect x="-2.95" y="0.95" width="1.9" height="0.1" />
<rect x="-0.95" y="0.95" width="1.9" height="0.1" />
<rect x="1.05" y="0.95" width="1.9" height="0.1" />
</g>
<g id="hacker_emblem_dots" fill="white">
<circle cx="0" cy="-2" r="0.7" />
<circle cx="2" cy="0" r="0.7" />
<circle cx="-2" cy="2" r="0.7" />
<circle cx="0" cy="2" r="0.7" />
<circle cx="2" cy="2" r="0.7" />
</g>
</g>
<g id="scarab" fill="#3B80AE">
<g transform="translate(-150, -170)">
<path id="scarab_head" d="M205.599,94.567c0-11.668-24.914-21.129-55.628-21.129
c-30.723,0-55.624,9.46-55.624,21.129c0,10.203,24.901,7.346,55.624,7.346C180.685,101.913,205.599,104.233,205.599,94.567z"/>
<path id="scarab_torso" d="M136.423,161.506c0,0,12.751,12.577,13.547,13.362
c2.262-2.232,13.545-13.362,13.545-13.362c7.135-7.036,87.111-6.399,91.066-6.363c-0.469-6.298-1.254-12.472-2.325-18.519
c-15.183-19.279-42.811-32.225-74.485-32.225h-55.518c-31.745,0-59.439,13.011-74.598,32.37c-1.054,6-1.829,12.128-2.296,18.374
C49.321,155.106,129.288,154.47,136.423,161.506z"/>
<path id="scarab_spine" d="M149.97,301.187c2.005-24.729,8.386-103.483,8.405-103.721
c-0.09-0.219-6.478-15.578-8.405-20.214c-1.936,4.655-8.316,19.995-8.408,20.214C141.582,197.704,147.965,276.458,149.97,301.187z"/>
<path id="scarab_wing_left" d="M140.403,197.149l8.862-21.31l-13.686-13.499
c-5.65-5.573-67.074-6.235-90.259-6.019l-0.006-0.622c-0.154,2.144-0.271,4.302-0.35,6.475
c-0.076,2.207,10.392,4.706,10.392,6.717c0,2.319-10.457,5.084-10.359,7.631c2.993,73.349,48.53,131.631,104.372,132.048
l-9.02-111.29L140.403,197.149z"/>
<path id="scarab_wing_right" d="M244.585,168.891c0-2.011,10.467-4.506,10.391-6.715
c-0.079-2.174-0.195-4.332-0.351-6.479l-0.004,0.624c-23.186-0.216-84.608,0.445-90.26,6.017l-13.688,13.502l8.915,21.438
l-9.017,111.29c55.854-0.417,101.378-58.698,104.373-132.049C255.04,173.976,244.585,171.209,244.585,168.891z"/>
<path id="scarab_leg_front_left" d="M44.506,141.12c-4.135-0.856-4.895-1.54-7.935-2.92
c-9.59-3.364-10.376-5.481-16.08-11.86c-7.426-8.306-12.661-20.142-17.1-29.463c-3.576-7.525-3.984-16.409-2.86-24.273
c0.991-6.935,7.144-12.869,12.074-18.92c5.844-7.191,10.356-14.822,17.924-21.354c7.736-6.682,23.203-9.809,26.168-19.648
C57.86,8.819,54.334,1.766,61.482,0c-0.366,4.703,3.639,8.477,2.397,13.575c-1.129,4.627-4.368,5.811-9.611,9.099
c-7.564,4.746-18.366,8.779-24.748,13.965c-7.175,5.827-4.369,13.771-10.569,20.057c-2.001,2.03-7.901,4.706-9.137,6.83
c-1.861,3.199-0.297,9.572-0.116,13.12c0.425,8.284,5.588,14.244,9.555,22.045c4.152,8.141,6.429,15.409,13.411,22.519
c4.183,4.262,11.429,4.802,16.21,10.647l-3.555,4.186L44.506,141.12z"/>
<path id="scarab_leg_middle_left" d="M43.94,191.922l-0.809-7.346
c-9.506-4.579-10.339-9.772-20.738-12.466c-23.728-6.151-21.361,11.25-15.532,26.373c5.676,14.726,8.237,30.23,14.345,44.795
c2.805,6.688,6.919,13.213,14.298,15.127c0.372-8.435-0.917-10.651-6.113-16.919c-4.395-5.293-3.326-12.548-6.072-18.504
c-3.581-7.804-4.196-15.646-7.279-23.502c-1.363-3.479-8.33-13.966-6.452-17.861c3.183-6.603,9.178-0.083,12.179,2.077
c4.218,3.036,6.467,2.223,11.681,2.898C34.041,186.673,37.005,188.756,43.94,191.922z"/>
<path id="scarab_leg_back_left" d="M65.839,257.063l-2.771-4.837
c-6.68,8.928-6.993,16.228-10.056,23.347c-5.277,12.263-0.157,28.851,9.854,37.676c6.052,5.375,15.907,9.618,23.122,13.136
c10.035,4.892,20.113,11.286,31.336,13.396c2.482,0.466,8.798,1.295,6.693-3.522c-0.975-2.237-8.091-4.591-10.146-5.734
c-8.312-4.623-16.377-10.524-24.142-16.176c-9.498-6.862-20.843-11.186-28.311-20.684c-3.054-3.885-3.544-4.922-2.816-9.39
c0.693-4.263,1.344-9.174,2.241-13.439C61.855,266.029,63.274,261.378,65.839,257.063z"/>
<path id="scarab_leg_front_right" d="M255.487,141.12c4.134-0.856,4.896-1.54,7.936-2.92
c9.583-3.364,10.369-5.481,16.071-11.86c7.428-8.306,12.661-20.142,17.115-29.463c3.574-7.525,3.983-16.409,2.86-24.273
c-0.992-6.935-7.157-12.869-12.087-18.92c-5.843-7.191-10.356-14.822-17.919-21.354c-7.735-6.682-23.202-9.809-26.167-19.648
C242.135,8.819,245.66,1.766,238.511,0c0.366,4.703-3.637,8.477-2.396,13.575c1.131,4.627,4.368,5.811,9.611,9.099
c7.563,4.746,18.367,8.779,24.747,13.965c7.17,5.827,4.362,13.771,10.563,20.057c2.001,2.03,7.901,4.706,9.139,6.83
c1.859,3.199,0.295,9.572,0.113,13.12c-0.424,8.284-5.588,14.244-9.553,22.045c-4.152,8.141-6.431,15.409-13.404,22.519
c-4.184,4.262-11.429,4.802-16.211,10.647l3.556,4.186L255.487,141.12z"/>
<path id="scarab_leg_middle_right" d="M256.053,191.922l0.81-7.346
c9.507-4.579,10.34-9.772,20.73-12.466c23.741-6.151,21.374,11.25,15.534,26.373c-5.676,14.726-8.238,30.23-14.347,44.795
c-2.804,6.688-6.911,13.213-14.291,15.127c-0.371-8.435,0.918-10.651,6.113-16.919c4.39-5.293,3.319-12.548,6.066-18.504
c3.58-7.804,4.197-15.646,7.278-23.502c1.363-3.479,8.33-13.966,6.453-17.861c-3.184-6.603-9.179-0.083-12.181,2.077
c-4.217,3.036-6.458,2.223-11.672,2.898C265.951,186.673,262.986,188.756,256.053,191.922z"/>
<path id="scarab_leg_back_right" d="M234.155,257.063l2.771-4.837
c6.679,8.928,6.991,16.228,10.057,23.347c5.274,12.263,0.154,28.851-9.854,37.676c-6.055,5.375-15.903,9.618-23.117,13.136
c-10.034,4.892-20.127,11.286-31.351,13.396c-2.481,0.466-8.789,1.295-6.691-3.522c0.976-2.237,8.092-4.591,10.146-5.734
c8.312-4.623,16.392-10.524,24.155-16.176c9.498-6.862,20.838-11.186,28.305-20.684c3.055-3.885,3.543-4.922,2.818-9.39
c-0.696-4.263-1.346-9.174-2.244-13.439C238.137,266.029,236.718,261.378,234.155,257.063z"/>
</g>
</g>
<radialGradient id="gradient_radial_dung"
cx="0" cy="0" r="60"
fx="0" fy="0" gradientUnits="userSpaceOnUse"
>
<stop offset="0" stop-color="#9a9a9a" />
<stop offset="0.70" stop-color="#bababa" />
<stop offset="0.95" stop-color="#FFFFFF" />
</radialGradient>
<g id="dung">
<circle cx="0" cy="0" r="60" fill="url(#gradient_radial_dung)" />
<g transform="translate(-61, -61)">
<!-- rough equivalent: <circle cx="0" cy="0" r="60" stroke="#8a8a8a" stroke-width="2" /> -->
<path fill="#8a8a8a" d="M0,61c0,33.636,27.364,61,61,61s61-27.364,61-61S94.636,0,61,0S0,27.364,0,61z
M2,61C2,28.467,28.467,2,61,2c32.532,0,59,26.467,59,59c0,32.533-26.468,59-59,59C28.467,120,2,93.533,2,61z"/>
</g>
<use xlink:href="#hacker_emblem" x="0" y="0" transform="scale(9)" />
</g>
<!-- scarab dimensions: 300x340 -->
<!-- dung dimensions: 120x120 (radius: 60) -->
<!-- scarab and dung dimensions: 300x400 -->
<g id="cairo_logo">
<!-- dimensions: 300x400, centered -->
<!-- The logo (scarab and dung), with the center-point of the bounding box at (0,0) -->
<use xlink:href="#dung" x="0" y="0" transform="translate(0, -140)" />
<use xlink:href="#scarab" x="0" y="0" transform="translate(0, 30)" />
</g>
<g id="cairo_logo_dung-centered">
<!-- The logo (scarab and dung), with the dung at (0,0), the scarab below -->
<use xlink:href="#dung" x="0" y="0" />
<use xlink:href="#scarab" x="0" y="0" transform="translate(0,170)" />
</g>
<g id="cairo_logo_scarab-centered">
<!-- The logo (scarab and dung), with the scarab's rotational center at (0,0), the dung above -->
<!-- The scarab's rotational center in this case is not the center of its bounding box,
but is calculated to be the intersection-point of the torso, spine and wings -->
<use xlink:href="#dung" x="0" y="0" transform="translate(0, -175.85)" />
<use xlink:href="#scarab" x="0" y="0" transform="translate(0, -5.85)" />
</g>
<g id="cairo_logo_top-centered">
<!-- The logo (scarab and dung), with the top-center point of the bounding box at (0,0) -->
<use xlink:href="#dung" x="0" y="0" transform="translate(0, 60)" />
<use xlink:href="#scarab" x="0" y="0" transform="translate(0, 230)" /><!-- (0,170+60) -->
</g>
<g id="cairo_logo_bottom-centered">
<!-- The logo (scarab and dung), with the bottom-center point of the bounding box at (0,0) -->
<use xlink:href="#dung" x="0" y="0" transform="translate(0, -340)" />
<use xlink:href="#scarab" x="0" y="0" transform="translate(0, -170)" />
</g>
<g id="cairo_logo_right-centered">
<!-- The logo (scarab and dung), with the right-center point of the bounding box at (0,0) -->
<use xlink:href="#dung" x="0" y="0" transform="translate(-150, -140)" />
<use xlink:href="#scarab" x="0" y="0" transform="translate(-150, 30)" />
</g>
<g id="cairo_logo_left-centered">
<!-- The logo (scarab and dung), with the left-center point of the bounding box at (0,0) -->
<use xlink:href="#dung" x="0" y="0" transform="translate(150, -140)" />
<use xlink:href="#scarab" x="0" y="0" transform="translate(150, 30)" />
</g>
<g id="cairo_logo_topleft-centered">
<!-- The logo (scarab and dung), with the top-left point of the bounding box at (0,0) -->
<use xlink:href="#dung" x="0" y="0" transform="translate(150, 60)" />
<use xlink:href="#scarab" x="0" y="0" transform="translate(150, 230)" /><!-- (150, 170+60) -->
</g>
<g id="cairo_logo_topright-centered">
<!-- The logo (scarab and dung), with the top-right point of the bounding box at (0,0) -->
<use xlink:href="#dung" x="0" y="0" transform="translate(-150, 60)" />
<use xlink:href="#scarab" x="0" y="0" transform="translate(-150, 230)" /><!-- (-150,170+60) -->
</g>
<g id="cairo_logo_bottomleft-centered">
<!-- The logo (scarab and dung), with the bottom-left point of the bounding box at (0,0) -->
<use xlink:href="#dung" x="0" y="0" transform="translate(150, -340)" />
<use xlink:href="#scarab" x="0" y="0" transform="translate(150, -170)" />
</g>
<g id="cairo_logo_bottomright-centered">
<!-- The logo (scarab and dung), with the bottom-right point of the bounding box at (0,0) -->
<use xlink:href="#dung" x="0" y="0" transform="translate(-150, -340)" />
<use xlink:href="#scarab" x="0" y="0" transform="translate(-150, -170)" />
</g>
<g id="cairo_text" fill="black">
<!-- text: 'cairo' -->
<!-- dimensions: 300x100, bottom-centered on cairo_text_i -->
<!-- rough equivalent: <text text-anchor="middle" x="0" y="0" font-size="128">cairo</text> -->
<g transform="translate(-152.5, -100)">
<path id="cairo_text_c" d="M36.191,100.671c10.136,0,19.184-3.958,25.32-11.222l-8.081-8.081
c-3.299,5.915-8.8,10.083-16.82,10.083c-14.528,0-20.255-14.387-20.255-25.842c0-15.366,8.801-26.401,20.535-26.401h0.14
c6.982,0,12.753,3.867,16.326,10.061l8.355-8.355c-5.899-6.992-14.574-10.926-24.402-10.926h-0.14
c-16.064,0-33.525,10.895-33.525,36.041C3.644,86.562,16.775,100.671,36.191,100.671z"/>
<path id="cairo_text_a" d="M129.432,82.688c0,5.839,0,5.839,0,17.983h-10.011V90.334c-3.616,5.284-12.515,10.012-22.109,10.012
c-13.626,0-20.579-9.594-20.579-19.327c0-16.269,14.461-25.167,40.463-25.029v-1.391c0-5.561-1.531-15.712-15.296-15.573
c-6.396,0-12.931,1.807-17.659,5.006l-2.779-8.205c5.561-3.476,13.765-5.839,22.247-5.839c20.718,0,25.723,14.044,25.723,27.531
V82.688z M117.475,64.471c-13.348-0.277-28.505,2.085-28.505,15.156c0,8.065,5.284,11.681,11.402,11.681
c8.899,0,14.6-5.563,16.547-11.263c0.417-1.25,0.556-2.642,0.556-3.893V64.471z"/>
<path id="cairo_text_i" d="M153.062,16.99c-4.819,0-8.033-3.797-8.033-8.324s3.359-8.178,8.324-8.178
c4.966,0,8.179,3.65,8.179,8.178s-3.213,8.324-8.324,8.324H153.062z M146.927,100.67V29.988h12.853v70.683H146.927z"/>
<path id="cairo_text_r" d="M180.375,53.676c0-7.807-0.137-14.518-0.046-23.688h10.547l0.045,16.019h0.412
c3.012-8.902,15.479-16.019,23.559-16.019c1.232,0,2.189,0.137,3.285,0.411v11.23c-1.368-0.137-2.602-0.274-4.244-0.274
c-8.492,0-19.588,7.939-21.231,16.841c-0.272,1.78-0.41,3.698-0.41,5.752v36.723h-12.052L180.375,53.676z"/>
<path id="cairo_text_o" d="M261.708,100.67c-18.158,0-32.408-13.41-32.408-34.783c0-22.629,14.946-35.899,33.526-35.899
c19.416,0,32.546,14.108,32.546,34.643c0,25.143-17.461,36.04-33.524,36.04H261.708z M262.127,91.451
c11.734,0,20.535-11.035,20.535-26.401c0-11.455-5.729-25.842-20.256-25.842c-14.388,0-20.673,13.41-20.673,26.261
c0,14.806,8.381,25.982,20.253,25.982H262.127z"/>
</g>
</g>
<g id="cairo_logo_with_text">
<!-- The logo (scarab and dung), with the text 'cairo' below, the dot of the 'i' positioned between the hind legs of the scarab -->
<!-- dimensions: 300x490, centered -->
<use xlink:href="#cairo_logo_top-centered" transform="translate(0, -245)" />
<use xlink:href="#cairo_text" transform="translate(0, 245)" />
</g>
<g id="cairo_banner">
<!-- The logo on the left, the text 'cairo' in the center, and a mirror image of the logo on the right -->
<!-- The logos are scaled such that the scarab body nearly matches the height of the text characters (excepting the 'i')
and the dung should nearly aligns with the dot of the 'i'. The bottoms of the logos are aligned with the bottom of the text. -->
<!-- dimensions: 500x110, centered -->
<use xlink:href="#cairo_logo_bottomleft-centered" transform="translate(-250, 55), scale(0.27)" />
<use xlink:href="#cairo_text" transform="translate(0, 55)" />
<use xlink:href="#cairo_logo_bottomleft-centered" transform="translate(250, 55), scale(0.27), scale(-1, 1)" />
</g>
</defs>
<defs>
<g id="bullet">
<use xlink:href="#cairo_logo_bottomright-centered" transform="translate(-0.2, 0), scale({1 div 450})" />
</g>
<g id="freedesktop_org_logo" style="fill:#FFFFFF;stroke:#3B80AE;stroke-width:2.4588;">
<g>
<path style="stroke:#BABABA;" d="M85.277,40.796c2.058,7.884-2.667,15.942-10.551,17.999L27.143,71.21c-7.884,2.057-15.943-2.667-18-10.552
l-7.448-28.55c-2.057-7.884,2.667-15.942,10.551-17.999L59.83,1.695c7.884-2.057,15.942,2.667,17.999,10.551
l7.449,28.55z"/>
<path style="fill:#3B80AE;stroke:none;" d="M80.444,39.778c1.749,7.854-1.816,13.621-9.504,15.447l-42.236,11.02c-7.569,2.396-14.089-1.181
-15.838-8.836L6.53,33.127c-1.749-8.145,0.709-12.889,9.503-15.447L58.27,6.661
c8.144-1.826,14.089,1.363,15.838,8.835l6.336,24.282z"/>
</g>
<path style="opacity:0.5;fill:none;stroke:#FFFFFF;" d="M45.542,51.793L24.104,31.102l38.1-4.393L45.542,51.793z"/>
<path d="M72.325,28.769c0.405,1.55-0.525,3.136-2.075,3.541l-12.331,3.217c-1.551,0.404-3.137-0.525-3.542-2.076l-2.295-8.801
c-0.405-1.551,0.524-3.137,2.076-3.542l12.33-3.217c1.551-0.405,3.137,0.525,3.542,2.076l2.295,8.801z"/>
<path d="M36.51,33.625c0.496,1.9-0.645,3.844-2.545,4.34l-15.112,3.943c-1.901,0.496-3.845-0.644-4.34-2.544l-2.814-10.786
c-0.496-1.901,0.644-3.844,2.544-4.34l15.113-3.942c1.901-0.496,3.845,0.643,4.34,2.544l2.814,10.786z"/>
<path d="M52.493,53.208c0.278,1.065-0.36,2.154-1.425,2.432L42.6,57.848c-1.064,0.277-2.153-0.36-2.431-1.426l-1.577-6.043
c-0.277-1.064,0.36-2.153,1.425-2.432l8.468-2.209c1.064-0.277,2.154,0.361,2.431,1.426l1.577,6.043z"/>
</g>
</defs>
<g id="watermark" transform="translate(435, 140), rotate(-40), scale(2.5)">
<use xlink:href="#dung" x="0" y="0" fill-opacity="0.3" stroke-opacity="0.08" />
<use xlink:href="#hacker_emblem" x="0" y="0" transform="scale(9)" fill-opacity="0.5" stroke-opacity="0.5" />
<use xlink:href="#scarab" x="0" y="170" fill-opacity="0.08"/>
</g>
<rect x="-512" y="0" width="2048" height="50" fill="#3B80AE" fill-opacity="0.3" />
<use xlink:href="#cairo_logo_bottomright-centered" x="0" y="0" transform="translate(70, 70), scale(0.15)" />
<use xlink:href="#cairo_text" x="0" y="0" transform="translate(80, 70), scale(0.55), translate(150, 0)" />
<use xlink:href="#freedesktop_org_logo" transform="translate(910, 12)" />
<title>
<xsl:value-of select="/slides/@title" /> : <xsl:value-of select="/slides/slide/@title" />
</title>
<g id="slide_title" transform="translate({$slide_width div 2}, {$slide_height * 0.2})">
<rect stroke="#bababa" fill="none"
x="{-60 - string-length(/slides/slide/@title) * 15 - 5}"
y="{-50 - 5}"
width="{120 + string-length(/slides/slide/@title) * 15 * 2 + 10}"
height="{70 + 10}"
rx="10" ry="10"
/>
<rect fill="#bababa" fill-opacity="0.3"
x="{-60 - string-length(/slides/slide/@title) * 15}"
y="{-50}"
width="{120 + string-length(/slides/slide/@title) * 15 * 2}"
height="70"
rx="10" ry="10"
/>
<text text-anchor="middle"
x="0"
y="10" font-size="55"><xsl:value-of select="/slides/slide/@title" /></text>
</g>
<g id="slide_body" transform="translate({($slide_width - $body_width) div 2}, {$slide_height * 0.25})">
<xsl:apply-templates />
</g>
</svg>
</xsl:template>
<xsl:template match="ul">
<g transform="{@transform}">
<xsl:apply-templates select="li" />
</g>
</xsl:template>
<xsl:template match="li">
<xsl:if test="string-length(text()) > 0 and string(@bullet) != 'off' and string(../@bullet) != 'off'">
<g>
<xsl:attribute name="transform">translate(<xsl:value-of select="count(ancestor::ul) * 25" />,<xsl:call-template name="text_y" />),scale(<xsl:value-of select="ancestor::*[@font-size][1]/@font-size" />)</xsl:attribute>
<use xlink:href="#bullet" />
</g>
</xsl:if>
<text>
<xsl:attribute name="font-size"><xsl:value-of select="ancestor::*[@font-size][1]/@font-size" /></xsl:attribute>
<xsl:attribute name="x"><xsl:value-of select="count(ancestor::ul) * 25" /></xsl:attribute>
<xsl:attribute name="y"><xsl:call-template name="text_y" /></xsl:attribute>
<xsl:value-of select="text()" />
</text>
<xsl:apply-templates select="ul"/>
</xsl:template>
<xsl:template match="g">
<xsl:copy-of select="." />
</xsl:template>
<xsl:template match="div">
<xsl:call-template name="break-nl">
<xsl:with-param name="text" select="text()"/>
<xsl:with-param name="text-anchor">
<xsl:choose>
<xsl:when test="string(@align) = 'center'">middle</xsl:when>
<xsl:when test="string(@align) = 'right'">end</xsl:when>
<xsl:otherwise>start</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="x">
<xsl:choose>
<xsl:when test="string(@align) = 'center'"><xsl:value-of select="$body_width div 2" /></xsl:when>
<xsl:when test="string(@align) = 'right'"><xsl:value-of select="$body_width" /></xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="y"><xsl:call-template name="text_y" /></xsl:with-param>
<xsl:with-param name="font-size" select="ancestor-or-self::*[@font-size][1]/@font-size" />
<xsl:with-param name="line-height" select="ancestor-or-self::*[@line-height][1]/@line-height" />
</xsl:call-template>
<xsl:if test="g">
<g>
<xsl:attribute name="transform">translate(0,<xsl:call-template name="text_y" />)</xsl:attribute>
<xsl:apply-templates select="g"/>
</g>
</xsl:if>
</xsl:template>
<xsl:template name="text_y">
<xsl:param name="preceding_depth" select="1" />
<xsl:param name="ancestor_depth" select="1" />
<xsl:param name="y" select="0" />
<xsl:choose>
<xsl:when test="$preceding_depth <= count(preceding::*)">
<xsl:choose>
<xsl:when test="name((preceding::*)[$preceding_depth])='div'">
<xsl:choose>
<xsl:when test="(preceding::*)[$preceding_depth]/@height">
<xsl:call-template name="text_y">
<xsl:with-param name="preceding_depth" select="$preceding_depth + 1" />
<xsl:with-param name="y" select="$y + (preceding::*)[$preceding_depth]/@height" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="text_y">
<xsl:with-param name="preceding_depth" select="$preceding_depth + 1" />
<xsl:with-param name="y">
<xsl:call-template name="add">
<xsl:with-param name="op1" select="$y" />
<xsl:with-param name="op2">
<xsl:call-template name="multiply">
<xsl:with-param name="op1" select="(preceding::*)[$preceding_depth]/ancestor-or-self::*[@font-size][1]/@font-size * (preceding::*)[$preceding_depth]/ancestor-or-self::*[@line-height][1]/@line-height" />
<xsl:with-param name="op2">
<xsl:call-template name="count-nl">
<xsl:with-param name="text" select="(preceding::*)[$preceding_depth]/text()" />
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="name((preceding::*)[$preceding_depth])='li'">
<xsl:call-template name="text_y">
<xsl:with-param name="preceding_depth" select="$preceding_depth + 1" />
<xsl:with-param name="y" select="$y
+ (preceding::*)[$preceding_depth]/ancestor::*[@font-size][1]/@font-size
* (preceding::*)[$preceding_depth]/ancestor::*[@line-height][1]/@line-height
" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="text_y">
<xsl:with-param name="preceding_depth" select="$preceding_depth + 1" />
<xsl:with-param name="y" select="$y" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$ancestor_depth <= count(ancestor::*)">
<xsl:choose>
<xsl:when test="name((ancestor::*)[$ancestor_depth])='ul'">
<xsl:call-template name="text_y">
<xsl:with-param name="preceding_depth" select="$preceding_depth" />
<xsl:with-param name="ancestor_depth" select="$ancestor_depth + 1" />
<xsl:with-param name="y"
select="
$y
+ (ancestor::*)[$ancestor_depth]/ancestor-or-self::*[@font-size][1]/@font-size
* (ancestor::*)[$ancestor_depth]/ancestor-or-self::*[@line-height][1]/@line-height
" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="text_y">
<xsl:with-param name="preceding_depth" select="$preceding_depth" />
<xsl:with-param name="ancestor_depth" select="$ancestor_depth + 1" />
<xsl:with-param name="y" select="$y" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$y" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="break-nl">
<xsl:param name="text" />
<xsl:param name="x" select="0" />
<xsl:param name="y" select="300" />
<xsl:param name="text-anchor" select="'start'" />
<xsl:param name="font-size" select="18" />
<xsl:param name="line-height" select="1.1" />
<xsl:if test="contains($text,$NewLine)">
<xsl:if test="string-length(substring-before($text,$NewLine))">
<text font-size="{$font-size}" x="{$x}" y="{$y}" text-anchor="{$text-anchor}">
<xsl:value-of select="substring-before($text,$NewLine)"/>
</text>
</xsl:if>
<xsl:call-template name="break-nl">
<xsl:with-param name="text" select="substring-after($text,$NewLine)"/>
<xsl:with-param name="x" select="$x"/>
<xsl:with-param name="y" select="$y + $font-size * $line-height"/>
<xsl:with-param name="text-anchor" select="$text-anchor"/>
<xsl:with-param name="font-size" select="$font-size"/>
<xsl:with-param name="line-height" select="$line-height"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="not(contains($text,$NewLine))">
<text font-size="{$font-size}" x="{$x}" y="{$y}" text-anchor="{$text-anchor}"><xsl:value-of select="$text"/></text>
</xsl:if>
</xsl:template>
<xsl:template name="multiply">
<xsl:param name="op1" select="1" />
<xsl:param name="op2" select="1" />
<xsl:value-of select="$op1 * $op2" />
</xsl:template>
<xsl:template name="add">
<xsl:param name="op1" select="0" />
<xsl:param name="op2" select="0" />
<xsl:value-of select="$op1 + $op2" />
</xsl:template>
<xsl:template name="count-nl">
<xsl:param name="text" />
<xsl:param name="count" select="0" />
<xsl:if test="contains($text,$NewLine)">
<xsl:call-template name="count-nl">
<xsl:with-param name="text" select="substring-after($text,$NewLine)"/>
<xsl:with-param name="count" select="$count + 1" />
</xsl:call-template>
</xsl:if>
<xsl:if test="not(contains($text,$NewLine))">
<xsl:value-of select="$count" />
</xsl:if>
</xsl:template>
</xsl:stylesheet>
--- NEW FILE: slide01.xml ---
<?xml version="1.0" ?>
<slides title="cairo" font-size="40" line-height="1.8">
<slide title="Outline">
<ul line-height="2.4">
<li>Introduction</li>
<li>Architecture</li>
<li>API Examples</li>
<li>Status</li>
<li>Future Work</li>
</ul>
</slide>
</slides>
--- NEW FILE: slide02.xml ---
<?xml version="1.0" ?>
<slides title="cairo" font-size="40" line-height="1.8">
<slide title="Introduction">
<ul>
<li>Immediate mode drawing library
<ul font-size="30">
<li>Paths, stroke, fill</li>
<li>Plus Porter/Duff compositing</li>
</ul></li>
<li>Multiple backends
<ul font-size="30">
<li>Graphics systems (displays, printers)</li>
<li>Operating systems</li>
</ul></li>
<li>High-fidelity output</li>
<li>Friendly output</li>
</ul>
</slide>
</slides>
--- NEW FILE: slide03.xml ---
<?xml version="1.0" ?>
<slides title="cairo" font-size="40" line-height="1.8">
<slide title=" 2D Graphics ">
<ul line-height="1.6">
<li>Document-centric</li>
<li>Lots of text</li>
<li>Lots of images and icons</li>
<li>Few large geometric figures</li>
<li>Tightly coupled with printing</li>
<li>Fonts and graphics must match across</li>
<li bullet="off">output devices</li>
<li>Minimal animation</li>
</ul>
</slide>
</slides>
--- NEW FILE: slides.xml ---
<?xml version="1.0" ?>
<slides title="cairo" font-size="40" line-height="1.8">
<slide title="Outline">
<ul line-height="2.4">
<li>Introduction</li>
<li>Architecture</li>
<li>API Examples</li>
<li>Status</li>
<li>Future Work</li>
</ul>
</slide>
<slide title="Introduction">
<ul>
<li>Immediate mode drawing library
<ul font-size="30">
<li>Paths, stroke, fill</li>
<li>Plus Porter/Duff compositing</li>
</ul></li>
<li>Multiple backends
<ul font-size="30">
<li>Graphics systems (displays, printers)</li>
<li>Operating systems</li>
</ul></li>
<li>High-fidelity output</li>
<li>Friendly output</li>
</ul>
</slide>
<slide title=" 2D Graphics ">
<ul line-height="1.6">
<li>Document-centric</li>
<li>Lots of text</li>
<li>Lots of images and icons</li>
<li>Few large geometric figures</li>
<li>Tightly coupled with printing</li>
<li>Fonts and graphics must match across</li>
<li bullet="off">output devices</li>
<li>Minimal animation</li>
</ul>
</slide>
</slides>
Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo-artwork/ChangeLog,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/ChangeLog 5 May 2004 02:07:39 -0000 1.2
--- b/ChangeLog 15 May 2004 12:15:44 -0000 1.3
***************
*** 1,2 ****
--- 1,12 ----
+ 2004-05-15 Richard D. Worth <richard at theworths.org>
+
+ * cairo-slides.xsl: added.
+ * slides.xml: added.
+ * slide01.xml: added.
+ * slide02.xml: added.
+ * slide03.xml: added.
+ * BUGS: added.
+ * README, NEWS: updated with information on cairo-slides.
+
2004-05-04 Richard D. Worth <richard at theworths.org>
Index: NEWS
===================================================================
RCS file: /cvs/cairo/cairo-artwork/NEWS,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/NEWS 5 May 2004 02:07:39 -0000 1.2
--- b/NEWS 15 May 2004 12:15:44 -0000 1.3
***************
*** 1,2 ****
--- 1,11 ----
+ 2004-05-15
+ ==========
+ The first version of cairo-slides was released. cairo-slides is an XSLT
+ (Extensible Stylesheet Language Transformation) that transforms a source
+ content XML file into pretty cairo SVG presentation slides. Support includes
+ inclusion of any SVG content, as well as vertical-flowing text by way of 3
+ XHTML elements: ul, li, div. SVG content can be positioned absolutely or
+ in the vertical flow. See README for more details.
+
2004-05-01
==========
Index: README
===================================================================
RCS file: /cvs/cairo/cairo-artwork/README,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/README 5 May 2004 02:07:39 -0000 1.2
--- b/README 15 May 2004 12:15:44 -0000 1.3
***************
*** 9,12 ****
--- 9,82 ----
cairo-drawable.
+ cairo-slides
+ ------------
+ cairo-slides is an XSLT (Extensible Stylesheet Language Transformation)
+ file. It transforms a content XML file into a nice cairo SVG slide. The
+ content XML file should be in the following format:
+
+ <?xml version="1.0" ?>
+ <slides title="presentation title">
+ <slide title="slide title" font-size="40" line-height="1.5">
+ <div>
+ This text starts off the slide</div>
+ <ul>
+ <li>Bullet 1</li>
+ <li>Bullet 2</li>
+ <li bullet="off">continued text from bullet 2</li>
+ </ul>
+ <div align="center" font-size="30">
+ This text will follow the bulleted list
+ and will be centered on the slide.
+ </div>
+ <g transform="translate(650, 100)">
+ <circle cx="0" cy="0" r="50" fill="lightGreen" />
+ </g>
+ <div>
+ <g>
+ <circle cx="0" cy="0" r="50" fill="lightBlue" />
+ </g>
+ </div>
+ </slide>
+ </slides>
+
+ (NOTE: The current version of cairo-slides can only handle one slide per
+ file. See BUGS for more info.)
+
+ The <slide> element can contain any svg (wrapped in a <g> group) and
+ (so far) three XHTML elements (with limited attributes).
+
+ Supported SVG Elements: g, (all others, placed in a <g>)
+ <g>
+ An SVG chunk can be added by way of the <g> group element. It
+ can be absolutely positioned on the slide by adding a
+ transform="translate(x,y)" attribute. Or it can be placed in
+ the vertical flow by wrapping it in a <div> block element.
+
+ Supported XHTML Elements: ul, li, div
+ <ul>
+ attributes:
+ font-size=(number) required, inherited
+ line-height=(number) required, inherited
+ bullet=('on'|'off') default: 'on'
+ <li>
+ attributes:
+ bullet=('on'|'off') default: 'on'
+ <div>
+ attributes:
+ font-size=(number) required, inherited
+ line-height=(number) required, inherited
+ height=(number) default: auto (calculated from font-size
+ and line-height)
+ align=('left'|'center'|'right') default: 'left'
+ Text is wrapped by newline characters within a div.
+
+ Each ul and div needs a font-size and line-height specified. They can
+ be specified on any of the following elements: slides, slide, ul, div.
+ They are then inhereted and can be overriden (as shown in the above
+ example).
+
+ NOTE: Each ul and div MUST have a font-size and line-height attribute
+ defined, whether on self or inhereted. This is a common source of error.
+
History
-------
More information about the cairo-commit
mailing list