diff --git a/ppl2psd.py b/ppl2psd.py index 3b5a58a..e1a14cb 100644 --- a/ppl2psd.py +++ b/ppl2psd.py @@ -525,6 +525,13 @@ def build_type_layer_tysh(ly: dict, font_ps: str) -> bytes: text_len = len(text) eng["StyleRun"]["RunLengthArray"] = List([Integer(text_len)]) eng["ParagraphRun"]["RunLengthArray"] = List([Integer(text_len)]) + # Template paragraph is justify (Justification=5), which spreads short + # text across the whole box. The ppl text is centered -> center align. + try: + props = eng["ParagraphRun"]["RunArray"][0]["ParagraphSheet"]["Properties"] + props["Justification"] = Integer(1) # center + except Exception: + pass prof = font_profile(_font_path_for(ly)) size_px = float(ly.get("textSize", "12") or 12) * prof["k"]