2023-02-05 20:36:51 +00:00
|
|
|
#pragma once
|
2024-10-23 11:44:31 +00:00
|
|
|
#include "../shape/OsciPoint.h"
|
2023-02-05 20:36:51 +00:00
|
|
|
#include <JuceHeader.h>
|
|
|
|
#include "../shape/Shape.h"
|
|
|
|
|
2025-01-26 16:28:35 +00:00
|
|
|
class OscirenderAudioProcessor;
|
2023-02-05 20:36:51 +00:00
|
|
|
class TextParser {
|
|
|
|
public:
|
2025-01-26 16:28:35 +00:00
|
|
|
TextParser(OscirenderAudioProcessor &p, juce::String text, juce::Font font);
|
2023-02-05 20:36:51 +00:00
|
|
|
~TextParser();
|
|
|
|
|
|
|
|
std::vector<std::unique_ptr<Shape>> draw();
|
2025-04-04 13:59:17 +00:00
|
|
|
|
2023-02-05 20:36:51 +00:00
|
|
|
private:
|
2025-01-26 16:28:35 +00:00
|
|
|
void parse(juce::String text, juce::Font font);
|
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
|
|
|
|
|
|
|
OscirenderAudioProcessor &audioProcessor;
|
2023-02-05 20:36:51 +00:00
|
|
|
std::vector<std::unique_ptr<Shape>> shapes;
|
2025-01-26 16:28:35 +00:00
|
|
|
juce::Font lastFont;
|
|
|
|
juce::String text;
|
2025-04-04 13:59:17 +00:00
|
|
|
juce::AttributedString attributedString;
|
2024-10-23 11:44:31 +00:00
|
|
|
};
|