diff --git a/convert-w2p.js b/convert-w2p.js index a4af2a6..0db45dd 100644 --- a/convert-w2p.js +++ b/convert-w2p.js @@ -591,7 +591,7 @@ function convert(input) { opts.fontSize = pt; opts.fontFace = (st.fontFamily || 'Arial').split(',')[0].replace(/['"]/g,'').trim(); opts.color = rgbaToHex(st.color) || '000000'; - if (parseInt(st.fontWeight) >= 700) opts.bold = true; + if (parseInt(st.fontWeight) >= 700 && !n._merged) opts.bold = true; if (st.fontStyle === 'italic') opts.italic = true; if (st.textAlign && st.textAlign !== 'start') opts.align = st.textAlign; // 文字装饰 @@ -618,7 +618,7 @@ function convert(input) { } // 宽度:parentW 超过 contentW 的 80% 时视为顶层,用 contentW;否则用 parentW - var textW = n.parentW || r.w; + var textW = n._merged ? r.w : (n.parentW || r.w); // 合并节点用 rect.w if (textW > contentW * 0.8) textW = contentW; if (textW > contentW) textW = contentW; if (textW < 108) textW = 108; // 最小 1.5in = 108px