1<?php
2/***************************************************************************
3 *   copyright            : (C) 2005 by Pascal Brachet - France            *
4 *   pbrachet_NOSPAM_xm1math.net (replace _NOSPAM_ by @)                   *
5 *   http://www.xm1math.net/phpmathpublisher/                              *
6 *                                                                         *
7 *   This program is free software; you can redistribute it and/or modify  *
8 *   it under the terms of the GNU General Public License as published by  *
9 *   the Free Software Foundation; either version 2 of the License, or     *
10 *   (at your option) any later version.                                   *
11 *                                                                         *
12 ***************************************************************************/
13
14namespace RL\PhpMathPublisher;
15
16/**
17 * \RL\PhpMathPublisher\TextExpression
18 *
19 * @author Pascal Brachet <pbrachet@xm1math.net>
20 * @author Peter Vasilevsky <tuxoiduser@gmail.com> a.k.a. Tux-oid
21 * @license GPLv2
22 */
23class TextExpression extends Expression
24{
25    /**
26     * Constructor
27     *
28     * @param string $exp
29     * @param Helper $helper
30     */
31    public function __construct($exp, Helper $helper)
32    {
33        $this->helper = $helper;
34        $this->text = $exp;
35    }
36
37    /**
38     * @param $size
39     */
40    public function draw($size)
41    {
42        $this->image = $this->helper->displayMath($this->text, $size);
43        $this->verticalBased = imagesy($this->image) / 2;
44    }
45}
46