Converting SVG TO PNG are doing abnormal Behavior in other languages than English

51 views Asked by At

I want to export image by converting svg to png for the following purpose I am using CairoSvg

It is working fine when I am svg that exists in English.

For Example :

Working Fine In English

But when I am exporting any svg in which arabic charcater exists it is not appearing correctly.

For Example :

Wrong image in arabic

Actually the title is القيمة السوقية / المبيعات but it is not appearing correctly

This is my code

svgchart = chart_pygal.render()
             pngfile = cairosvg.svg2png(bytestring=svgchart)
             with open(image_name+'.png','wb') as f:
                f.write(pngfile)
            # return send_file(pngfile,mimetype='image/png')
             return send_file(io.BytesIO(pngfile),mimetype='image/png', download_name=image_name+'.png', as_attachment=True)
0

There are 0 answers