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:
It would be nice if I could get something like this:
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.