osci-render/Source/txt/TextParser.h

25 wiersze
779 B
C
Czysty Zwykły widok Historia

2023-02-05 20:36:51 +00:00
#pragma once
#include "../shape/OsciPoint.h"
2023-02-05 20:36:51 +00:00
#include <JuceHeader.h>
#include "../shape/Shape.h"
class OscirenderAudioProcessor;
2023-02-05 20:36:51 +00:00
class TextParser {
public:
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:
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);
OscirenderAudioProcessor &audioProcessor;
2023-02-05 20:36:51 +00:00
std::vector<std::unique_ptr<Shape>> shapes;
juce::Font lastFont;
juce::String text;
2025-04-04 13:59:17 +00:00
juce::AttributedString attributedString;
};