diff --git a/ppl2psd.py b/ppl2psd.py index 589671d..5a5c216 100644 --- a/ppl2psd.py +++ b/ppl2psd.py @@ -520,6 +520,11 @@ def build_type_layer_tysh(ly: dict, font_ps: str) -> bytes: editor["Text"] = String(text + "\r") # Txt (legacy text) value mirrors the engine text so readers agree td[b"Txt "].value = text + "\x00" + # Style/paragraph run lengths must match the new text length, otherwise + # Photoshop warns the text layer needs conversion / editing changes layout. + text_len = len(text) + eng["StyleRun"]["RunLengthArray"] = List([Integer(text_len)]) + eng["ParagraphRun"]["RunLengthArray"] = List([Integer(text_len)]) prof = font_profile(_font_path_for(ly)) size_px = float(ly.get("textSize", "12") or 12) * prof["k"]