Interface Shaper

All Known Implementing Classes:
HBShape

public interface Shaper
A text engine that shapes text for TextBlock and TextLine: it wraps the text to a width and finds, for each line, the glyphs of the fonts and their places. PDFjet does not shape scripts such as Hindi and Khmer itself; a shaper does, and PDFjet draws what it found, as outlines.

PDFjet picks the platform's shaper by itself: Java's java.awt.font on servers and desktops, and Android's own text engine on Android 12 and later. A program can give its own, such as one that calls HarfBuzz.

  • Method Summary

    Modifier and Type
    Method
    Description
    Wraps the text to the width and shapes each line.
  • Method Details

    • shape

      List<ShapedLine> shape(ShapingRequest request) throws Exception
      Wraps the text to the width and shapes each line.
      Parameters:
      request - the text, its language, the font files, the font size and the width of the lines.
      Returns:
      the lines, in order.
      Throws:
      Exception - if the text cannot be shaped.