Import simple Photoshop text as editable text (12.11b2)

This commit is contained in:
雷电芽衣 committed 2026-09-29 09:04:50 -04:00
1 parent a2241601ec
commit 008493b0a3
20 files changed
+2081 -17

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
#pragma once
#include <QByteArray>
#include <QString>
#include <map>
#include <optional>
#include <variant>
#include <vector>
// Photoshop's text-engine dictionary, a small PostScript subset.
namespace PSDTextEngine {
struct Engine;
using Dictionary = std::map<QString, Engine>;
using Array = std::vector<Engine>;
struct Engine {
std::variant<double, bool, QString, Dictionary, Array> value;
};
std::optional<Engine> parse(const QByteArray &data);
// Swift's `walk`: nested dictionary keys, else none.
const Engine *walk(const Engine *value, std::initializer_list<const char *> keys);
std::optional<double> number(const Engine *value);
std::optional<bool> boolean(const Engine *value);
std::optional<QString> string(const Engine *value);
// An array's items; anything else reads empty.
Array array(const Engine *value);
}