📐 Text Justify Tool
选项
📋 结果
请输入文本...
📚 深度解析:两端对齐
💡 常见使用场景
- 纯文本/README 排版:把不等长段落补足到统一宽度,呈现整齐的右边界。
- 命令行横幅与打印稿:在等宽字体下生成对齐区块,便于阅读。
- 教学演示中英文混排对齐时空格分配的差异。
把段落对齐到 30 字宽
输入「本工具用于文本两端对齐处理」,设宽度 30,工具在词/字间补空格使每行恰好 30 字符宽,右边界齐平;等宽字体下观感整齐。
❓ 常见问题(FAQ)
- 为什么中英文混排对不齐?
- 中文按字宽、英文单词按整体宽度,两端对齐需在中文字间插空格、英文保持词完整,混排时计算逻辑不同,部分工具仅做字间均分。
- 网页里还要用这个吗?
- 不需要。HTML/CSS 的 text-align: justify 由浏览器处理;本工具用于纯文本、终端或无可排版环境下的手动对齐。
Formula & Standard References
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Line breaking | justification breaks lines at minimal cost then stretches word spacing to the measure | Knuth & Plass 1981, Breaking Paragraphs |
| CJK handling | Chinese has no inter-word spaces so slack is distributed between characters | W3C CSS Text Level 3, text-align |
| Last line rule | the final line of a paragraph is conventionally left unjustified | W3C CSS Text Level 3, text-align |
⚠️ 使用说明与注意事项
- 本工具纯前端运行,数据不会上传到服务器
- 建议在主流浏览器(Chrome/Safari/Firefox/Edge)中使用
- 计算结果仅供参考,请以实际应用场景为准