AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
FontDatabase.hpp
1/*
2Copyright (C) 2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGUI_FONTDATABASE_H
17#define AEONGUI_FONTDATABASE_H
18
19#include <string>
20#include <vector>
21#include "aeongui/Platform.hpp"
22
23struct _PangoFontMap;
24typedef struct _PangoFontMap PangoFontMap;
25struct _PangoContext;
26typedef struct _PangoContext PangoContext;
27struct _FcConfig;
28typedef struct _FcConfig FcConfig;
29
30namespace AeonGUI
31{
40 class FontDatabase
41 {
42 public:
46 DLL static bool Initialize();
48 DLL static void Finalize();
53 DLL static bool AddFontDirectory ( const std::string& aPath );
58 DLL static bool AddFontFile ( const std::string& aPath );
62 DLL static PangoFontMap* GetFontMap();
66 DLL static PangoContext* CreateContext();
67 private:
68 FontDatabase() = delete;
69 static FcConfig* sFcConfig;
70 static PangoFontMap* sFontMap;
71 };
72}
73#endif
Platform-specific DLL import/export macros and compiler helpers.
static bool AddFontFile(const std::string &aPath)
Add a single font file to the database.
Definition FontDatabase.cpp:176
static bool Initialize()
Initialize the font database. Call once at startup.
Definition FontDatabase.cpp:100
static PangoFontMap * GetFontMap()
Get the PangoFontMap backed by the local font database.
Definition FontDatabase.cpp:192
static bool AddFontDirectory(const std::string &aPath)
Add a directory of font files (.ttf, .otf, etc.) to the database.
Definition FontDatabase.cpp:159
static void Finalize()
Finalize the font database. Call once at shutdown.
Definition FontDatabase.cpp:145
static PangoContext * CreateContext()
Create a new PangoContext from the local font map.
Definition FontDatabase.cpp:197