add new platform_abstraction
add support of loading ttf file
This commit is contained in:
43
source/detail/platform_abstraction.hpp
Normal file
43
source/detail/platform_abstraction.hpp
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Platform Abstraction
|
||||
* Nana C++ Library(http://www.nanapro.org)
|
||||
* Copyright(C) 2017 Jinhao(cnjinhao@hotmail.com)
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* @file: nana/detail/platform_spec.hpp
|
||||
*
|
||||
* The platform_abstraction provides some functions and types for the abstract
|
||||
* system platform.
|
||||
*/
|
||||
#ifndef NANA_DETAIL_PLATFORM_ABSTRACTION_HEADER_INCLUDED
|
||||
#define NANA_DETAIL_PLATFORM_ABSTRACTION_HEADER_INCLUDED
|
||||
|
||||
#include "platform_abstraction_types.hpp"
|
||||
#include <memory>
|
||||
#include <nana/filesystem/filesystem.hpp>
|
||||
|
||||
namespace nana
|
||||
{
|
||||
|
||||
|
||||
class platform_abstraction
|
||||
{
|
||||
public:
|
||||
using font = font_interface;
|
||||
|
||||
using path_type = ::std::experimental::filesystem::path;
|
||||
|
||||
static void initialize();
|
||||
/// Shutdown before destruction of platform_spec
|
||||
static void shutdown();
|
||||
static ::std::shared_ptr<font> default_font(const ::std::shared_ptr<font>&);
|
||||
static ::std::shared_ptr<font> make_font(const ::std::string& font_family, double size_pt, const font::font_style& fs);
|
||||
static ::std::shared_ptr<font> make_font_from_ttf(const path_type& ttf, double size_pt, const font::font_style& fs);
|
||||
static void font_resource(bool try_add, const path_type& ttf);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user