diff options
Diffstat (limited to 'examples/fo/advanced/rounded-corners.fo')
-rw-r--r-- | examples/fo/advanced/rounded-corners.fo | 126 |
1 files changed, 0 insertions, 126 deletions
diff --git a/examples/fo/advanced/rounded-corners.fo b/examples/fo/advanced/rounded-corners.fo deleted file mode 100644 index 7b275ae17..000000000 --- a/examples/fo/advanced/rounded-corners.fo +++ /dev/null @@ -1,126 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"> - <fo:layout-master-set> - <fo:simple-page-master master-name="main" page-width="21cm" page-height="29.7cm" margin-top="5mm"> - <fo:region-body margin-bottom="30pt" margin-right="60pt" margin-left="60pt" margin-top="30pt"/> - <fo:region-after extent="4in"/> - </fo:simple-page-master> - </fo:layout-master-set> - <fo:page-sequence master-reference="main"> - <fo:flow flow-name="xsl-region-body" font-size="12pt"> - <fo:block font-size="14pt" font-weight="bold"> - Examples using Rounded Corners - </fo:block> - <fo:block margin="20pt 0 40pt 0"> - <fo:block>The "border-radius" property in the http://xmlgraphics.apache.org/fop/extensions namespace is a shorthand property for setting appropriate values for "border-*-radius" (see below), and is used to specify round corners on block areas. The property takes one or two values: - </fo:block> - <fo:block-container margin="10 20pt 20pt 20pt"> - <fo:block border-style="solid" border-width="10" border-color="#00f" fox:border-radius="20pt" padding="20pt" text-align="center" margin-bottom="10pt"> Circular corners are specified when 'border-radius' is set to a single value. This value is the radius of the outer quadrant of the corner.</fo:block> - <fo:block border-style="solid" border-width="10" border-color="#00f" fox:border-radius="20pt 40pt" padding="20pt" text-align="center" margin-bottom="10pt">Quarter-ellipse corners can be generated by setting two values for the property. The first value is the radius in the Inline Progression Direction. The second value is the radius in the Block Progression Direction. - </fo:block> - </fo:block-container> - </fo:block> - <fo:block margin="20pt 0 40pt 0"> - <fo:block>The radii for a specific corner can be specified for each <fo:inline font-style="italic">CORNER</fo:inline> (in 'before-start', 'before-end', 'after-start', 'after-end') with the property "border-<fo:inline font-style="italic">CORNER</fo:inline>-radius". These properties - have the same interpretation as the "border-radius" property. </fo:block> - <fo:table border-collapse="separate" margin-top="10pt"> - <fo:table-column column-width="200pt"/> - <fo:table-column column-width="200pt"/> - <fo:table-body> - <fo:table-row> - <fo:table-cell> - <fo:block margin-left="50pt" border-style="solid" border-width="50pt 0 0 50pt" border-color="#00f" fox:border-before-start-radius="100pt" height="100pt"> - <fo:block padding="50pt"/> - </fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block margin-left="50pt" border-style="solid" border-width="50pt 0 0 50pt" border-color="#00f" fox:border-before-start-radius="200pt 100pt" height="100pt"> - <fo:block padding="50pt"/> - </fo:block> - </fo:table-cell> - </fo:table-row> - </fo:table-body> - </fo:table> - </fo:block> - <fo:block margin="20pt"> - <fo:block border-style="solid" background-color="#aaf" border-width="10" border-color="#00f" fox:border-radius="50pt" padding="20pt" text-align="center" margin-bottom="20pt">Backgrounds are cropped…</fo:block> - <fo:block break-after="page" border-style="solid" background-color="#aaf" border-width="0" border-color="#00f" fox:border-radius="50pt" padding="20pt" text-align="center" margin-bottom="20pt">…even with zero width borders.</fo:block> - </fo:block> - <fo:block>There are two canonical cases for rounded corners distinguished by the following condition: The width of each border segment is less than the corner radius perpendicular to that segment. This is demonstrated in Case <fo:inline font-style="italic">I</fo:inline> when this condition is <fo:inline font-style="italic">true</fo:inline> and Case <fo:inline font-style="italic">II</fo:inline> when <fo:inline font-style="italic">false</fo:inline>.</fo:block> - <fo:table border-collapse="separate" margin-bottom="25pt"> - <fo:table-column column-width="200pt"/> - <fo:table-column column-width="200pt"/> - <fo:table-body> - <fo:table-row> - <fo:table-cell height="100pt"> - <fo:block margin-left="50pt" border-style="solid" border-width="70pt 0 0 70pt" border-color="#00f" fox:border-before-start-radius="100pt" height="100pt"> - <fo:block padding="50pt" text-align="center"> - <fo:inline font-style="italic">I</fo:inline> - </fo:block> - </fo:block> - </fo:table-cell> - <fo:table-cell height="100pt"> - <fo:block margin-left="50pt" border-style="solid" border-width="70pt 0 0 70pt" border-color="#00f" fox:border-before-start-radius="50pt" height="100pt"> - <fo:block padding="50pt" text-align="center"> - <fo:inline font-style="italic">II</fo:inline> - </fo:block> - </fo:block> - </fo:table-cell> - </fo:table-row> - </fo:table-body> - </fo:table> - <fo:table border-collapse="separate" margin="40pt 0 20pt 0" break-after="page"> - <fo:table-column column-width="150pt"/> - <fo:table-column column-width="150pt"/> - <fo:table-column column-width="150pt"/> - <fo:table-body> - <fo:table-row> - <fo:table-cell number-columns-spanned="3"> - <fo:block margin-bottom="20pt">The border segments join at a line that coincides with the one that intersects the inner and outer corners of the equivalent rectangular corner. This is clearly demonstrated below where rounded borders are overlayed on top of rectangular borders.</fo:block> - </fo:table-cell> - </fo:table-row> - <fo:table-row> - <fo:table-cell border-style="solid" border-width="0" border-before-color="#afa" border-start-color="#aaf" border-before-width="50pt" border-start-width="50pt" height="100pt"> - <fo:block margin-top="-50pt" border-style="solid" border-width="0" border-before-color="#0f0" border-start-color="#00f" fox:border-before-start-radius="50pt" border-before-width="50pt" border-start-width="50pt" height="100pt"> - <fo:block margin-bottom="100pt"/> - </fo:block> - </fo:table-cell> - <fo:table-cell border-style="solid" border-width="0" border-before-color="#afa" border-start-color="#aaf" border-before-width="50pt" border-start-width="50pt" height="100pt"> - <fo:block margin-top="-50pt" border-style="solid" border-width="0" border-before-color="#0f0" border-start-color="#00f" fox:border-before-start-radius="100pt" border-before-width="50pt" border-start-width="50pt" height="100pt"> - <fo:block margin-bottom="100pt"/> - </fo:block> - </fo:table-cell> - <fo:table-cell border-style="solid" border-width="0" border-before-color="#afa" border-start-color="#aaf" border-before-width="50pt" border-start-width="50pt" height="100pt"> - <fo:block margin-top="-50pt" border-style="solid" border-width="0" border-before-color="#0f0" border-start-color="#00f" fox:border-before-start-radius="150pt 100pt" border-before-width="50pt" border-start-width="50pt" height="100pt"> - <fo:block margin-bottom="100pt"/> - </fo:block> - </fo:table-cell> - </fo:table-row> - <fo:table-row> - <fo:table-cell border-style="solid" border-width="0" border-before-color="#afa" border-start-color="#aaf" border-before-width="50pt" border-start-width="100pt" height="100pt"> - <fo:block margin-top="-50pt" border-style="solid" border-width="0" border-before-color="#0f0" border-start-color="#00f" fox:border-before-start-radius="50pt" border-before-width="50pt" border-start-width="100pt" height="100pt"> - <fo:block margin-bottom="100pt"/> - </fo:block> - </fo:table-cell> - <fo:table-cell border-style="solid" border-width="0" border-before-color="#afa" border-start-color="#aaf" border-before-width="50pt" border-start-width="100pt" height="100pt"> - <fo:block margin-top="-50pt" border-style="solid" border-width="0" border-before-color="#0f0" border-start-color="#00f" fox:border-before-start-radius="100pt" border-before-width="50pt" border-start-width="100pt" height="100pt"> - <fo:block margin-bottom="100pt"/> - </fo:block> - </fo:table-cell> - <fo:table-cell border-style="solid" border-width="0" border-before-color="#afa" border-start-color="#aaf" border-before-width="50pt" border-start-width="100pt" height="100pt"> - <fo:block margin-top="-50pt" border-style="solid" border-width="0" border-before-color="#0f0" border-start-color="#00f" fox:border-before-start-radius="150pt 100pt" border-before-width="50pt" border-start-width="100pt" height="100pt"> - <fo:block margin-bottom="100pt"/> - </fo:block> - </fo:table-cell> - </fo:table-row> - </fo:table-body> - </fo:table> - <fo:block margin="20pt 0 40pt 0"> - <fo:block> </fo:block> - <fo:block-container margin="10 20pt 20pt 20pt"> - <fo:block border-style="solid" border-width="10" border-color="#00f" fox:border-radius="2000pt" padding="20pt" text-align="center" margin-bottom="10pt">If border radii are specified that would produce overlapping curves (as is the case for the block containg <fo:inline font-style="italic">this</fo:inline> text), then all border radii are proportionally reduced until none of them overlap. This is in accordance to the procedure described at http://www.w3.org/TR/css3-background/#corner-overlap.</fo:block> - </fo:block-container> - </fo:block> - </fo:flow> - </fo:page-sequence> -</fo:root> |