putText method

  1. @override
void putText(
  1. PdfStream stream,
  2. String text
)
override

Draw some text

Implementation

@override
void putText(PdfStream stream, String text) {
  if (!font.unicode) {
    super.putText(stream, text);
  }

  final runes = text.runes;

  stream.putByte(0x3c);
  for (final rune in runes) {
    var char = unicodeCMap.cmap.indexOf(rune);
    if (char == -1) {
      char = unicodeCMap.cmap.length;
      unicodeCMap.cmap.add(rune);
    }

    stream.putBytes(latin1.encode(char.toRadixString(16).padLeft(4, '0')));
  }
  stream.putByte(0x3e);
}