34#include <NDEVR/File.h>
35#include <NDEVR/RGBColor.h>
36#include <NDEVR/Dictionary.h>
A hash-based key-value store, useful for quick associative lookups.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Stores many different types of font.
static Dictionary< String, Font > s_system_fonts
Mapping of font names to system-installed fonts.
static void SaveFontSettings()
Saves the current font settings to the settings file.
static Font FindFallbackFont(Font original, wchar_t character)
Finds a fallback font that supports the given character.
static constexpr StringView DefaultFont
The default application font identifier.
static Dictionary< String, Dictionary< UUID, std::function< void(const StringView &)> > > s_app_font_listener
Registered font change listeners per application font.
static void SetFontFile(const StringView &font_name, const File &file, uint04 index=0)
Associates a font file with a font name.
static void PullFontFromFolder(const File &folder)
Scans a folder for font files and registers them.
static void ReadFontSettings()
Reads font settings from the settings file.
static Dictionary< String, Font > s_application_fonts
Mapping of application font identifiers to fonts.
static Dictionary< String, String > s_font_files
Mapping of font names to font file paths.
static bool HasApplicationFont(const StringView &app_font)
Checks whether an application font has been registered with the given name.
static Dictionary< String, uint04 > s_font_indices
Mapping of font names to face indices within font files.
static void RemoveFontListener(const StringView &app_font, UUID id)
Removes a previously registered font change listener.
static void AddFontListener(const StringView &app_font, UUID id, std::function< void(const StringView &)> callback)
Registers a callback to be invoked when an application font changes.
static bool HasFontFile(const StringView &font_name)
Checks whether a font file is registered for the given font name.
static File s_settings_file
File used to persist font settings.
static File TryFontName(const StringView &family)
Attempts to locate a font file by font family name.
static void SetSettingsFile(const File &file)
Sets the file used to persist font settings.
static File FindBestFitFontFile(Font &font, bool allow_backup_file=true)
Finds the best matching font file for the given font properties.
static void SetApplicationFont(const StringView &app_font, const Font &font)
Registers or updates an application font by name.
static const Font & ApplicationFont(const StringView &app_font)
Retrieves a registered application font by name.
Information for how to display text data.
std::function< Font(wchar_t character)> m_fallback_font
Callback to find a fallback font for unsupported characters.
String m_name
The font family name.
bool executeAnsiiCode(uint04 ansii_code, const Font &default_font)
Applies an ANSI escape code to modify the font style.
bool operator!=(const Font &font) const
Checks inequality between two Font objects.
void setIsItalic(bool is_italic)
Sets whether the font style is italic.
bool m_has_italic_family
Whether an italic variant of this font family exists.
String app_font_name
Application-specific font identifier name.
bool hasBoldFamily() const
Checks whether a bold variant of this font family exists.
void setHasBoldFamily(bool has_bold_family)
Sets whether a bold variant of this font family exists.
bool m_is_italic
Whether the font is italic.
bool is_overstrike
Whether the font style includes overstrike.
bool m_has_bold_family
Whether a bold variant of this font family exists.
void setName(const StringView &name)
Sets the font family name.
void setIsBold(bool is_bold)
Sets whether the font style is bold.
bool operator==(const Font &font) const
Checks equality between two Font objects.
fltp08 tab_advance
Horizontal advance distance for tab characters.
StringView name() const
Gets the font family name.
uint04 index
Index of the font face within a font file.
bool is_underline
Whether the font style includes underline.
bool hasItalicFamily() const
Checks whether an italic variant of this font family exists.
fltp08 pixel_size
Font size in pixels.
const File & file() const
Gets the file path associated with this font.
bool m_is_bold
Whether the font is bold.
bool isBold() const
Checks whether the font style is bold.
bool isItalic() const
Checks whether the font style is italic.
File m_file
Cached file path for the font.
RGBColor color
Font rendering color.
bool findBestFileIfNeeded(bool allow_backup_file=true)
Locates the best matching font file if one has not been set.
fltp08 fixed_width
Fixed character width override.
fltp08 point_size
Font size in points.
void setFile(const File &file)
Sets the file path for this font.
bool is_strikethrough
Whether the font style includes strikethrough.
void setHasItalicFamily(bool has_italic_family)
Sets whether an italic variant of this font family exists.
Represents a color in the RGB space with optional alpha transparency.
This class is like a string view, but may optionally store the data internally Useful if the return t...
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
The primary namespace for the NDEVR SDK.
TextAlignment
How to align text into a given container.
@ e_top
Align text to the top.
@ e_bottom
Align text to the bottom.
@ e_h_center
Center text horizontally.
@ e_bottom_base
Align text to the baseline at the bottom.
@ e_v_baseline_center
Center text vertically using baseline alignment.
@ e_right
Align text to the right.
@ e_center
Center text both horizontally and vertically.
@ e_left
Align text to the left.
@ e_v_center
Center text vertically.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
@ file
The source file path associated with this object.
uint01 operator|(const TextAlignment &a, const TextAlignment &b)
Bitwise OR operator for combining TextAlignment flags.
constexpr t_to cast(const Angle< t_from > &value)
Casts an Angle from one backing type to another.
text that is formatted the same way, typically part of a bigger group of text
bool operator!=(const TextBlock &block) const
Checks inequality between two TextBlock objects.
StringAllocatingView text
The text content of this block.
bool operator==(const TextBlock &block) const
Checks equality between two TextBlock objects.
uint01 alignment
The text alignment flags for this block.
Font font
The font style applied to this block.