<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div>I am trying to generate a PDF document with Malayalam text using go language.<br>For this I am using the go pdf library <a href="https://github.com/signintech/gopdf" target="_blank">https://github.com/signintech/gopdf</a><br>The issue is that the malayalam text is not displayed properly.<br><br>Good Text (as you all know) <img src="https://i.stack.imgur.com/KN5m1.png" style="margin: auto;"></div><div><a href="https://i.stack.imgur.com/KN5m1.png" target="_blank">https://i.stack.imgur.com/KN5m1.png</a><br></div><div><br></div>Obtained Text from gopdf (Improper Text) <img style="margin: auto;" src="https://i.stack.imgur.com/xLN8r.png"><div><a href="https://i.stack.imgur.com/xLN8r.png" target="_blank">https://i.stack.imgur.com/xLN8r.png</a></div></div></blockquote><div><br></div><div>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.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div>Does anyone know how to fix the issue ?<br></div></blockquote><div><br></div><div>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.<br></div><div> </div><br clear="all"></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Rajeesh<br></div><div><a href="https://rajeeshknambiar.wordpress.com">https://rajeeshknambiar.wordpress.com</a></div><div><br></div></div></div></div></div>