Im using GraphicsMagick for node and trying to drawText on image for "Urdu/Arabic Language" this text "السلام عليكم", text is being drawn on output image but it is being drawn "Left to Right" while it must be "Right to Left" as Arabic/Urdu are "Right to Left" languages.
gm("/file.png")
.fill('#FF0066')
.drawText(100, -150, "السلام عليكم", 'Center')
.font("/alvi_Nastaleeq.ttf")
.fontSize('38px')
.encoding('Unicode')
Output Image:
If Im trying using reverse urdu "مكيلع مالسلا" string even then text isn't being drawn correctly.
What m i doing wrong? How can I fix it?
Thanks,
i'm searching for the same thing and i found that
you need to enable the text_shaping option
you need to configure FFmpeg with --enable-libfribidi
read about text_shaping here
https://ffmpeg.org/ffmpeg-filters.html#Syntax
i didn't test it but i will,
when i get a result i will post the code here
i wish i have pointed you out
here's a working code i use to produce videos like this
ffmpeg -y -loop 1 -framerate 25 -i bachground-img.jpg -vf "drawtext=text_shaping=1:fontfile=C\/:/Windows/Fonts/tradbdo.ttf:\
textfile=text-new.txt:fontcolor=white:fontsize=75:x=(w-tw)/2:y=h-25*t:" -t 45 -pix_fmt yuv420p output.mp4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With