Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0438cb6
Add initial Lottie JSON importer
pgilfernandez Jun 16, 2026
1b0548c
Improve Lottie shape coverage
pgilfernandez Jun 16, 2026
5c2ebd8
Support dotLottie imports
pgilfernandez Jun 16, 2026
c705780
Import Lottie gradients
pgilfernandez Jun 16, 2026
700119a
Import Lottie stroke line styles
pgilfernandez Jun 16, 2026
4eef4ac
Import animated Lottie shape geometry
pgilfernandez Jun 16, 2026
13b4c7a
Import Lottie layer visibility ranges
pgilfernandez Jun 16, 2026
c54ec53
Skip hidden Lottie items
pgilfernandez Jun 16, 2026
684ce49
Preserve Lottie group opacity
pgilfernandez Jun 16, 2026
2f8106a
Import animated Lottie rectangle radius
pgilfernandez Jun 16, 2026
4e8515d
Import Lottie path modifiers
pgilfernandez Jun 16, 2026
2bd415d
Import Lottie structural layers
pgilfernandez Jun 16, 2026
cdd30dc
Import Lottie layer parenting
pgilfernandez Jun 16, 2026
67de94d
Import Lottie image layers
pgilfernandez Jun 16, 2026
5f50575
Import animated Lottie polystars
pgilfernandez Jun 17, 2026
66a231f
Import Lottie trim as sub-path effect
pgilfernandez Jun 17, 2026
6cd37ee
Import Lottie skew transforms
pgilfernandez Jun 17, 2026
614a0ce
Import Lottie blend modes
pgilfernandez Jun 17, 2026
45530a1
Import Lottie layer masks
pgilfernandez Jun 17, 2026
9d0f0c6
Import Lottie track mattes
pgilfernandez Jun 17, 2026
ae4796d
Import Lottie masks on more layer types
pgilfernandez Jun 18, 2026
2b723b5
Import basic Lottie text layers
pgilfernandez Jun 18, 2026
1960c15
Extract embedded dotLottie assets
pgilfernandez Jun 18, 2026
e8e3aa5
Import animated Lottie text content
pgilfernandez Jun 18, 2026
c7658e3
Import Lottie text spacing
pgilfernandez Jun 18, 2026
55eb986
Add Lottie scale scene import mode
pgilfernandez Jun 18, 2026
412bd07
Fix Lottie import file dialog
pgilfernandez Jul 10, 2026
fc6f575
Use bundled zlib fallback for Lottie import
pgilfernandez Jul 10, 2026
a0f1be0
Install zlib for Windows CI
pgilfernandez Jul 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Import Lottie text spacing
  • Loading branch information
pgilfernandez committed Jul 10, 2026
commit c7658e34510e47a69e069773335bef87394401c8
63 changes: 63 additions & 0 deletions src/core/lottie/lottieimporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2088,6 +2088,68 @@ void applyTextDocumentKeys(TextBox* const box,
}
}

qreal textTrackingValue(const QJsonObject& document)
{
return document.value(QStringLiteral("tr")).toDouble(0) / 1000.;
}

qreal textLineSpacingValue(const QJsonObject& document)
{
const qreal fontSize = document.value(QStringLiteral("s")).toDouble(64);
if (fontSize <= 0) { return 1; }
return document.value(QStringLiteral("lh")).toDouble(fontSize) / fontSize;
}

void applyTextSpacingKeys(TextBox* const box,
const QList<KeyValue>& keys,
Canvas* const scene,
const int inPoint)
{
if (!box || keys.isEmpty()) { return; }
const auto letterSpacing =
box->ca_getFirstDescendantWithName<QrealAnimator>(
QStringLiteral("letters"));
const auto lineSpacing =
box->ca_getFirstDescendantWithName<QrealAnimator>(
QStringLiteral("lines"));
if (!letterSpacing && !lineSpacing) { return; }

const QJsonObject first = keys.first().value.toObject();
if (letterSpacing) {
letterSpacing->setCurrentBaseValue(textTrackingValue(first));
}
if (lineSpacing && first.contains(QStringLiteral("lh"))) {
lineSpacing->setCurrentBaseValue(textLineSpacingValue(first));
}
if (keys.size() <= 1) { return; }

for (int i = 0; i < keys.size(); ++i) {
const KeyValue& key = keys.at(i);
const QJsonObject document = key.value.toObject();
const int frame = importFrame(key.frame, inPoint, scene);
const qreal tracking = textTrackingValue(document);
if (letterSpacing) {
if (key.hold && i + 1 < keys.size() &&
key.frame + 1 < keys.at(i + 1).frame) {
letterSpacing->saveValueToKey(
importFrame(keys.at(i + 1).frame, inPoint, scene) - 1,
tracking);
}
letterSpacing->saveValueToKey(frame, tracking);
}
if (lineSpacing && document.contains(QStringLiteral("lh"))) {
const qreal lineSpacingValue = textLineSpacingValue(document);
if (key.hold && i + 1 < keys.size() &&
key.frame + 1 < keys.at(i + 1).frame) {
lineSpacing->saveValueToKey(
importFrame(keys.at(i + 1).frame, inPoint, scene) - 1,
lineSpacingValue);
}
lineSpacing->saveValueToKey(frame, lineSpacingValue);
}
}
}

qsptr<BoundingBox> importTextLayer(const QJsonObject& layer,
Canvas* const scene,
const int inPoint,
Expand All @@ -2101,6 +2163,7 @@ qsptr<BoundingBox> importTextLayer(const QJsonObject& layer,
box->prp_setName(layer.value(QStringLiteral("nm")).toString(
QStringLiteral("Text Layer")));
applyTextDocumentKeys(box.get(), documentKeys, scene, inPoint);
applyTextSpacingKeys(box.get(), documentKeys, scene, inPoint);
box->setFontSize(document.value(QStringLiteral("s")).toDouble(64));
const QString fontFamily = document.value(QStringLiteral("f")).toString();
if (!fontFamily.isEmpty()) {
Expand Down