1

I have a pdfbox 2.0.0 application rendering unicode for languages like Arabic and Tamil into pdf's.

I would like my app to behave in the same way as browsers and editors in that it joins adjacent characters into ligatures. Currently when I run this kind of Scala code, the glyphs produced on my pdf are all separated:

val right = "ح"
val middle = "ک"
val left = "م"
contentStream.showText(left + middle + right)

Yields:

glyphs_separated

It would be nice if I could get something like this:

glyphs_joined

Is this possible with pdfbox? Any insights into how exactly fonts do this would be valuable as well as I'm still a beginner with understanding fonts.

I don't know if this is relevant, but my app currently handles rendering of right-to-left text by essentially reversing the text then rendering it from the left using showText like you would with left-to-right languages. I don't know if having characters not in their natural order effects the formation of ligatures. Pdfbox doesn't seem to have a right-to-left version of showText.

I am using pdfbox 2.0.0-SNAPSHOT from https://repository.apache.org/content/groups/snapshots/.

Thanks in advance.

rmin
  • 1,018
  • 1
  • 9
  • 18
  • If you don't get an answer here, the best would be to ask this in the pdfbox user mailing list, the PDFBox font expert doesn't read stackoverflow (AFAIK). – Tilman Hausherr Aug 18 '15 at 09:09

0 Answers0