28#include "ContentArray.h"
29#include "Enumerations.h"
52 using ContentObject::ContentObject;
53 std::string_view defaultType()
const override {
return "text"; }
138 create_glyphs().assign(glyphs);
142 operator Required()
const {
return { glyphs().toStdVector() }; }
145 static Required make(
const std::vector<std::string>& glyphs) {
return { glyphs }; }
147 using TextContentObject::TextContentObject;
166 text::Smufl appendSmufl(
const std::vector<std::string>& glyphs)
167 {
return appendWithType<text::Smufl>(glyphs); }
169 text::Text appendText(
const std::string& text)
170 {
return appendWithType<text::Text>(text); }
Represents an MNX array, encapsulating property access.
Definition BaseTypes.h:531
Base class wrapper for all MNX JSON nodes.
Definition BaseTypes.h:212
json_pointer pointer() const
Returns the json_pointer for this node.
Definition BaseTypes.h:274
T parent() const
Returns the parent object for this node.
Definition BaseTypes.h:260
const std::shared_ptr< json > & root() const
Returns the root.
Definition BaseTypes.h:297
Class for content arrays.
Definition ContentArray.h:49
Base class for objects that are elements of content arrays.
Definition BaseTypes.h:742
Container for formatted-text content objects.
Definition FormattedText.h:162
Represents an MNX object, encapsulating property access.
Definition BaseTypes.h:429
Object()
Constructor fresh document or detached instance.
Definition BaseTypes.h:432
Represents a formatted text fragment expressed as SMuFL glyphs.
Definition FormattedText.h:117
Smufl(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Smufl objects.
Definition FormattedText.h:126
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition FormattedText.h:152
MNX_REQUIRED_CHILD(Array< std::string >, glyphs)
the smufl glyphs in this chunk
Smufl(Base &parent, std::string_view key, const std::vector< std::string > &glyphs)
Creates a new Smufl class as a child of a JSON element.
Definition FormattedText.h:135
static Required make(const std::vector< std::string > &glyphs)
Create a Required instance for Smufl.
Definition FormattedText.h:145
MNX_OPTIONAL_CHILD(Style, style)
the style for the glyphs in thie chunk
Describes styling for formatted text content.
Definition FormattedText.h:61
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(FontWeight, weight, FontWeight::Plain)
the font weight
MNX_OPTIONAL_PROPERTY(std::string, font)
the name of the font
MNX_OPTIONAL_PROPERTY(double, size)
the font size
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(FontStyle, fontStyle, FontStyle::Plain)
the font style
Base class for formatted-text content objects.
Definition FormattedText.h:50
Represents a formatted text fragment.
Definition FormattedText.h:76
static Required make(const std::string &text)
Create a Required instance for Text.
Definition FormattedText.h:104
MNX_OPTIONAL_CHILD(Style, style)
the style for this formatted chunk
MNX_REQUIRED_PROPERTY(std::string, text)
the text for this formatted chunk
Text(Base &parent, std::string_view key, const std::string &text)
Creates a new Text class as a child of a JSON element.
Definition FormattedText.h:94
Text(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Text objects.
Definition FormattedText.h:85
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition FormattedText.h:109
object model for MNX format
json::json_pointer json_pointer
JSON pointer class for MNX.
Definition BaseTypes.h:68
FontWeight
Specifies the weight of text glyphs.
Definition Enumerations.h:181
@ Plain
plain (non-bold) text
FontStyle
Specifies the style of text glyphs.
Definition Enumerations.h:171
@ Plain
plain (non-italic) text
initializer class for Smufl
Definition FormattedText.h:121
std::vector< std::string > glyphs
the smufl glyphs in this chunk
Definition FormattedText.h:122
initializer class for Text
Definition FormattedText.h:80
std::string text
the text to be represented
Definition FormattedText.h:81