2 * Copyright (C) 2022 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
19 constexpr const char* SUPPORTED_EXTENSIONS_MASK
= ".ttf|.otf";
21 // The default application font
22 constexpr const char* FONT_DEFAULT_FILENAME
= "arial.ttf";
26 // Directory where Kodi bundled fonts files are located
27 constexpr const char* SYSTEM
= "special://xbmc/media/Fonts/";
28 // Directory where user defined fonts are located
29 constexpr const char* USER
= "special://home/media/Fonts/";
30 // Temporary font path (where MKV fonts are extracted and temporarily stored)
31 constexpr const char* TEMP
= "special://temp/fonts/";
34 * \brief Provided a font filename returns the complete path for the font in
35 * the system font folder (if it exists) or an empty string otherwise
36 * \param filename The font file name
37 * \return The path for the font or an empty string if the path does not exist
39 std::string
GetSystemFontPath(const std::string
& filename
);
40 }; // namespace FONTPATH
43 * \brief Get the font family name from a font file
44 * \param buffer The font data
45 * \return The font family name, otherwise empty if fails
47 std::string
GetFontFamily(std::vector
<uint8_t>& buffer
);
50 * \brief Get the font family name from a font file
51 * \param filepath The path where read the font data
52 * \return The font family name, otherwise empty if fails
54 std::string
GetFontFamily(const std::string
& filepath
);
57 * \brief Check if a filename have a supported font extension.
58 * \param filepath The font file path
59 * \return True if it has a supported extension, otherwise false
61 bool IsSupportedFontExtension(const std::string
& filepath
);
64 * \brief Removes all temporary fonts, e.g.those extract from MKV containers
65 * that are only available during playback
67 void ClearTemporaryFonts();