LCOV - code coverage report
Current view: top level - ftmesh - font.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 1 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             : #pragma once
      20             : 
      21             : /** \file
      22             :  * \brief Definitions of the ftmesh class.
      23             :  *
      24             :  * This header defines the ftmesh class which represents one glyphs.
      25             :  *
      26             :  * When a glyph is loaded, it gets transformed in a list of vertices which
      27             :  * represent triangles that can be used to render the character.
      28             :  */
      29             : 
      30             : // self
      31             : //
      32             : #include    <ftmesh/mesh_string.h>
      33             : 
      34             : 
      35             : namespace ftmesh
      36             : {
      37             : 
      38             : 
      39             : constexpr int const DEFAULT_UPSCALE = 64;
      40             : constexpr int const DEFAULT_SIZE = 12;
      41             : constexpr int const DEFAULT_RESOLUTION = 72;
      42             : 
      43             : 
      44             : namespace detail
      45             : {
      46             : class font_impl;
      47             : } // namespace details
      48             : 
      49             : 
      50           1 : class font
      51             : {
      52             : public:
      53             :     typedef std::shared_ptr<font>         pointer_t;
      54             : 
      55             :                             font(std::string const & filename);
      56             : 
      57             :     void                    set_precision(int precision);
      58             :     void                    set_size(int point, int x_resolution, int y_resolution);
      59             : 
      60             :     mesh::pointer_t         get_mesh(char32_t glyph);
      61             :     mesh_string::pointer_t  convert_string(std::string const & message);
      62             :     float                   string_width(std::string const & message);
      63             : 
      64             : private:
      65             :     mesh::map_t             f_map = mesh::map_t();
      66             :     std::shared_ptr<detail::font_impl>
      67             :                             f_impl = std::shared_ptr<detail::font_impl>();
      68             : };
      69             : 
      70             : 
      71             : 
      72             : } // namespace ftmesh
      73             : // vim: ts=4 sw=4 et

Generated by: LCOV version 1.13