Line data Source code
1 : // Copyright (c) 2021 Made to Order Software Corp. All Rights Reserved
2 : //
3 : // https://snapwebsites.org/project/ftmesh
4 : // contact@m2osw.com
5 : //
6 : // This program is free software; you can redistribute it and/or modify
7 : // it under the terms of the GNU General Public License as published by
8 : // the Free Software Foundation; either version 2 of the License, or
9 : // (at your option) any later version.
10 : //
11 : // This program is distributed in the hope that it will be useful,
12 : // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 : // GNU General Public License for more details.
15 : //
16 : // You should have received a copy of the GNU General Public License along
17 : // with this program; if not, write to the Free Software Foundation, Inc.,
18 : // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 : #pragma once
20 :
21 : /** \file
22 : * \brief Definitions of the ftmesh_char class.
23 : *
24 : * When creating a string, you need to handle the advancements between
25 : * characters. A character is a mesh and an advancement. This class holds
26 : * on both of these parameters.
27 : */
28 :
29 : // self
30 : //
31 : #include <ftmesh/mesh.h>
32 :
33 :
34 : namespace ftmesh
35 : {
36 :
37 :
38 9 : class mesh_char
39 : {
40 : public:
41 : typedef std::shared_ptr<mesh_char> pointer_t;
42 : typedef std::vector<pointer_t> vector_t;
43 :
44 : mesh_char(mesh::pointer_t mesh, float advance);
45 :
46 : mesh::pointer_t get_mesh() const;
47 : float get_advance() const;
48 :
49 : private:
50 : mesh::pointer_t f_mesh = mesh::pointer_t();
51 : int f_advance = 0;
52 : };
53 :
54 :
55 : } // namespace ftmesh
56 : // vim: ts=4 sw=4 et
|