31 enum class Type : uint8_t {
47 explicit Font(
const std::filesystem::path& path);
58 Font& operator=(
Font&& other)
noexcept;
65 const std::optional<std::string>&
name()
const;
76 std::optional<std::string> _name;
78 std::unique_ptr<Buffer> _buffer;
Container for a contiguous byte buffer.
Owns font file data and basic format metadata.
Font(const std::filesystem::path &path)
Loads font data from path and derives its name and type from the path.
Type
Recognized font container types.
Type type() const
Returns the detected or assigned font type.
const Buffer * buffer() const
Returns the owned font-data Buffer, or nullptr when no Buffer is owned.
Font(std::unique_ptr< Buffer > buffer)
Takes ownership of buffer as font data with no name or known type.
const std::optional< std::string > & name() const
Returns the font name, or an empty optional when no name is known.