Advanced Smart Text Justification (Professional Typography) - Forum | JoomShaper
Staff replied Feature Requests

Advanced Smart Text Justification (Professional Typography)

Asked by Samuel Desloges 6 hours ago Last activity 6 hours ago

Feature Request – Advanced Smart Text Justification (Professional Typography)

Hello JoomShaper Team,

I would like to suggest an enhancement to the typography capabilities of SP Page Builder Pro: the implementation of an advanced smart text justification system capable of producing professionally typeset justified paragraphs.

1. The problem with traditional text justification

SP Page Builder Pro already provides a standard "Justify" alignment option. However, my suggestion goes significantly beyond conventional text alignment.

Traditional CSS justification (text-align: justify) essentially stretches the spaces between words to align both edges of a paragraph.

Unfortunately, the visual result is often unsatisfactory, particularly in relatively narrow text containers.

Common issues include:

  • Excessively large and inconsistent spaces between words.
  • Unattractive "rivers" of whitespace running through paragraphs.
  • Visually unbalanced lines.
  • Inconsistent typographic quality depending on screen width.

As a result, despite its potential elegance, justified text is often avoided in web design.

2. Proposed feature: Advanced Smart Paragraph Justification

The idea would be to introduce an optional "Smart Justify" mode in SP Page Builder Pro that goes beyond simply stretching word spacing and genuinely optimizes paragraph composition.

Ideally, this feature would:

  1. Analyze the paragraph as a whole, rather than justifying each line independently.
  2. Determine optimal line-breaking positions to achieve a more balanced composition.
  3. Intelligently adjust word spacing to avoid excessive gaps.
  4. Support language-aware automatic hyphenation, including English, French, German, and other languages.
  5. Minimize typographic defects, such as whitespace rivers, excessive consecutive hyphenation, and awkward line breaks.
  6. Adapt automatically to responsive layouts, recalculating line breaks whenever the text container changes width.
  7. Fully preserve the original text and HTML formatting, including links, bold text, and italics, without rewriting or modifying the content.

The objective would be to approach the typographic quality of professional publishing tools such as Adobe InDesign or the LaTeX typesetting system, while maintaining the flexibility required for responsive web design.

3. A possible technical approach: The Knuth–Plass algorithm

One promising approach could be to explore the Knuth–Plass line-breaking algorithm, originally developed for the TeX typesetting system.

Unlike conventional browser justification, this algorithm evaluates different line-breaking possibilities across an entire paragraph.

It then selects a composition that minimizes typographic penalties, taking into account factors such as:

  • Consistency of word spacing.
  • Available hyphenation points.
  • Penalties associated with undesirable line breaks.
  • Overall visual balance between lines.

JavaScript implementations and related typographic libraries already exist and could provide useful starting points for evaluating technical feasibility within SP Page Builder Pro.

This approach could potentially be combined with native CSS capabilities, such as hyphens: auto, where appropriate.

Of course, I am not suggesting that JoomShaper must use this particular algorithm. I am simply proposing a concrete technical direction that could help achieve significantly better paragraph composition than standard CSS justification.

4. Potential enhancement: AI-assisted typographic optimization

Another interesting direction worth exploring would be the use of artificial intelligence as a complementary tool for typographic optimization.

Established algorithms such as Knuth–Plass can already produce excellent results. However, AI could potentially provide an additional layer of aesthetic evaluation.

For example, it might:

  • Evaluate multiple possible compositions of the same paragraph.
  • Identify visual imbalances that may be difficult to capture through predefined rules alone.
  • Help select the most aesthetically balanced combination of line breaks, hyphenation, and word spacing.
  • Adapt certain typographic parameters based on the characteristics of the text and its layout.

A hybrid approach combining a proven typographic algorithm with optional AI-assisted optimization might also be worth investigating.

However, AI should not be a requirement. The priority should remain actual visual quality, performance, preservation of the original content, and responsive compatibility.

Ideally, the feature should not require remote AI API calls every time a page is displayed.

5. Suggested integration into SP Page Builder Pro

From the user's perspective, this feature could remain extremely simple.

Within the text alignment settings:

  • Left
  • Center
  • Right
  • Justify (Standard)
  • Smart Justify (Advanced)

Optional settings could include:

  • Language selection for automatic hyphenation.
  • Enable/disable automatic hyphenation.
  • Typography quality or optimization level.

The feature could initially be integrated into the Text Block addon and potentially extended to other addons containing paragraph text.

It would also be valuable to make Smart Justify available through global typography settings, allowing consistent text presentation throughout an entire website.

6. Why this would be a valuable enhancement

Typography plays a major role in the visual quality and perceived professionalism of a website.

Advanced smart justification would be particularly valuable for:

  • Editorial websites and online magazines.
  • Institutional and corporate websites.
  • Cultural and documentary websites.
  • Portfolios and carefully designed presentations.
  • Any content-rich website where text quality matters.

It could become a distinctive premium feature for SP Page Builder Pro, going beyond the typography options commonly available in page builders.

Conclusion

This request is not about adding another standard "Justify" alignment option, but about introducing a genuine intelligent paragraph typesetting engine.

The goal is to optimize line breaking, hyphenation, and word spacing together, producing balanced, readable, and visually appealing justified paragraphs regardless of screen width.

The underlying technology — whether Knuth–Plass, another advanced typesetting algorithm, or a hybrid solution potentially incorporating AI — would naturally be up to your development team.

What matters most is the quality of the final typographic result.

Thank you for considering this suggestion and for your continued work on SP Page Builder Pro!

1 reply

Atick Eashrak Shuvo Staff

Thank you for taking the time to share this detailed suggestion with us. We appreciate your thoughtful feedback and the technical insights you’ve provided.

I have forwarded your feature request to our development team for further review and consideration. We truly appreciate your patience and understanding while our team evaluates the feasibility of this enhancement.

Thank you again for helping us improve SP Page Builder Pro.

Log in to reply.