Source for file FontSP.class.php

Documentation is available at FontSP.class.php

  1. <?php
  2.  
  3. require_once(HARMONI."GUIManager/StyleProperty.class.php");
  4. require_once(HARMONI."GUIManager/StyleComponents/FontStyleSC.class.php");
  5. require_once(HARMONI."GUIManager/StyleComponents/FontVariantSC.class.php");
  6. require_once(HARMONI."GUIManager/StyleComponents/FontWeightSC.class.php");
  7. require_once(HARMONI."GUIManager/StyleComponents/FontSizeSC.class.php");
  8. require_once(HARMONI."GUIManager/StyleComponents/FontFamilySC.class.php");
  9.  
  10. /**
  11. * The FontSP represents the 'font' StyleProperty.
  12. *
  13. * A StyleProperty (SP) is one of the tree building pieces of CSS styles. It stores
  14. * information about a single CSS style property by storing one or more
  15. * <code>StyleComponents</code>.
  16. *
  17. * The other two CSS styles building pieces are <code>StyleComponents</code> and
  18. * <code>StyleCollections</code>.
  19. *
  20. * @package harmoni.gui.sps
  21. *
  22. * @copyright Copyright &copy; 2005, Middlebury College
  23. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  24. *
  25. * @version $Id: FontSP.class.php,v 1.7 2006/06/02 15:56:07 cws-midd Exp $
  26. */
  27. class FontSP extends StyleProperty {
  28.  
  29. /**
  30. * The constructor. All parameters but size and family could be null,
  31. * in which case they will not be taken in consideration.
  32. * @access public
  33. * @param string family The font family.
  34. * @param string size The font size.
  35. * @param optional string style The font style.
  36. * @param optional string weight The font weight.
  37. * @param optional string variant The font variant.
  38. ***/
  39. function FontSP($family=null, $size=null, $style=null, $weight=null, $variant=null) {
  40. $this->StyleProperty("font", "Font", "This property sets the current
  41. font family, size, style, weight,
  42. variant.");
  43.  
  44. $this->_SCList = array("fontstylesc", 'fontvariantsc', 'fontweightsc',
  45. 'fontsizesc', 'fontfamilysc');
  46. if (!is_null($style)) $this->addSC(new FontStyleSC($style));
  47. if (!is_null($variant)) $this->addSC(new FontVariantSC($variant));
  48. if (!is_null($weight)) $this->addSC(new FontWeightSC($weight));
  49. if (!is_null($size)) $this->addSC(new FontSizeSC($size));
  50. if (!is_null($family)) $this->addSC(new FontFamilySC($family));
  51. }
  52.  
  53. }
  54.  
  55. ?>

Documentation generated on Wed, 19 Sep 2007 10:23:19 -0400 by phpDocumentor 1.3.0RC3