LCOV - code coverage report
Current view: top level - ftmesh - mesh_string.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 3 3 100.0 %
Date: 2022-01-29 21:33:29 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.13