[smc-discuss] Displaying proper malayalam text on PDF using Go lang gopdf

Rajeesh K V rajeeshknambiar at gmail.com
Tue Feb 4 03:50:37 PST 2020


>
>
> I am trying to generate a PDF document with Malayalam text using go
> language.
> For this I am using the go pdf library https://github.com/signintech/gopdf
> The issue is that the malayalam text is not displayed properly.
>
> Good Text (as you all know)
> https://i.stack.imgur.com/KN5m1.png
>
> Obtained Text from gopdf (Improper Text)
> https://i.stack.imgur.com/xLN8r.png
>

Well, the ‘text’ is proper (in the sense that Unicode code points are
correct). The PDF generating library is missing ‘Complex Text Layout’
support, which is required to shape Malayalam script properly.


> Does anyone know how to fix the issue ?
>

You’d need to ‘shape’ the text either before passing to the library or the
library should internally handle it. I doubt if there’s a Go library which
does CTL shaping. PDF document only deals with ‘glyph ids’, so you’d need
to have proper glyph ids in place correctly.


-- 
Rajeesh
https://rajeeshknambiar.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.smc.org.in/pipermail/discuss-smc.org.in/attachments/20200204/3746e08d/attachment.html>


More information about the discuss mailing list