New version of BGRABitmap 9.7 :
added TextFitInfo that returns the number of char within a certain width
added Bidi support i.e. right-to-left writing and a mix of LTR and RTL : the property FontBidiMode specifies how to handle base direction and it can be overriden by RightToLeft parameters
added support for remaining TTextStyle options : ShowPrefix, EndEllipsis, RightToLeft
fixed a bug with clipping and TextRect
improvements on GIF editing, support for loop count
faster loading of flat ORA and GIF
added support for layered LZP
improvement on TIFF reader (faster, support more files)
fixed color for BMP 32 bit on Linux
fix for gradients having one end being fully transparent
added text measurement functions for wordwrap:
function TextSize(sUTF8: string; AMaxWidth: integer): TSize; override;
function TextSize(sUTF8: string; AMaxWidth: integer; ARightToLeft: boolean): TSize; override;
function TextFitInfo(sUTF8: string; AMaxWidth: integer): integer; override;
https://github.com/bgrabitmap/bgrabitmap/releasesHere is a test program to check bidi support.
Upgrade note: before, the Linux version guess text orientation and Windows version assumed left-to-right. The new version by default guess text orientation but you can change it by setting TBGRABitmap.FontBidiMode to fbmLeftToRight to have the same result on Windows as before. Also you can add a parameter RightToLeft to text functions to override FontBidiMode for a specific call.
Other note: Bidi support works only for the LCL text renderer (the one used by default). It does not apply to TBGRAFreeTypeFontRenderer (used with NoGUI) nor TBGRAVectorizedFontRenderer (used with Canvas2d).
Regards