This invention discloses an intelligent
punctuation compression and line
layout method for East Asian text typesetting. East Asian full-width
punctuation marks are categorized into six types based on their typesetting function: start
punctuation, end punctuation,
sentence-end punctuation,
sentence-in-
sentence punctuation, exclamation / interrogative punctuation, and center punctuation. Each type defines an independent
compressibility and compression direction. The categorized punctuation marks are modeled as composite typesetting elements carrying both width flexibility parameters and
line break cost parameters. The
line break cost and remaining compression capacity are correlated within the same element, and the composite typesetting element is incorporated into the
cost optimization process of the line
layout algorithm. The selection of
line break points and punctuation spacing allocation are jointly determined in the same optimization calculation. A power-law cost function and hierarchical spacing allocation priority (punctuation compression takes precedence over word spacing adjustment, which in turn takes precedence over character spacing adjustment) are employed, and rules are implemented through hard constraints. Vertical
layout mode, vertical-center-horizontal unit modeling, and cross-language configurable rules are supported. This invention solves the problem of suboptimal global typesetting quality caused by the decoupling of punctuation compression and line break algorithms in existing technologies.