Skip to content

Allow more break tailoring with attributes

Matthias Clasen requested to merge break-tailoring into main

Add two new attributes to allow more flexible tweaking of line breaks:

pango_allow_line_breaks_new (allows)

makes an attribute that filters the algorithmic line break opportunities in its range, as follows:

  • PANGO_LINE_BREAK_IGNORE: No changes.
  • PANGO_LINE_BREAK_NONE: All break opportunities are removed.
  • PANGO_LINE_BEAK_CHAR: Only break opportunities during character breaking are retained.
  • PANGO_LINE_BREAK_LINE: Regular line break opportunities are retained, mandatory breaks are removed.
  • PANGO_LINE_BREAK_MANDATORY: All line break opportunities are retained.
pango_line_break_new (before, after)

makes an attribute that overrides the line break opportunities at the beginning and end of its range, as follows:

  • PANGO_LINE_BREAK_IGNORE: No changes.
  • PANGO_LINE_BREAK_NONE: No break opportunity.
  • PANGO_LINE_BEAK_CHAR: Break opportunity during character breaking.
  • PANGO_LINE_BREAK_LINE: Regular line break opportunity.
  • PANGO_LINE_BREAK_MANDATORY: Mandatory line break.

Merge request reports