44 std::string_view defaultType()
const override {
return "text"; }
47 using ContentObject::ContentObject;
95 operator Required()
const {
return { text() }; }
132 auto glyphArray = create_glyphs();
133 for (
const auto& glyph : glyphs) {
134 glyphArray.push_back(glyph);
139 operator Required()
const {
return { glyphs().toStdVector() }; }
142 static Required make(
const std::vector<std::string>& glyphs) {
return { glyphs }; }
144 using TextContentObject::TextContentObject;
161 using ContentArray::ContentArray;
Represents an MNX array, encapsulating property access.
Definition BaseTypes.h:506
Base class wrapper for all MNX JSON nodes.
Definition BaseTypes.h:198
json_pointer pointer() const
Returns the json_pointer for this node.
Definition BaseTypes.h:260
T parent() const
Returns the parent object for this node.
Definition BaseTypes.h:246
const std::shared_ptr< json > & root() const
Returns the root.
Definition BaseTypes.h:283
Class for content arrays.
Definition BaseTypes.h:774
Base class for objects that are elements of content arrays.
Definition BaseTypes.h:696
Container for formatted-text content objects.
Definition FormattedText.h:159
Represents an MNX object, encapsulating property access.
Definition BaseTypes.h:415
Object()
Constructor fresh document or detached instance.
Definition BaseTypes.h:418
Represents a formatted text fragment expressed as SMuFL glyphs.
Definition FormattedText.h:111
Smufl(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Smufl objects.
Definition FormattedText.h:120
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition FormattedText.h:149
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:129
static Required make(const std::vector< std::string > &glyphs)
Create a Required instance for Smufl.
Definition FormattedText.h:142
MNX_OPTIONAL_CHILD(Style, style)
the style for the glyphs in thie chunk
Describes styling for formatted text content.
Definition FormattedText.h:55
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:42
Represents a formatted text fragment.
Definition FormattedText.h:70
static Required make(const std::string &text)
Create a Required instance for Text.
Definition FormattedText.h:98
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:88
Text(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Text objects.
Definition FormattedText.h:79
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition FormattedText.h:103
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:146
@ Plain
plain (non-bold) text
FontStyle
Specifies the style of text glyphs.
Definition Enumerations.h:136
@ Plain
plain (non-italic) text
initializer class for Smufl
Definition FormattedText.h:115
std::vector< std::string > glyphs
the smufl glyphs in this chunk
Definition FormattedText.h:116
initializer class for Text
Definition FormattedText.h:74
std::string text
the text to be represented
Definition FormattedText.h:75