cvs: pear /Text_Wiki/Text/Wiki/BBCode/Render/Latex Font.php

From: Date: Mon, 18 Jul 2005 16:32:32 +0000
Subject: cvs: pear /Text_Wiki/Text/Wiki/BBCode/Render/Latex Font.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-33124@lists.php.net to get a copy of this message
toggg Mon Jul 18 12:32:32 2005 EDT Added files: /pear/Text_Wiki/Text/Wiki/BBCode/Render/Latex Font.php Log: Latex renderer for font rule http://cvs.php.net/co.php/pear/Text_Wiki/Text/Wiki/BBCode/Render/Latex/Font.php?r=1.1&p=1 Index: pear/Text_Wiki/Text/Wiki/BBCode/Render/Latex/Font.php +++ pear/Text_Wiki/Text/Wiki/BBCode/Render/Latex/Font.php <?php // vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: /** * BBCode: exra Font rules renderer to size the text * * PHP versions 4 and 5 * * @category Text * @package Text_Wiki * @author Bertrand Gugger <bertrand@toggg.com> * @copyright 2005 bertrand Gugger * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 * @version CVS: $Id: Font.php,v 1.1 2005/07/18 16:32:31 toggg Exp $ * @link http://pear.php.net/package/Text_Wiki */ /** * Font rule render class (used for BBCode) * * @category Text * @package Text_Wiki * @author Bertrand Gugger <bertrand@toggg.com> * @copyright 2005 bertrand Gugger * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 * @version Release: @package_version@ * @link http://pear.php.net/package/Text_Wiki * @see Text_Wiki::Text_Wiki_Render() */ class Text_Wiki_Render_Latex_Font extends Text_Wiki_Render { /** * A table to translate the sizes * * @access public * @var array */ var $sizes = array( 'tiny' => 5, 'scriptsize' => 7, 'footnotesize' => 8, 'small' => 9, 'normalsize' => 11, 'large' => 13, 'Large' => 16, 'LARGE' => 19, 'huge' => 22, 'Huge' => 9999); /** * Renders a token into text matching the requested format. * process the font size option * * @access public * @param array $options The "options" portion of the token (second element). * @return string The text rendered from the token options. */ function token($options) { if ($options['type'] == 'start') { foreach ($this->sizes as $key => $lim) { if ($options['size'] < $lim) { break; } } return "\\{$key}{"; } if ($options['type'] == 'end') { return '}'; } } } ?>

« previous php.pear.cvs (#33124) next »