Forge

font.h
Go to the documentation of this file.
1 /*******************************************************
2 * Copyright (c) 2015-2019, ArrayFire
3 * All rights reserved.
4 *
5 * This file is distributed under 3-clause BSD license.
6 * The complete license agreement can be obtained at:
7 * http://arrayfire.com/licenses/BSD-3-Clause
8 ********************************************************/
9
10 #pragma once
11 #include <fg/defines.h>
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
28 FGAPI fg_err fg_create_font(fg_font* pFont);
29
38 FGAPI fg_err fg_retain_font(fg_font *pOut, fg_font pIn);
39
47 FGAPI fg_err fg_release_font(fg_font pFont);
48
57 FGAPI fg_err fg_load_font_file(fg_font pFont, const char* const pFileFullPath);
58
67 FGAPI fg_err fg_load_system_font(fg_font pFont, const char* const pFontName);
68
71 #ifdef __cplusplus
72 }
73 #endif
74
75
76 #ifdef __cplusplus
77
78 namespace forge
79 {
80
86 class Font {
87 private:
88 fg_font mValue;
89
90 public:
94 FGAPI Font();
95
101 FGAPI Font(const Font& other);
102
106 FGAPI ~Font();
107
113 FGAPI void loadFontFile(const char* const pFile);
114
120 FGAPI void loadSystemFont(const char* const pName);
121
125 FGAPI fg_font get() const;
126 };
127
128 }
129
130 #endif
fg_load_font_file
FGAPI fg_err fg_load_font_file(fg_font pFont, const char *const pFileFullPath)
Load a given font file.
forge
Definition: chart.h:304
forge::Font::~Font
FGAPI ~Font()
Font Destructor.
fg_release_font
FGAPI fg_err fg_release_font(fg_font pFont)
Destroy font object.
FGAPI
#define FGAPI
Definition: defines.h:28
defines.h
forge::Font::loadSystemFont
FGAPI void loadSystemFont(const char *const pName)
Load a system font based on the name.
forge::Font
Font object is essentially a resource handler for the specific font you want to use.
Definition: font.h:86
fg_err
fg_err
Definition: defines.h:49
fg_font
void * fg_font
Definition: defines.h:41
fg_create_font
FGAPI fg_err fg_create_font(fg_font *pFont)
Create a Font object.
fg_load_system_font
FGAPI fg_err fg_load_system_font(fg_font pFont, const char *const pFontName)
Load a system font based on the name.
forge::Font::loadFontFile
FGAPI void loadFontFile(const char *const pFile)
Load a given font file.
forge::Font::Font
FGAPI Font()
Creates Font object.
fg_retain_font
FGAPI fg_err fg_retain_font(fg_font *pOut, fg_font pIn)
Increase reference count of the resource.