@lark-apaas/coding-steering 0.1.32-dev.4f80f68 → 0.1.32-dev.5abff3b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -519,8 +519,25 @@ def read_txbody(tx, ctx, kind='txBody'):
519
519
  ins[k] = ctx.units.px(bp.get(k))
520
520
  if ins:
521
521
  b['insets_px'] = ins
522
- if bp.find('a:normAutofit', NS) is not None:
522
+ na = bp.find('a:normAutofit', NS)
523
+ if na is not None:
523
524
  b['autofit'] = 'norm'
525
+ # normAutofit 用 fontScale / lnSpcReduction(单位 1/1000 %)把大字缩进小框——
526
+ # 章节大号数字就靠它让 160px 的字装进 144px 的框。只记 autofit 存在、丢掉
527
+ # fontScale,消费端就拿到未缩放字号 + 原始框高,字比框高,渐变裁切把溢出的
528
+ # 底部切成透明。缺省即 100%(无缩放)。
529
+ fs = na.get('fontScale')
530
+ if fs is not None:
531
+ try:
532
+ b['font_scale'] = round(int(fs) / 100000.0, 4)
533
+ except (TypeError, ValueError):
534
+ pass
535
+ lsr = na.get('lnSpcReduction')
536
+ if lsr is not None:
537
+ try:
538
+ b['ln_spc_reduction'] = round(int(lsr) / 100000.0, 4)
539
+ except (TypeError, ValueError):
540
+ pass
524
541
  elif bp.find('a:spAutoFit', NS) is not None:
525
542
  b['autofit'] = 'shape'
526
543
  if b: