2023-02-05 20:36:51 +00:00
|
|
|
#pragma once
|
|
|
|
#include <JuceHeader.h>
|
|
|
|
|
|
|
|
class TextParser {
|
|
|
|
public:
|
2025-05-08 20:26:03 +00:00
|
|
|
TextParser(juce::String text, juce::Font& font);
|
2023-02-05 20:36:51 +00:00
|
|
|
~TextParser();
|
|
|
|
|
2025-04-23 14:26:33 +00:00
|
|
|
std::vector<std::unique_ptr<osci::Shape>> draw();
|
2025-04-04 13:59:17 +00:00
|
|
|
|
2023-02-05 20:36:51 +00:00
|
|
|
private:
|
2025-05-08 20:26:03 +00:00
|
|
|
void parse(juce::String text);
|
2025-04-04 13:59:17 +00:00
|
|
|
juce::AttributedString parseFormattedText(const juce::String& text, juce::Font font);
|
|
|
|
void processFormattedTextBody(const juce::String& text, juce::AttributedString& result, juce::Font font);
|
2025-01-26 16:28:35 +00:00
|
|
|
|
2025-05-08 20:26:03 +00:00
|
|
|
juce::Font& font;
|
2025-04-23 14:26:33 +00:00
|
|
|
std::vector<std::unique_ptr<osci::Shape>> shapes;
|
2025-05-08 20:26:03 +00:00
|
|
|
juce::Font currentFont;
|
2025-01-26 16:28:35 +00:00
|
|
|
juce::String text;
|
2025-04-04 13:59:17 +00:00
|
|
|
juce::AttributedString attributedString;
|
2024-10-23 11:44:31 +00:00
|
|
|
};
|