OpenDocumentPHP
[ class tree: OpenDocumentPHP ] [ index: OpenDocumentPHP ] [ all elements ]

Source for file FontFace.php

Documentation is available at FontFace.php

  1. <?php
  2. /*
  3.  * Created on 22.01.2007 by Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
  4.  *
  5.  * PHP versions 5.2 or better.
  6.  *
  7.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8.  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  9.  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  10.  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  11.  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  12.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  13.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  14.  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  15.  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  16.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  17.  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  18.  *
  19.  * This software consists of voluntary contributions made by many individuals
  20.  * and is licensed under the GPL. For more information please see
  21.  * <http://opendocumentphp.org>.
  22.  * 
  23.  * $Id: FontFace.php 136 2007-03-02 18:02:29Z nmarkgraf $
  24.  */
  25. require_once 'OpenDocumentPHP/util/ElementFragment.php';
  26. /**
  27.  * FontFace class.
  28.  * 
  29.  * @author         Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
  30.  * @copyright     Copyright in 2006, 2007 by The OpenDocumentPHP Team
  31.  * @license     http://www.gnu.org/licenses/gpl.html GNU General Public License 2.0.
  32.  * @version        $Revision: 136 $
  33.  * @package        OpenDocumentPHP
  34.  * @since         0.5.0 - 08.02.2007
  35.  */
  36. class FontFace extends ElementFragment {
  37.     /**
  38.      * Set the root element to 'style:font-face-decl'.
  39.      * 
  40.      * @access protected
  41.      * @since         0.5.0 - 08.02.2007
  42.      */
  43.     protected function __setRoot({
  44.         $this->root = $this->domFragment->createElementNS(self :: STYLE'style:font-face');
  45.     }
  46.     /* ---------- */
  47.     /* Style Name */
  48.     /* ---------- */
  49.     /**
  50.      * Set style name.
  51.      * 
  52.      * 
  53.      * @access        public
  54.      * @since         0.5.0 - 08.02.2007
  55.      */
  56.     function setStyleName($name{
  57.         $this->setAttributeNS(self :: STYLE'style:name'$name);
  58.     }
  59.     /**
  60.      * Retrive style name.
  61.      * 
  62.      * @access        public
  63.      * @since         0.5.0 - 08.02.2007
  64.      */
  65.     function getStyleName({
  66.         return $this->getAttributeNS(self :: STYLE'style:name');
  67.     }
  68.     /* ---------- */
  69.     /* font pitch */
  70.     /* ---------- */
  71.     /**
  72.      * Set font pitch.
  73.      * 
  74.      * @access        public
  75.      * @since         0.5.0 - 08.02.2007
  76.      */
  77.     function setFontPitch($name{
  78.         $this->setAttributeNS(self :: STYLE'style:font-pitch'$name);
  79.     }
  80.     /**
  81.      * Retrieve font pitch
  82.      * 
  83.      * @access        public
  84.      * @since         0.5.0 - 08.02.2007
  85.      */
  86.     function getFontPitch({
  87.         return $this->getAttributeNS(self :: STYLE'style:font-pitch');
  88.     }
  89.     /* ------------------- */
  90.     /* Font Family Generic */
  91.     /* ------------------- */
  92.     /**
  93.      * Set font family generic.
  94.      * 
  95.      * @access        public
  96.      * @since         0.5.0 - 08.02.2007
  97.      */
  98.     function setFontFamilyGeneric($name{
  99.         $this->setAttributeNS(self :: STYLE'style:font-family-generic'$name);
  100.     }
  101.     /**
  102.      * Retrieve font family gerneric
  103.      * 
  104.      * @access        public
  105.      * @since         0.5.0 - 08.02.2007
  106.      */
  107.     function getFontFamilyGeneric({
  108.         return $this->getAttributeNS(self :: STYLE'style:font-family-generic');
  109.     }
  110.     /* --------------- */
  111.     /* Font Adornments */
  112.     /* --------------- */
  113.     /**
  114.      * Set font adornments.
  115.      * 
  116.      * @access        public
  117.      * @since         0.5.0 - 08.02.2007
  118.      */
  119.     function setFontAdornments($name{
  120.         $this->setAttributeNS(self :: STYLE'style:font-adornments'$name);
  121.     }
  122.     /**
  123.      * Retrieve font adornments.
  124.      * 
  125.      * @access        public
  126.      * @since         0.5.0 - 08.02.2007
  127.      */
  128.     function getFontAdornments({
  129.         return $this->getAttributeNS(self :: STYLE'style:font-adornments');
  130.     }
  131.     /* ------------ */
  132.     /* Font Charset */
  133.     /* ------------ */
  134.     /**
  135.      * Set font charset.
  136.      * 
  137.      * @todo check if $name matches pattern: [A-Za-z][A-Za-z0-9._\-]*
  138.      * @access        public
  139.      * @since         0.5.0 - 08.02.2007
  140.      */
  141.     function setFontCharset($name{
  142.         $this->setAttributeNS(self :: STYLE'style:font-charset'$name);
  143.     }
  144.     /**
  145.      * Retieve font charset.
  146.      * 
  147.      * @access        public
  148.      * @since         0.5.0 - 08.02.2007
  149.      */
  150.     function getFontCharset({
  151.         return $this->getAttributeNS(self :: STYLE'style:font-charset');
  152.     }
  153.     /* === */
  154.     /* SVG */
  155.     /* === */
  156.     //
  157.     /* ----------- */
  158.     /* font family */
  159.     /* ----------- */
  160.     /**
  161.      * Set SVG font family.
  162.      * 
  163.      * @access        public
  164.      * @since         0.5.0 - 08.02.2007
  165.      */
  166.     function setSVGFontFamily($name{
  167.         $this->setAttributeNS(self :: SVG'svg:font-family'$name);
  168.     }
  169.     /**
  170.      * Retreive SVG font family.
  171.      * 
  172.      * @access        public
  173.      * @since         0.5.0 - 08.02.2007
  174.      */
  175.     function getSVGFontFamily({
  176.         return $this->getAttributeNS(self :: SVG'svg:font-family');
  177.     }
  178.     /* ------------ */
  179.     /* font variant */
  180.     /* ------------ */
  181.     /**
  182.      * Set SVG font variant.
  183.      * 
  184.      * @access        public
  185.      * @since         0.5.0 - 08.02.2007
  186.      */
  187.     function setSVGFontVariant($name{
  188.         $this->setAttributeNS(self :: SVG'svg:font-variant'$name);
  189.     }
  190.     /**
  191.      * Retrieve SVG font variant.
  192.      * 
  193.      * @access        public
  194.      * @since         0.5.0 - 08.02.2007
  195.      */
  196.     function getSVGFontVariant({
  197.         return $this->getAttributeNS(self :: SVG'svg:font-variant');
  198.     }
  199.     /* ----------- */
  200.     /* font weight */
  201.     /* ----------- */
  202.     /**
  203.      * Set SVG font weight
  204.      * 
  205.      * @access        public
  206.      * @since         0.5.0 - 08.02.2007
  207.      */
  208.     function setSVGFontWeight($name{
  209.         $this->setAttributeNS(self :: SVG'svg:font-weight'$name);
  210.     }
  211.     /**
  212.      * Retrieve SVG font weight.
  213.      * 
  214.      * @access        public
  215.      * @since         0.5.0 - 08.02.2007
  216.      */
  217.     function getSVGFontWeight({
  218.         return $this->getAttributeNS(self :: SVG'svg:font-weight');
  219.     }
  220.     /*
  221.      * @todo: Matching functions this:
  222.      * <optional>
  223.             <attribute name="svg:font-stretch">
  224.                 <choice>
  225.                     <value>normal</value>
  226.                     <value>ultra-condensed</value>
  227.                     <value>extra-condensed</value>
  228.                     <value>condensed</value>
  229.                     <value>semi-condensed</value>
  230.                     <value>semi-expanded</value>
  231.                     <value>expanded</value>
  232.                     <value>extra-expanded</value>
  233.                     <value>ultra-expanded</value>
  234.                 </choice>
  235.             </attribute>
  236.         </optional>
  237.         <optional>
  238.             <attribute name="svg:font-size">
  239.                 <ref name="positiveLength"/>
  240.             </attribute>
  241.         </optional>
  242.         <optional>
  243.             <attribute name="svg:unicode-range"/>
  244.         </optional>
  245.         <optional>
  246.             <attribute name="svg:units-per-em">
  247.                 <ref name="integer"/>
  248.             </attribute>
  249.         </optional>
  250.         <optional>
  251.             <attribute name="svg:panose-1"/>
  252.         </optional>
  253.         <optional>
  254.             <attribute name="svg:stemv">
  255.                 <ref name="integer"/>
  256.             </attribute>
  257.         </optional>
  258.         <optional>
  259.             <attribute name="svg:stemh">
  260.                 <ref name="integer"/>
  261.             </attribute>
  262.         </optional>
  263.         <optional>
  264.             <attribute name="svg:slope">
  265.                 <ref name="integer"/>
  266.             </attribute>
  267.             </optional>
  268.         <optional>
  269.             <attribute name="svg:cap-height">
  270.                 <ref name="integer"/>
  271.             </attribute>
  272.         </optional>
  273.         <optional>
  274.             <attribute name="svg:x-height">
  275.                 <ref name="integer"/>
  276.             </attribute>
  277.         </optional>
  278.         <optional>
  279.             <attribute name="svg:accent-height">
  280.                 <ref name="integer"/>
  281.             </attribute>
  282.         </optional>
  283.         <optional>
  284.             <attribute name="svg:ascent">
  285.                 <ref name="integer"/>
  286.             </attribute>
  287.         </optional>
  288.         <optional>
  289.             <attribute name="svg:descent">
  290.                 <ref name="integer"/>
  291.             </attribute>
  292.         </optional>
  293.         <optional>
  294.             <attribute name="svg:widths"/>
  295.         </optional>
  296.         <optional>
  297.             <attribute name="svg:bbox"/>
  298.         </optional>
  299.         <optional>
  300.             <attribute name="svg:ideographic">
  301.                 <ref name="integer"/>
  302.             </attribute>
  303.         </optional>
  304.         <optional>
  305.             <attribute name="svg:alphabetic">
  306.                 <ref name="integer"/>
  307.             </attribute>
  308.         </optional>
  309.         <optional>
  310.             <attribute name="svg:mathematical">
  311.                 <ref name="integer"/>
  312.             </attribute>
  313.         </optional>
  314.         <optional>
  315.             <attribute name="svg:hanging">
  316.                 <ref name="integer"/>
  317.             </attribute>
  318.         </optional>
  319.         <optional>
  320.             <attribute name="svg:v-ideographic">
  321.                 <ref name="integer"/>
  322.             </attribute>
  323.         </optional>
  324.         <optional>
  325.             <attribute name="svg:v-alphabetic">
  326.                 <ref name="integer"/>
  327.             </attribute>
  328.         </optional>
  329.         <optional>
  330.             <attribute name="svg:v-mathematical">
  331.                 <ref name="integer"/>
  332.             </attribute>
  333.         </optional>
  334.         <optional>
  335.             <attribute name="svg:v-hanging">
  336.                 <ref name="integer"/>
  337.             </attribute>
  338.         </optional>
  339.         <optional>
  340.             <attribute name="svg:underline-position">
  341.                 <ref name="integer"/>
  342.             </attribute>
  343.         </optional>
  344.         <optional>
  345.             <attribute name="svg:underline-thickness">
  346.                 <ref name="integer"/>
  347.             </attribute>
  348.         </optional>
  349.         <optional>
  350.             <attribute name="svg:strikethrough-position">
  351.                 <ref name="integer"/>
  352.             </attribute>
  353.         </optional>
  354.         <optional>
  355.             <attribute name="svg:strikethrough-thickness">
  356.                 <ref name="integer"/>
  357.             </attribute>
  358.         </optional>
  359.         <optional>
  360.             <attribute name="svg:overline-position">
  361.                 <ref name="integer"/>
  362.             </attribute>
  363.             </optional>
  364.         <optional>
  365.             <attribute name="svg:overline-thickness">
  366.                 <ref name="integer"/>
  367.             </attribute>
  368.         </optional>
  369.     </define>
  370.     
  371.      */
  372. }
  373. ?>

Documentation generated on Tue, 12 Jun 2007 09:59:48 +0200 by phpDocumentor 1.3.2