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

Source for file FontFace.php

Documentation is available at FontFace.php

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

Documentation generated on Wed, 18 Jun 2008 06:28:26 +0200 by phpDocumentor 1.3.2