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_string class.
23 : *
24 : * When creating a string, you need to handle the advancements between
25 : * characters which varies depending on the current and next characters
26 : * (when the font has kerning data). Also, various characters have various
27 : * width in a fully dynamic font.
28 : *
29 : * Therefore, just an array of meshes would not be enough. The ftmesh_string
30 : * is a queue which adds the advance amount between each character to the
31 : * meshes of each character.
32 : */
33 :
34 : // self
35 : //
36 : #include <ftmesh/mesh_char.h>
37 :
38 :
39 :
40 : namespace ftmesh
41 : {
42 :
43 :
44 2 : class mesh_string
45 : : public mesh_char::vector_t
46 : {
47 : public:
48 : typedef std::shared_ptr<mesh_string> pointer_t;
49 :
50 : void add_glyph(mesh::pointer_t mesh, float advance);
51 :
52 : private:
53 : };
54 :
55 :
56 : } // namespace ftmesh
57 : // vim: ts=4 sw=4 et
|