Browse Source

#65 text style and bidi mode in toolbar

circular17 3 years ago
parent
commit
e65f462b16
32 changed files with 1264 additions and 62 deletions
  1. 485 50
      lazpaint/lazpaintmainform.lfm
  2. 7 0
      lazpaint/lazpaintmainform.lrj
  3. 27 1
      lazpaint/lazpaintmainform.pas
  4. 91 0
      lazpaint/maintoolbar.inc
  5. 28 0
      lazpaint/release/bin/i18n/lazpaint.ar.po
  6. 28 0
      lazpaint/release/bin/i18n/lazpaint.bg.po
  7. 28 0
      lazpaint/release/bin/i18n/lazpaint.cs.po
  8. 28 0
      lazpaint/release/bin/i18n/lazpaint.de.po
  9. 28 0
      lazpaint/release/bin/i18n/lazpaint.es.po
  10. 28 0
      lazpaint/release/bin/i18n/lazpaint.fi.po
  11. 28 0
      lazpaint/release/bin/i18n/lazpaint.fr.po
  12. 28 0
      lazpaint/release/bin/i18n/lazpaint.it.po
  13. 28 0
      lazpaint/release/bin/i18n/lazpaint.ja.po
  14. 28 0
      lazpaint/release/bin/i18n/lazpaint.kab.po
  15. 28 0
      lazpaint/release/bin/i18n/lazpaint.lv.po
  16. 28 0
      lazpaint/release/bin/i18n/lazpaint.nl.po
  17. 28 0
      lazpaint/release/bin/i18n/lazpaint.pl.po
  18. 28 0
      lazpaint/release/bin/i18n/lazpaint.pot
  19. 28 0
      lazpaint/release/bin/i18n/lazpaint.pt_BR.po
  20. 36 9
      lazpaint/release/bin/i18n/lazpaint.ru.po
  21. 28 0
      lazpaint/release/bin/i18n/lazpaint.sv.po
  22. 28 0
      lazpaint/release/bin/i18n/lazpaint.zh_CN.po
  23. 48 1
      lazpaint/tools/utool.pas
  24. 24 1
      lazpaint/tools/utooltext.pas
  25. 10 0
      resources/scripts/lazpaint/tools.py
  26. 8 0
      resources/vector/textbold32.svg
  27. 9 0
      resources/vector/textdirectionany32.svg
  28. 9 0
      resources/vector/textdirectionltr32.svg
  29. 9 0
      resources/vector/textdirectionrtl32.svg
  30. 9 0
      resources/vector/textitalic32.svg
  31. 7 0
      resources/vector/textstrikeout32.svg
  32. 9 0
      resources/vector/textunderline32.svg

+ 485 - 50
lazpaint/lazpaintmainform.lfm

@@ -218,7 +218,7 @@ object FMain: TFMain
   object Panel_PenWidth: TPanel
     Left = 608
     Height = 36
-    Top = 144
+    Top = 56
     Width = 105
     ClientHeight = 36
     ClientWidth = 105
@@ -470,7 +470,7 @@ object FMain: TFMain
   object Panel_Tolerance: TPanel
     Left = 279
     Height = 36
-    Top = 296
+    Top = 336
     Width = 140
     ClientHeight = 36
     ClientWidth = 140
@@ -1308,7 +1308,7 @@ object FMain: TFMain
   object Panel_Grid: TPanel
     Left = 424
     Height = 36
-    Top = 296
+    Top = 336
     Width = 172
     ClientHeight = 36
     ClientWidth = 172
@@ -1513,7 +1513,7 @@ object FMain: TFMain
   object Panel_PenWidthPreview: TPanel
     Left = 608
     Height = 104
-    Top = 176
+    Top = 92
     Width = 106
     BevelOuter = bvNone
     ClientHeight = 104
@@ -1526,7 +1526,7 @@ object FMain: TFMain
     object PaintBox_PenPreview: TPaintBox
       Left = 6
       Height = 91
-      Top = 6
+      Top = 7
       Width = 93
       Font.Height = -12
       ParentFont = False
@@ -1752,6 +1752,7 @@ object FMain: TFMain
     ParentColor = False
     ParentFont = False
     TabOrder = 19
+    OnMouseMove = Panel_TextMouseMove
     object Label_Text: TLabel
       Left = 4
       Height = 22
@@ -1762,6 +1763,7 @@ object FMain: TFMain
       Font.Height = -12
       Layout = tlCenter
       ParentFont = False
+      OnMouseMove = Panel_TextMouseMove
     end
     object ToolBar15: TToolBar
       Left = 85
@@ -1775,17 +1777,20 @@ object FMain: TFMain
       Images = ImageList16
       ParentFont = False
       TabOrder = 0
+      OnMouseMove = Panel_TextMouseMove
       object Tool_TextFont: TToolButton
         Left = 1
         Hint = 'Choose font...'
         Top = 0
         ImageIndex = 61
+        OnMouseMove = Panel_TextMouseMove
       end
       object Tool_TextPhong: TToolButton
         Left = 93
         Hint = 'Text phong shading'
         Top = 0
         ImageIndex = 74
+        OnMouseMove = Panel_TextMouseMove
         Style = tbsCheck
       end
       object Tool_TextAlignLeft: TToolButton
@@ -1795,6 +1800,7 @@ object FMain: TFMain
         Down = True
         Grouped = True
         ImageIndex = 84
+        OnMouseMove = Panel_TextMouseMove
         Style = tbsCheck
       end
       object Tool_TextAlignCenter: TToolButton
@@ -1803,6 +1809,7 @@ object FMain: TFMain
         Top = 0
         Grouped = True
         ImageIndex = 85
+        OnMouseMove = Panel_TextMouseMove
         Style = tbsCheck
       end
       object Tool_TextAlignRight: TToolButton
@@ -1811,6 +1818,7 @@ object FMain: TFMain
         Top = 0
         Grouped = True
         ImageIndex = 86
+        OnMouseMove = Panel_TextMouseMove
         Style = tbsCheck
       end
     end
@@ -1889,12 +1897,13 @@ object FMain: TFMain
       TabOrder = 1
       TabStop = True
       UseDockManager = False
+      OnMouseMove = Panel_TextMouseMove
     end
   end
   object Panel_PhongShape: TPanel
     Left = 8
     Height = 36
-    Top = 248
+    Top = 288
     Width = 306
     ClientHeight = 36
     ClientWidth = 306
@@ -2075,7 +2084,7 @@ object FMain: TFMain
   object Panel_Altitude: TPanel
     Left = 331
     Height = 36
-    Top = 248
+    Top = 288
     Width = 111
     ClientHeight = 36
     ClientWidth = 111
@@ -2332,7 +2341,7 @@ object FMain: TFMain
   object Panel_Brush: TPanel
     Left = 8
     Height = 36
-    Top = 296
+    Top = 336
     Width = 266
     ClientHeight = 36
     ClientWidth = 266
@@ -3324,9 +3333,94 @@ object FMain: TFMain
       EditingGradTexPoints = False
     end
   end
+  object Panel_TextMore: TPanel
+    Left = 9
+    Height = 30
+    Top = 243
+    Width = 185
+    ClientHeight = 30
+    ClientWidth = 185
+    TabOrder = 34
+    Visible = False
+    OnMouseMove = Panel_TextMoreMouseMove
+    object ToolBar25: TToolBar
+      Left = 1
+      Height = 22
+      Top = 1
+      Width = 162
+      Align = alNone
+      AutoSize = True
+      EdgeBorders = []
+      Font.Height = -12
+      Images = SVGRasterImageList1
+      ParentFont = False
+      TabOrder = 0
+      OnMouseMove = Panel_TextMoreMouseMove
+      object Tool_TextBold: TToolButton
+        Left = 1
+        Hint = 'Bold'
+        Top = 0
+        ImageIndex = 0
+        OnMouseMove = Panel_TextMoreMouseMove
+        Style = tbsCheck
+      end
+      object Tool_TextItalic: TToolButton
+        Left = 24
+        Hint = 'Italic'
+        Top = 0
+        ImageIndex = 1
+        OnMouseMove = Panel_TextMoreMouseMove
+        Style = tbsCheck
+      end
+      object Tool_TextUnderline: TToolButton
+        Left = 47
+        Hint = 'Underline'
+        Top = 0
+        ImageIndex = 2
+        OnMouseMove = Panel_TextMoreMouseMove
+        Style = tbsCheck
+      end
+      object Tool_TextStrikeout: TToolButton
+        Left = 70
+        Hint = 'Strikeout'
+        Top = 0
+        ImageIndex = 3
+        OnMouseMove = Panel_TextMoreMouseMove
+        Style = tbsCheck
+      end
+      object Tool_TextBidirectional: TToolButton
+        Left = 93
+        Hint = 'Bidirectional'
+        Top = 0
+        Down = True
+        Grouped = True
+        ImageIndex = 4
+        OnMouseMove = Panel_TextMoreMouseMove
+        Style = tbsCheck
+      end
+      object Tool_TextLTR: TToolButton
+        Left = 116
+        Hint = 'Left to right'
+        Top = 0
+        Grouped = True
+        ImageIndex = 5
+        OnMouseMove = Panel_TextMoreMouseMove
+        Style = tbsCheck
+      end
+      object Tool_TextRTL: TToolButton
+        Left = 139
+        Hint = 'Right to left'
+        Top = 0
+        Grouped = True
+        ImageIndex = 6
+        OnMouseMove = Panel_TextMoreMouseMove
+        Style = tbsCheck
+      end
+    end
+  end
   object ImageList16: TBGRAImageList
-    Left = 40
-    Top = 496
+    Left = 27
+    Top = 514
     Bitmap = {
       4C7A8600000010000000100000006A8300000000000078DAEC5D07581457D71E
       EC5D6CB1A112628D359AA8B1A22696C45E63C70662895DB18205411101A5AB34
@@ -4384,8 +4478,8 @@ object FMain: TFMain
   end
   object ActionList1: TActionList
     Images = ImageList16
-    Left = 43
-    Top = 427
+    Left = 30
+    Top = 449
     object FileNew: TAction
       Category = 'File'
       Caption = 'New...'
@@ -5497,13 +5591,13 @@ object FMain: TFMain
       'ColorS=F0FBFF'
       'ColorT=A4A0A0'
     )
-    Left = 219
-    Top = 427
+    Left = 204
+    Top = 385
   end
   object MainMenu1: TMainMenu
     Images = ImageList16
-    Left = 43
-    Top = 363
+    Left = 30
+    Top = 385
     object MenuFile: TMenuItem
       Caption = 'File'
       OnClick = MenuFileClick
@@ -5592,8 +5686,8 @@ object FMain: TFMain
     Enabled = False
     Interval = 3000
     OnTimer = TimerHidePenPreviewTimer
-    Left = 646
-    Top = 288
+    Left = 653
+    Top = 514
   end
   object FontDialog1: TFontDialog
     Font.CharSet = ANSI_CHARSET
@@ -5603,73 +5697,73 @@ object FMain: TFMain
     Font.Quality = fqDraft
     MinFontSize = 0
     MaxFontSize = 0
-    Left = 216
-    Top = 496
+    Left = 204
+    Top = 449
   end
   object LoadSelectionDialog: TOpenPictureDialog
     Title = 'Load selection'
     Options = [ofNoDereferenceLinks, ofEnableSizing, ofViewDetail]
-    Left = 335
-    Top = 363
+    Left = 306
+    Top = 385
   end
   object OpenPictureDialog1: TOpenDialog
     Title = 'Open existing image'
     Options = [ofNoDereferenceLinks, ofEnableSizing, ofViewDetail]
-    Left = 456
-    Top = 363
+    Left = 427
+    Top = 385
   end
   object OpenTextureDialog: TOpenDialog
     Title = 'Open texture'
     DefaultExt = '.png'
     Options = [ofNoDereferenceLinks, ofEnableSizing, ofViewDetail]
-    Left = 332
-    Top = 496
+    Left = 303
+    Top = 514
   end
   object TimerUpdate: TTimer
     Interval = 50
     OnTimer = TimerUpdateTimer
-    Left = 219
-    Top = 363
+    Left = 653
+    Top = 328
   end
   object Open3DObjectDialog: TOpenDialog
     Title = 'Import 3D object'
     DefaultExt = '.obj'
     Filter = 'Wavefront Object file (*.obj)|*.obj;*.Obj;*.OBJ'
     Options = [ofNoDereferenceLinks, ofEnableSizing, ofViewDetail]
-    Left = 453
-    Top = 496
+    Left = 424
+    Top = 514
   end
   object SavePictureDialog1: TSaveDialog
     Title = 'Save file as...'
     DefaultExt = '.png'
     Options = [ofOverwritePrompt, ofEnableSizing, ofViewDetail]
-    Left = 456
-    Top = 427
+    Left = 427
+    Top = 449
   end
   object TimerLoadToolWin: TTimer
     Interval = 200
     OnTimer = TimerLoadToolWinTimer
-    Left = 680
-    Top = 427
+    Left = 653
+    Top = 385
   end
   object SaveSelectionDialog: TSaveDialog
     Title = 'Save selection as...'
     DefaultExt = '.lzp'
     Options = [ofOverwritePrompt, ofEnableSizing, ofViewDetail]
-    Left = 335
-    Top = 427
+    Left = 306
+    Top = 449
   end
   object OpenBrushDialog: TOpenDialog
     Title = 'Open brush'
     DefaultExt = '.lzp'
     Options = [ofNoDereferenceLinks, ofEnableSizing, ofViewDetail]
-    Left = 578
-    Top = 363
+    Left = 544
+    Top = 385
   end
   object PopupToolbar: TPopupMenu
     OnPopup = PopupToolbarPopup
-    Left = 130
-    Top = 427
+    Left = 115
+    Top = 449
     object MenuFileToolbar: TMenuItem
       Caption = 'Show file toolbar'
       OnClick = MenuFileToolbarClick
@@ -5697,8 +5791,8 @@ object FMain: TFMain
   end
   object PopupToolbox: TPopupMenu
     OnPopup = PopupToolboxPopup
-    Left = 130
-    Top = 363
+    Left = 115
+    Top = 385
     object MenuDockToolboxLeft: TMenuItem
       Caption = 'Dock left'
       OnClick = MenuDockToolboxLeftClick
@@ -5715,8 +5809,8 @@ object FMain: TFMain
   object ImageList48: TBGRAImageList
     Height = 48
     Width = 48
-    Left = 127
-    Top = 496
+    Left = 112
+    Top = 514
     Bitmap = {
       4C7A860000003000000030000000756303000000000078DAEC9D057C1457F7F7
       135CFA94FAD33E155ADA52A0B4B8BBBBBBBBBB3B418B1477777709094112E2EE
@@ -12665,21 +12759,362 @@ object FMain: TFMain
     Enabled = False
     Interval = 50
     OnTimer = TimerArrangeTimer
-    Left = 578
-    Top = 496
+    Left = 544
+    Top = 514
   end
   object TimerHideFill: TTimer
     Enabled = False
     Interval = 3000
     OnTimer = TimerHideFillTimer
-    Left = 680
-    Top = 496
+    Left = 653
+    Top = 449
   end
   object ExportPictureDialog: TSaveDialog
     Title = 'Export as...'
     DefaultExt = '.png'
     Options = [ofOverwritePrompt, ofEnableSizing, ofViewDetail]
-    Left = 578
-    Top = 427
+    Left = 544
+    Top = 449
+  end
+  object SVGImageList1: TBGRASVGImageList
+    Width = 16
+    Height = 16
+    TargetRasterImageList = SVGRasterImageList1
+    Left = 200
+    Top = 514
+    Items = {
+      3C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D227574
+      662D38223F3E0D0A3C434F4E46494720436F756E743D2237223E0D0A20203C49
+      74656D30205356473D22266C743B3F786D6C2076657273696F6E3D2671756F74
+      3B312E302671756F743B20656E636F64696E673D2671756F743B7574662D3826
+      71756F743B3F2667743B262378443B262378413B266C743B7376672077696474
+      683D2671756F743B33322671756F743B20786D6C6E733D2671756F743B687474
+      703A2F2F7777772E77332E6F72672F323030302F7376672671756F743B206865
+      696768743D2671756F743B33322671756F743B2076696577426F783D2671756F
+      743B3020302033322033322671756F743B20786D6C6E733A696E6B7363617065
+      3D2671756F743B687474703A2F2F7777772E696E6B73636170652E6F72672F6E
+      616D657370616365732F696E6B73636170652671756F743B2667743B26237844
+      3B262378413B2020266C743B67206F7061636974793D2671756F743B31267175
+      6F743B20786D6C6E733A626772613D2671756F743B68747470733A2F2F77696B
+      692E6672656570617363616C2E6F72672F4C617A5061696E745F5356475F666F
+      726D61742671756F743B20696E6B73636170653A6C6162656C3D2671756F743B
+      4C61796572312671756F743B20696E6B73636170653A67726F75706D6F64653D
+      2671756F743B6C617965722671756F743B20626772613A6F726967696E616C56
+      696577426F783D2671756F743B3020302032392032382671756F743B2667743B
+      262378443B262378413B20202020266C743B7061746820643D2671756F743B4D
+      32382E383433373520362E353933373520302E303933373520302E3033313235
+      2671756F743B2066696C6C3D2671756F743B626C61636B2671756F743B207374
+      726F6B653D2671756F743B6E6F6E652671756F743B2066696C6C2D6F70616369
+      74793D2671756F743B312671756F743B2F2667743B262378443B262378413B20
+      202020266C743B7061746820643D2671756F743B4D3920323820392033203135
+      2033203135203238207A2671756F743B2066696C6C3D2671756F743B626C6163
+      6B2671756F743B207374726F6B653D2671756F743B6E6F6E652671756F743B20
+      66696C6C2D6F7061636974793D2671756F743B302E373932313536392671756F
+      743B2F2667743B262378443B262378413B20202020266C743B7061746820643D
+      2671756F743B4D31352032382031382E38383436312032372E39343437312051
+      32322E37363932332032372E38383934322032342E38363239382032352E3630
+      3831372032362E39353637332032332E33323639322032362E39373833362032
+      302E31363334362032372031372032352E37352031352E32352032342E352031
+      332E352032322E32352031322E37352032302031322031372E35203132204C31
+      35203132203135203136203137203136205131392031362032302E3520313720
+      32322031382032312E38323231312032302E30333834362032312E3634343233
+      2032322E30373639322032302E32363932332032322E39383331372031382E38
+      393432332032332E38383934322031362E39343731312032332E393434373120
+      4C3135203234207A2671756F743B2066696C6C3D2671756F743B626C61636B26
+      71756F743B207374726F6B653D2671756F743B6E6F6E652671756F743B206669
+      6C6C2D6F7061636974793D2671756F743B302E373932313536392671756F743B
+      2F2667743B262378443B262378413B2020266C743B2F672667743B262378443B
+      262378413B266C743B2F7376672667743B262378443B262378413B222F3E0D0A
+      20203C4974656D31205356473D22266C743B3F786D6C2076657273696F6E3D26
+      71756F743B312E302671756F743B20656E636F64696E673D2671756F743B7574
+      662D382671756F743B3F2667743B262378443B262378413B266C743B73766720
+      77696474683D2671756F743B33322671756F743B20786D6C6E733D2671756F74
+      3B687474703A2F2F7777772E77332E6F72672F323030302F7376672671756F74
+      3B206865696768743D2671756F743B33322671756F743B2076696577426F783D
+      2671756F743B3020302033322033322671756F743B20786D6C6E733A696E6B73
+      636170653D2671756F743B687474703A2F2F7777772E696E6B73636170652E6F
+      72672F6E616D657370616365732F696E6B73636170652671756F743B2667743B
+      262378443B262378413B2020266C743B67206F7061636974793D2671756F743B
+      312671756F743B20786D6C6E733A626772613D2671756F743B68747470733A2F
+      2F77696B692E6672656570617363616C2E6F72672F4C617A5061696E745F5356
+      475F666F726D61742671756F743B20696E6B73636170653A6C6162656C3D2671
+      756F743B4C61796572312671756F743B20696E6B73636170653A67726F75706D
+      6F64653D2671756F743B6C617965722671756F743B20626772613A6F72696769
+      6E616C56696577426F783D2671756F743B3020302032392032382671756F743B
+      2667743B262378443B262378413B20202020266C743B7061746820643D267175
+      6F743B4D32382E383433373520362E353933373520302E303933373520302E30
+      333132352671756F743B2066696C6C3D2671756F743B626C61636B2671756F74
+      3B207374726F6B653D2671756F743B6E6F6E652671756F743B2066696C6C2D6F
+      7061636974793D2671756F743B312671756F743B2F2667743B262378443B2623
+      78413B20202020266C743B7061746820643D2671756F743B4D31312032382031
+      362E352031332032302E35203133203135203238207A2671756F743B2066696C
+      6C3D2671756F743B626C61636B2671756F743B207374726F6B653D2671756F74
+      3B6E6F6E652671756F743B2066696C6C2D6F7061636974793D2671756F743B30
+      2E373932313536392671756F743B2F2667743B262378443B262378413B202020
+      20266C743B7061746820643D2671756F743B4D31382031302031392036203233
+      20362032312E37313837352031302E3039333735207A2671756F743B2066696C
+      6C3D2671756F743B626C61636B2671756F743B207374726F6B653D2671756F74
+      3B6E6F6E652671756F743B2066696C6C2D6F7061636974793D2671756F743B30
+      2E373932313536392671756F743B2F2667743B262378443B262378413B202020
+      20266C743B7061746820643D2671756F743B4D32342E34303632352031342E33
+      3433373520312E303933373520302E3033313235207A2671756F743B2066696C
+      6C3D2671756F743B626C61636B2671756F743B207374726F6B653D2671756F74
+      3B6E6F6E652671756F743B2066696C6C2D6F7061636974793D2671756F743B30
+      2E373932313536392671756F743B2F2667743B262378443B262378413B202026
+      6C743B2F672667743B262378443B262378413B266C743B2F7376672667743B26
+      2378443B262378413B222F3E0D0A20203C4974656D32205356473D22266C743B
+      3F786D6C2076657273696F6E3D2671756F743B312E302671756F743B20656E63
+      6F64696E673D2671756F743B7574662D382671756F743B3F2667743B26237844
+      3B262378413B266C743B7376672077696474683D2671756F743B33322671756F
+      743B20786D6C6E733D2671756F743B687474703A2F2F7777772E77332E6F7267
+      2F323030302F7376672671756F743B206865696768743D2671756F743B333226
+      71756F743B2076696577426F783D2671756F743B302030203332203332267175
+      6F743B20786D6C6E733A696E6B73636170653D2671756F743B687474703A2F2F
+      7777772E696E6B73636170652E6F72672F6E616D657370616365732F696E6B73
+      636170652671756F743B2667743B262378443B262378413B2020266C743B6720
+      6F7061636974793D2671756F743B312671756F743B20786D6C6E733A62677261
+      3D2671756F743B68747470733A2F2F77696B692E6672656570617363616C2E6F
+      72672F4C617A5061696E745F5356475F666F726D61742671756F743B20696E6B
+      73636170653A6C6162656C3D2671756F743B4C61796572312671756F743B2069
+      6E6B73636170653A67726F75706D6F64653D2671756F743B6C61796572267175
+      6F743B20626772613A6F726967696E616C56696577426F783D2671756F743B2D
+      3331202D352039342033352671756F743B2667743B262378443B262378413B20
+      202020266C743B7465787420783D2671756F743B302671756F743B20793D2671
+      756F743B2D352671756F743B2066696C6C3D2671756F743B626C61636B267175
+      6F743B207374726F6B653D2671756F743B6E6F6E652671756F743B20666F6E74
+      2D73697A653D2671756F743B33312671756F743B20666F6E742D7374796C653D
+      2671756F743B6E6F726D616C2671756F743B20666F6E742D66616D696C793D26
+      71756F743B4672656553616E732671756F743B20666F6E742D7765696768743D
+      2671756F743B6E6F726D616C2671756F743B2066696C6C2D6F7061636974793D
+      2671756F743B302E373932313536392671756F743B20746578742D6465636F72
+      6174696F6E3D2671756F743B2671756F743B2667743B262378443B262378413B
+      202020202020266C743B747370616E20783D2671756F743B372E333737383637
+      2671756F743B20793D2671756F743B32332671756F743B20646972656374696F
+      6E3D2671756F743B6C74722671756F743B20746578744C656E6774683D267175
+      6F743B31372E32343432372671756F743B2667743B75266C743B2F747370616E
+      2667743B262378443B262378413B20202020266C743B2F746578742667743B26
+      2378443B262378413B20202020266C743B7061746820643D2671756F743B4D36
+      2E3520333020362E352032362032352E352032362032352E35203330207A2671
+      756F743B2066696C6C3D2671756F743B626C61636B2671756F743B207374726F
+      6B653D2671756F743B6E6F6E652671756F743B2066696C6C2D6F706163697479
+      3D2671756F743B302E373932313536392671756F743B2F2667743B262378443B
+      262378413B2020266C743B2F672667743B262378443B262378413B266C743B2F
+      7376672667743B262378443B262378413B222F3E0D0A20203C4974656D332053
+      56473D22266C743B3F786D6C2076657273696F6E3D2671756F743B312E302671
+      756F743B20656E636F64696E673D2671756F743B7574662D382671756F743B3F
+      2667743B262378443B262378413B266C743B7376672077696474683D2671756F
+      743B33322671756F743B20786D6C6E733D2671756F743B687474703A2F2F7777
+      772E77332E6F72672F323030302F7376672671756F743B206865696768743D26
+      71756F743B33322671756F743B2076696577426F783D2671756F743B30203020
+      33322033322671756F743B20786D6C6E733A696E6B73636170653D2671756F74
+      3B687474703A2F2F7777772E696E6B73636170652E6F72672F6E616D65737061
+      6365732F696E6B73636170652671756F743B2667743B262378443B262378413B
+      2020266C743B67206F7061636974793D2671756F743B312671756F743B20786D
+      6C6E733A626772613D2671756F743B68747470733A2F2F77696B692E66726565
+      70617363616C2E6F72672F4C617A5061696E745F5356475F666F726D61742671
+      756F743B20696E6B73636170653A6C6162656C3D2671756F743B4C6179657231
+      2671756F743B20696E6B73636170653A67726F75706D6F64653D2671756F743B
+      6C617965722671756F743B20626772613A6F726967696E616C56696577426F78
+      3D2671756F743B3520392032322031392671756F743B2667743B262378443B26
+      2378413B20202020266C743B7061746820643D2671756F743B4D352E35203230
+      20352E352031362032362E352031362032362E35203230207A2671756F743B20
+      66696C6C3D2671756F743B626C61636B2671756F743B207374726F6B653D2671
+      756F743B6E6F6E652671756F743B2066696C6C2D6F7061636974793D2671756F
+      743B302E373932313536392671756F743B2F2667743B262378443B262378413B
+      20202020266C743B7061746820643D2671756F743B4D31322E37353235312032
+      322E30343231372031332E30393533342032332E3139313232205131332E3433
+      3831372032342E33343032372031342E38373239312032342E36383834362031
+      362E33303736352032352E30333636352031372E37323138372032352E303033
+      31382031392E31333630382032342E39363937312031392E3632323232203234
+      2E32313834312032302E31303833352032332E34363731312031392E38343331
+      392032322E30393730392031392E35373830322032302E37323730372031372E
+      36333334382032302E31353235342031352E36383839332031392E3537383032
+      2031332E3635362031392E30343736392031312E36323330372031382E353137
+      33362031302E363530382031372E353839323820392E3637383532352031362E
+      3636313220392E3731353133372031352E303138343420392E37353137343920
+      31332E33373536372031302E33373439312031322E33353639392031302E3939
+      3830372031312E333338332031322E34303639322031302E363439352031332E
+      383135373720392E3936303639342031362E303732383220392E393035373737
+      2031382E333239383620392E38353038362031392E35303730322031302E3339
+      3633352032302E36383431382031302E39343138352032312E34383238312031
+      312E37353437332032322E32383134352031322E35363736312032322E343234
+      37352031332E3235363431204C32322E35363830362031332E39343532322031
+      392E33363436332031342E30353530352031382E383334332031332E34353234
+      32205131382E33303339372031322E38343937382031362E363936392031322E
+      39313030362031352E30383938322031322E39373033342031342E3036333535
+      2031332E35393434322031332E30333732382031342E323138352031322E3934
+      38392031342E38363533332031322E38363035312031352E3531323136203135
+      2E35353633352031362E33393630342031382E32353231392031372E32373939
+      322031392E35333338332031372E37323138362032302E38313534362031382E
+      31363338312032312E37343335342031382E39313531312032322E3637313631
+      2031392E36363634312032322E38393235382032312E31323438322032332E31
+      313335362032322E35383332332032322E37362032332E39303930352032322E
+      34303634352032352E32333438382032302E35383530362032362E3632363334
+      2031382E37363336382032382E30313738312031362E33353739372032372E39
+      393633362031332E39353232362032372E39373439312031322E393033323420
+      32372E34353433392031312E38353432332032362E39333338362031302E3835
+      3437362032362E303834333720392E3835353330322032352E32333438382039
+      2E3732303439382032332E3632303232204C392E3538353639342032322E3030
+      353536207A2671756F743B2066696C6C3D2671756F743B626C61636B2671756F
+      743B207374726F6B653D2671756F743B6E6F6E652671756F743B2066696C6C2D
+      6F7061636974793D2671756F743B302E373932313536392671756F743B2F2667
+      743B262378443B262378413B2020266C743B2F672667743B262378443B262378
+      413B266C743B2F7376672667743B262378443B262378413B222F3E0D0A20203C
+      4974656D34205356473D22266C743B3F786D6C2076657273696F6E3D2671756F
+      743B312E302671756F743B20656E636F64696E673D2671756F743B7574662D38
+      2671756F743B3F2667743B262378443B262378413B266C743B73766720776964
+      74683D2671756F743B33322671756F743B20786D6C6E733D2671756F743B6874
+      74703A2F2F7777772E77332E6F72672F323030302F7376672671756F743B2068
+      65696768743D2671756F743B33322671756F743B2076696577426F783D267175
+      6F743B3020302033322033322671756F743B20786D6C6E733A696E6B73636170
+      653D2671756F743B687474703A2F2F7777772E696E6B73636170652E6F72672F
+      6E616D657370616365732F696E6B73636170652671756F743B2667743B262378
+      443B262378413B2020266C743B67206F7061636974793D2671756F743B312671
+      756F743B20786D6C6E733A626772613D2671756F743B68747470733A2F2F7769
+      6B692E6672656570617363616C2E6F72672F4C617A5061696E745F5356475F66
+      6F726D61742671756F743B20696E6B73636170653A6C6162656C3D2671756F74
+      3B4C61796572312671756F743B20696E6B73636170653A67726F75706D6F6465
+      3D2671756F743B6C617965722671756F743B20626772613A6F726967696E616C
+      56696577426F783D2671756F743B2D313520302036322032392671756F743B26
+      67743B262378443B262378413B20202020266C743B7061746820643D2671756F
+      743B4D332E352032322031302031352E35203130203230203232203230203232
+      2031352E352032382E352032322032322032382E352032322032342031302032
+      342031302032382E35207A2671756F743B2066696C6C3D2671756F743B626C61
+      636B2671756F743B207374726F6B653D2671756F743B6E6F6E652671756F743B
+      2066696C6C2D6F7061636974793D2671756F743B302E37393231353639267175
+      6F743B2F2667743B262378443B262378413B20202020266C743B746578742078
+      3D2671756F743B302671756F743B20793D2671756F743B302671756F743B2066
+      696C6C3D2671756F743B626C61636B2671756F743B207374726F6B653D267175
+      6F743B6E6F6E652671756F743B20666F6E742D73697A653D2671756F743B3135
+      2671756F743B20666F6E742D7374796C653D2671756F743B6E6F726D616C2671
+      756F743B20666F6E742D66616D696C793D2671756F743B4672656553616E7326
+      71756F743B20666F6E742D7765696768743D2671756F743B6E6F726D616C2671
+      756F743B2066696C6C2D6F7061636974793D2671756F743B302E393638363237
+      352671756F743B20746578742D6465636F726174696F6E3D2671756F743B2671
+      756F743B2667743B262378443B262378413B202020202020266C743B74737061
+      6E20783D2671756F743B31312E3832382671756F743B20793D2671756F743B31
+      342671756F743B20646972656374696F6E3D2671756F743B6C74722671756F74
+      3B20746578744C656E6774683D2671756F743B382E3334343030312671756F74
+      3B2667743B3F266C743B2F747370616E2667743B262378443B262378413B2020
+      2020266C743B2F746578742667743B262378443B262378413B2020266C743B2F
+      672667743B262378443B262378413B266C743B2F7376672667743B262378443B
+      262378413B222F3E0D0A20203C4974656D35205356473D22266C743B3F786D6C
+      2076657273696F6E3D2671756F743B312E302671756F743B20656E636F64696E
+      673D2671756F743B7574662D382671756F743B3F2667743B262378443B262378
+      413B266C743B7376672077696474683D2671756F743B33322671756F743B2078
+      6D6C6E733D2671756F743B687474703A2F2F7777772E77332E6F72672F323030
+      302F7376672671756F743B206865696768743D2671756F743B33322671756F74
+      3B2076696577426F783D2671756F743B3020302033322033322671756F743B20
+      786D6C6E733A696E6B73636170653D2671756F743B687474703A2F2F7777772E
+      696E6B73636170652E6F72672F6E616D657370616365732F696E6B7363617065
+      2671756F743B2667743B262378443B262378413B2020266C743B67206F706163
+      6974793D2671756F743B312671756F743B20786D6C6E733A626772613D267175
+      6F743B68747470733A2F2F77696B692E6672656570617363616C2E6F72672F4C
+      617A5061696E745F5356475F666F726D61742671756F743B20696E6B73636170
+      653A6C6162656C3D2671756F743B4C61796572312671756F743B20696E6B7363
+      6170653A67726F75706D6F64653D2671756F743B6C617965722671756F743B20
+      626772613A6F726967696E616C56696577426F783D2671756F743B2D3130202D
+      312035362033302671756F743B2667743B262378443B262378413B2020202026
+      6C743B7061746820643D2671756F743B4D342032302032322032302032322031
+      352E352032382E352032322032322032382E352032322032342034203234207A
+      2671756F743B2066696C6C3D2671756F743B626C61636B2671756F743B207374
+      726F6B653D2671756F743B6E6F6E652671756F743B2066696C6C2D6F70616369
+      74793D2671756F743B302E373932313536392671756F743B2F2667743B262378
+      443B262378413B20202020266C743B7465787420783D2671756F743B34267175
+      6F743B20793D2671756F743B2D312671756F743B2066696C6C3D2671756F743B
+      626C61636B2671756F743B207374726F6B653D2671756F743B6E6F6E65267175
+      6F743B20666F6E742D73697A653D2671756F743B31342671756F743B20666F6E
+      742D7374796C653D2671756F743B6E6F726D616C2671756F743B20666F6E742D
+      66616D696C793D2671756F743B4672656553616E732671756F743B20666F6E74
+      2D7765696768743D2671756F743B6E6F726D616C2671756F743B2066696C6C2D
+      6F7061636974793D2671756F743B302E393638363237352671756F743B207465
+      78742D6465636F726174696F6E3D2671756F743B2671756F743B2667743B2623
+      78443B262378413B202020202020266C743B747370616E20783D2671756F743B
+      342671756F743B20793D2671756F743B31322671756F743B2064697265637469
+      6F6E3D2671756F743B6C74722671756F743B20746578744C656E6774683D2671
+      756F743B32332E31353431332671756F743B2667743BCEB1CEB2CEB3266C743B
+      2F747370616E2667743B262378443B262378413B20202020266C743B2F746578
+      742667743B262378443B262378413B2020266C743B2F672667743B262378443B
+      262378413B266C743B2F7376672667743B262378443B262378413B222F3E0D0A
+      20203C4974656D36205356473D22266C743B3F786D6C2076657273696F6E3D26
+      71756F743B312E302671756F743B20656E636F64696E673D2671756F743B7574
+      662D382671756F743B3F2667743B262378443B262378413B266C743B73766720
+      77696474683D2671756F743B33322671756F743B20786D6C6E733D2671756F74
+      3B687474703A2F2F7777772E77332E6F72672F323030302F7376672671756F74
+      3B206865696768743D2671756F743B33322671756F743B2076696577426F783D
+      2671756F743B3020302033322033322671756F743B20786D6C6E733A696E6B73
+      636170653D2671756F743B687474703A2F2F7777772E696E6B73636170652E6F
+      72672F6E616D657370616365732F696E6B73636170652671756F743B2667743B
+      262378443B262378413B2020266C743B67206F7061636974793D2671756F743B
+      312671756F743B20786D6C6E733A626772613D2671756F743B68747470733A2F
+      2F77696B692E6672656570617363616C2E6F72672F4C617A5061696E745F5356
+      475F666F726D61742671756F743B20696E6B73636170653A6C6162656C3D2671
+      756F743B4C61796572312671756F743B20696E6B73636170653A67726F75706D
+      6F64653D2671756F743B6C617965722671756F743B20626772613A6F72696769
+      6E616C56696577426F783D2671756F743B2D313520302035392032392671756F
+      743B2667743B262378443B262378413B20202020266C743B7061746820643D26
+      71756F743B4D332E352032322031302031352E35203130203230203238203230
+      2032382032342031302032342031302032382E35207A2671756F743B2066696C
+      6C3D2671756F743B626C61636B2671756F743B207374726F6B653D2671756F74
+      3B6E6F6E652671756F743B2066696C6C2D6F7061636974793D2671756F743B30
+      2E373932313536392671756F743B2F2667743B262378443B262378413B202020
+      20266C743B7465787420783D2671756F743B302671756F743B20793D2671756F
+      743B302671756F743B2066696C6C3D2671756F743B626C61636B2671756F743B
+      207374726F6B653D2671756F743B6E6F6E652671756F743B20666F6E742D7369
+      7A653D2671756F743B31352671756F743B20666F6E742D7374796C653D267175
+      6F743B6E6F726D616C2671756F743B20666F6E742D66616D696C793D2671756F
+      743B4672656553616E732671756F743B20666F6E742D7765696768743D267175
+      6F743B6E6F726D616C2671756F743B2066696C6C2D6F7061636974793D267175
+      6F743B302E393638363237352671756F743B20746578742D6465636F72617469
+      6F6E3D2671756F743B2671756F743B2667743B262378443B262378413B202020
+      202020266C743B747370616E20783D2671756F743B32392671756F743B20793D
+      2671756F743B31342671756F743B20646972656374696F6E3D2671756F743B72
+      746C2671756F743B20746578744C656E6774683D2671756F743B32322E353638
+      2671756F743B2667743BD790D791D792266C743B2F747370616E2667743B2623
+      78443B262378413B20202020266C743B2F746578742667743B262378443B2623
+      78413B2020266C743B2F672667743B262378443B262378413B266C743B2F7376
+      672667743B262378443B262378413B222F3E0D0A3C2F434F4E4649473E0D0A
+    }
+  end
+  object SVGRasterImageList1: TBGRAImageList
+    Scaled = True
+    Left = 653
+    Top = 216
+    Bitmap = {
+      4C7A070000001000000010000000410300000000000078DAED98FB8B4D5114C7
+      EFC35CE34E3306B9189910C9E3326EC63B9428C50F66623C87A13163D22D6F61
+      E4393261AE478D483285C8B3943C6A26EF2E7E935FE4173F4929C51FE0BBEA7B
+      6B77BAE7D8679FEB8C9ABBEAD369F6DCEFDEFBECBDD7DA6B9D4020E79600F524
+      61A0175D9AD4F7707D079F5DE00AA80105067A9536107431FF30180D2E28ED95
+      06EF3F42695F6DA08F2BED2B5CE87B830A704D691FEB61FD0E19ACFF0B701DD4
+      723DF3E6AF35731F1618EAEF8397A0C8C31C0A0D75CB78A64A0DB483C15BF0E0
+      2F3E6F67EBB96E0D8673BF457DB981763CB5970DC7DE497DB581B61778C23D2F
+      31D0CFE5D827F2AEE7BB25C12CCB79DF01666AEA1FD3DF424ADB7350A7A9EF04
+      8D16BD9B5CE07FD06F51EEA91297FAA7A055D12F74A9179F790D8E827DE0864B
+      7D5FB09FF7ADCCA30CB480F93E9CBDF62CF98295F67FA8CF5B6E2DA8916F6733
+      C92F2FF21CCB9EDDE59DA07BF73C026FC001C69D0EDE45651AFA18C73C658901
+      3A759BE8DE811FE037F809BE828F96339870D00BEFC167F00DFC625FDFC10707
+      BD9D4518CF44B754E3F7993A23698909D2B652432F71EB21F7EE38D8C49AE919
+      F3291D2BA7A693A438AF9E6405ACBD0A79A6DD5898714EEADE4FDC4B37677900
+      D80D86D117BFF01CB9B541E00EFB32A9DBD681D3A08FE11A2E67DD1B72E92F6A
+      CD1C5372A1888636E5F0FF94431F196DDA419FB6E943D5EA60EDC3ABDEEBFC73
+      B17E018D3D8AF8E8BB93583BC535CE7E84F59AE4DDE3C06CE66B2D7CC6E99351
+      E5A9DA0CB0193481C3E02CD8C55CB099DF7B9680C57CC62C7AB91FB68339D4DE
+      E6DF49DEA18DAC016E826DA0D8A2DF08F6822A7089FA63FC5E23E36F007BB8FF
+      B559DEBF82ED32CE41709E7E2F63AEE19A34B0EF4A9B3C6308180586731E123B
+      A6B13DC8FC7595E61D2479C2484BDC91B6311E6291EEF90D18FA4FDAA3FF7AD5
+      7B9DBF1FEBE797FF7797499CE9C79C41CE697F7E730B3187C8BC7FD4463F94F5
+      7B137DA58B35A0B44F006B99931C71C8F725373DC9DF0D046798BB17F33BC022
+      F0CA461FE5186D4ACE5347DF9D0EEEB13E3E67F3EE53C1559E9379CC77258E6C
+      E53B55B3BD35CBB7C830E3C7643091DF3BAA98F34ACC9CC27508F21D8A0CEE2F
+      9DDC21ED51AB4B2EF55EE79F8BF5EB161FFF03AC4F0A26
+    }
+  end
+  object TimerHideTextMore: TTimer
+    Enabled = False
+    Interval = 3000
+    OnTimer = TimerHideFillTimer
+    Left = 653
+    Top = 272
   end
 end

+ 7 - 0
lazpaint/lazpaintmainform.lrj

@@ -78,6 +78,13 @@
 {"hash":264792562,"name":"tfmain.image_swapcolors.hint","sourcebytes":[83,119,105,116,99,104,32,99,111,108,111,114],"value":"Switch color"},
 {"hash":296859,"name":"tfmain.label_back.caption","sourcebytes":[66,97,99,107],"value":"Back"},
 {"hash":76172398,"name":"tfmain.button_donate.caption","sourcebytes":[68,111,110,97,116,101,46,46,46],"value":"Donate..."},
+{"hash":300580,"name":"tfmain.tool_textbold.hint","sourcebytes":[66,111,108,100],"value":"Bold"},
+{"hash":84574963,"name":"tfmain.tool_textitalic.hint","sourcebytes":[73,116,97,108,105,99],"value":"Italic"},
+{"hash":180974597,"name":"tfmain.tool_textunderline.hint","sourcebytes":[85,110,100,101,114,108,105,110,101],"value":"Underline"},
+{"hash":151125108,"name":"tfmain.tool_textstrikeout.hint","sourcebytes":[83,116,114,105,107,101,111,117,116],"value":"Strikeout"},
+{"hash":39152780,"name":"tfmain.tool_textbidirectional.hint","sourcebytes":[66,105,100,105,114,101,99,116,105,111,110,97,108],"value":"Bidirectional"},
+{"hash":63280628,"name":"tfmain.tool_textltr.hint","sourcebytes":[76,101,102,116,32,116,111,32,114,105,103,104,116],"value":"Left to right"},
+{"hash":65854964,"name":"tfmain.tool_textrtl.hint","sourcebytes":[82,105,103,104,116,32,116,111,32,108,101,102,116],"value":"Right to left"},
 {"hash":88908046,"name":"tfmain.filenew.caption","sourcebytes":[78,101,119,46,46,46],"value":"New..."},
 {"hash":111833829,"name":"tfmain.filenew.hint","sourcebytes":[67,114,101,97,116,101,32,97,32,110,101,119,32,102,105,108,101],"value":"Create a new file"},
 {"hash":107745630,"name":"tfmain.fileopen.caption","sourcebytes":[79,112,101,110,46,46,46],"value":"Open..."},

+ 27 - 1
lazpaint/lazpaintmainform.pas

@@ -8,7 +8,8 @@ interface
 uses
   Classes, LMessages, SysUtils, LazFileUtils, LResources, Forms, Controls,
   Graphics, Dialogs, Menus, ExtDlgs, ComCtrls, ActnList, StdCtrls, ExtCtrls,
-  Buttons, types, LCLType, BGRAImageList, BCTrackbarUpdown, BCComboBox, BCButton,
+  Buttons, types, LCLType, BGRAImageList, BCTrackbarUpdown, BCComboBox,
+  BCButton, BGRASVGImageList,
 
   BGRABitmap, BGRABitmapTypes, BGRALayers, BGRASVGOriginal, BGRAGradientScanner, BGRAGradientOriginal,
 
@@ -23,6 +24,9 @@ type
   { TFMain }
 
   TFMain = class(TForm)
+    SVGRasterImageList1: TBGRAImageList;
+    Panel_TextMore: TPanel;
+    SVGImageList1: TBGRASVGImageList;
     Button_Donate: TBCButton;
     LayerExport: TAction;
     FileExport: TAction;
@@ -30,6 +34,14 @@ type
     MenuScript: TMenuItem;
     Panel_OutlineFill: TPanel;
     Panel_Donate: TPanel;
+    TimerHideTextMore: TTimer;
+    ToolBar25: TToolBar;
+    Tool_TextRTL: TToolButton;
+    Tool_TextBidirectional: TToolButton;
+    Tool_TextLTR: TToolButton;
+    Tool_TextItalic: TToolButton;
+    Tool_TextUnderline: TToolButton;
+    Tool_TextStrikeout: TToolButton;
     ToolOpenedCurve: TAction;
     ToolPolyline: TAction;
     FileRunScript: TAction;
@@ -56,6 +68,7 @@ type
     Tool_EraseSharpen: TToolButton;
     Tool_EraseLighten: TToolButton;
     Tool_EraseDarken: TToolButton;
+    Tool_TextBold: TToolButton;
     VectorialFill_Outline: TLCVectorialFillControl;
     VectorialFill_Pen: TLCVectorialFillControl;
     VectorialFill_Back: TLCVectorialFillControl;
@@ -496,6 +509,10 @@ type
     procedure MenuZoomToolbarClick(Sender: TObject);
     procedure PaintBox_PenPreviewMouseDown(Sender: TObject;
       {%H-}Button: TMouseButton; {%H-}Shift: TShiftState; X, Y: Integer);
+    procedure Panel_TextMoreMouseMove(Sender: TObject; {%H-}Shift: TShiftState; {%H-}X,
+      {%H-}Y: Integer);
+    procedure Panel_TextMouseMove(Sender: TObject; {%H-}Shift: TShiftState; {%H-}X,
+      {%H-}Y: Integer);
     procedure PopupToolbarPopup(Sender: TObject);
     procedure PopupToolboxPopup(Sender: TObject);
     procedure SelectionHorizontalFlipUpdate(Sender: TObject);
@@ -564,6 +581,7 @@ type
     procedure SpinEdit_TextShadowYChange(Sender: TObject; AByUser: boolean);
     procedure TimerUpdateTimer(Sender: TObject);
     procedure TimerHidePenPreviewTimer(Sender: TObject);
+    procedure TimerHideTextMoreTimer(Sender: TObject);
     procedure ToolChangeDockingExecute(Sender: TObject);
     procedure ToolHotSpotUpdate(Sender: TObject);
     procedure ToolRotateSelectionUpdate(Sender: TObject);
@@ -577,6 +595,8 @@ type
     procedure Tool_PhongShapeVerticalCylinderClick(Sender: TObject);
     procedure ToolLayerMappingUpdate(Sender: TObject);
     procedure Tool_TextAlignClick(Sender: TObject);
+    procedure Tool_TextBidiModeClick(Sender: TObject);
+    procedure Tool_TextStyleClick(Sender: TObject);
     procedure Tool_TextPhongClick(Sender: TObject);
     procedure Tool_GridMoveWithoutDeformationClick(Sender: TObject);
     procedure Tool_PhongShapeConeClick(Sender: TObject);
@@ -781,7 +801,9 @@ type
     procedure ToggleLayersVisible;
     function ShowColorDialogFor(ATarget: TColorTarget): boolean;
     procedure ShowPenPreview(ShouldRepaint: boolean= False);
+    procedure ShowTextMore;
     procedure HidePenPreview(ATimeMs: Integer = 300; AClearTime: boolean = false);
+    procedure HideTextMore(ATimeMs: Integer = 300; AClearTime: boolean = false);
     procedure ShowFill(AFillControl: TLCVectorialFillControl; APanel: TPanel);
     procedure HideFill(ATimeMs: Integer = 300; AClearTime: boolean = false);
     procedure OnImageChangedHandler({%H-}AEvent: TLazPaintImageObservationEvent);
@@ -1164,6 +1186,8 @@ begin
     m.Apply;
     FLayout.Menu := m;
 
+    SVGImageList1.Width := iconSize;
+    SVGImageList1.Height := iconSize;
     Button_Donate.Images := m.ImageList;
     w := Button_Donate.Width; h := Button_Donate.Height;
     Button_Donate.GetPreferredSize(w, h);
@@ -4267,6 +4291,7 @@ end;
 procedure TFMain.PictureMouseMove(Sender: TObject; APosition: TPointF);
 begin
   HidePenPreview;
+  HideTextMore;
   HideFill;
 
   FCoordinatesCaption := IntToStr(round(APosition.X))+','+IntToStr(round(APosition.Y));
@@ -4481,6 +4506,7 @@ begin
   begin
     Layout.DarkTheme := AValue;
     DarkThemeInstance.Apply(Panel_PenWidthPreview, AValue);
+    DarkThemeInstance.Apply(Panel_TextMore, AValue);
     Invalidate;
     UpdateToolImage(true);
   end;

+ 91 - 0
lazpaint/maintoolbar.inc

@@ -110,11 +110,20 @@ begin
   Tool_TextAlignLeft.OnClick := @Tool_TextAlignClick;
   Tool_TextAlignCenter.OnClick := @Tool_TextAlignClick;
   Tool_TextAlignRight.OnClick := @Tool_TextAlignClick;
+  Tool_TextBidirectional.OnClick := @Tool_TextBidiModeClick;
+  Tool_TextLTR.OnClick := @Tool_TextBidiModeClick;
+  Tool_TextRTL.OnClick := @Tool_TextBidiModeClick;
+  Tool_TextBold.OnClick := @Tool_TextStyleClick;
+  Tool_TextItalic.OnClick := @Tool_TextStyleClick;
+  Tool_TextUnderline.OnClick := @Tool_TextStyleClick;
+  Tool_TextStrikeout.OnClick := @Tool_TextStyleClick;
   Tool_TextPhong.OnClick := @Tool_TextPhongClick;
   Tool_TextShadow.OnClick := @Tool_TextShadowClick;
   Tool_TextOutline.OnClick := @Tool_TextOutlineClick;
+  Panel_TextMore.AutoSize := true;
   Panel_ToolbarBackground.OnMouseMove := @Panel_ToolbarBackgroundMouseMove;
   TimerHidePenPreview.OnTimer := @TimerHidePenPreviewTimer;
+  TimerHideTextMore.OnTimer := @TimerHideTextMoreTimer;
   ComboBox_BrushSelect.OnChange := @ComboBox_BrushSelectChange;
   ComboBox_BrushSelect.OnDrawItem := @ComboBox_BrushSelectDrawItem;
   ComboBox_BrushSelect.OnDrawSelectedItem:= @ComboBox_BrushSelectDrawSelectedItem;
@@ -418,6 +427,10 @@ begin
   if FInTextFont and not AForce then exit;
   SpinEdit_TextSize.Value := round(ToolManager.TextFontSize);
   UpdateTextSizeIncrement;
+  Tool_TextBold.Down := fsBold in ToolManager.TextFontStyle;
+  Tool_TextItalic.Down := fsItalic in ToolManager.TextFontStyle;
+  Tool_TextUnderline.Down := fsUnderline in ToolManager.TextFontStyle;
+  Tool_TextStrikeout.Down := fsStrikeOut in ToolManager.TextFontStyle;
 end;
 
 procedure TFMain.UpdateTextAlign;
@@ -1547,6 +1560,17 @@ begin
   HidePenPreview(3000, true);
 end;
 
+procedure TFMain.ShowTextMore;
+begin
+  if not Panel_TextMore.Visible then
+  begin
+    Panel_TextMore.Left := min(Panel_Text.Left, ClientWidth-Panel_TextMore.Width);
+    Panel_TextMore.Top := Panel_Text.Top+Panel_Text.Height;
+    Panel_TextMore.Visible := True;
+  end;
+  HideTextMore(3000, true);
+end;
+
 procedure TFMain.HidePenPreview(ATimeMs: Integer; AClearTime: boolean);
 begin
   if AClearTime then TimerHidePenPreview.Enabled := false;
@@ -1557,6 +1581,16 @@ begin
   end;
 end;
 
+procedure TFMain.HideTextMore(ATimeMs: Integer; AClearTime: boolean);
+begin
+  if AClearTime then TimerHideTextMore.Enabled := false;
+  if Panel_TextMore.Visible then
+  begin
+    TimerHideTextMore.Interval := ATimeMs;
+    TimerHideTextMore.Enabled := true;
+  end;
+end;
+
 procedure TFMain.ShowFill(AFillControl: TLCVectorialFillControl; APanel: TPanel);
 begin
   AFillControl.BringToFront;
@@ -1581,6 +1615,7 @@ procedure TFMain.Panel_ToolbarBackgroundMouseMove(Sender: TObject;
   Shift: TShiftState; X, Y: Integer);
 begin
   HidePenPreview;
+  HideTextMore;
   HideFill;
 end;
 
@@ -1629,6 +1664,18 @@ begin
   ShowPenPreview(False);
 end;
 
+procedure TFMain.Panel_TextMoreMouseMove(Sender: TObject; Shift: TShiftState;
+  X, Y: Integer);
+begin
+  ShowTextMore;
+end;
+
+procedure TFMain.Panel_TextMouseMove(Sender: TObject; Shift: TShiftState; X,
+  Y: Integer);
+begin
+  ShowTextMore;
+end;
+
 procedure TFMain.PopupToolbarPopup(Sender: TObject);
 begin
   MenuFileToolbar.Checked := Config.DefaultFileToolbarVisible;
@@ -1716,6 +1763,12 @@ begin
   TimerHidePenPreview.Enabled := false;
 end;
 
+procedure TFMain.TimerHideTextMoreTimer(Sender: TObject);
+begin
+  Panel_TextMore.Visible := False;
+  TimerHideTextMore.Enabled := false;
+end;
+
 procedure TFMain.ToolChangeDockingExecute(Sender: TObject);
 begin
   if Layout.ToolBoxDocking = twLeft then
@@ -1839,6 +1892,44 @@ begin
   end;
 end;
 
+procedure TFMain.Tool_TextBidiModeClick(Sender: TObject);
+var newMode: TFontBidiMode;
+begin
+  if initialized then
+  begin
+    newMode := fbmAuto;
+    if Tool_TextLTR.Down then newMode:= fbmLeftToRight;
+    if Tool_TextRTL.Down then newMode:= fbmRightToLeft;
+    if newMode <> ToolManager.TextBidiMode then
+    begin
+      FInTextAlign := true;
+      ToolManager.TextBidiMode := newMode;
+      FInTextAlign := false;
+      UpdateTextAlign;
+    end;
+  end;
+end;
+
+procedure TFMain.Tool_TextStyleClick(Sender: TObject);
+var newStyle: TFontStyles;
+begin
+  if initialized then
+  begin
+    newStyle := [];
+    if Tool_TextBold.Down then include(newStyle, fsBold);
+    if Tool_TextItalic.Down then include(newStyle, fsItalic);
+    if Tool_TextUnderline.Down then include(newStyle, fsUnderline);
+    if Tool_TextStrikeout.Down then include(newStyle, fsStrikeOut);
+    if newStyle <> ToolManager.TextFontStyle then
+    begin
+      FInTextFont := true;
+      ToolManager.TextFontStyle := newStyle;
+      FInTextFont := false;
+      UpdateEditPicture;
+    end;
+  end;
+end;
+
 procedure TFMain.Tool_TextPhongClick(Sender: TObject);
 begin
   if initialized then

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.ar.po

@@ -1935,11 +1935,27 @@ msgstr ""
 msgid "Align right"
 msgstr ""
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "اختيار الخط..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1950,11 +1966,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr "نص بتظليل فونغ"
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "ظل النص"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.bg.po

@@ -1922,11 +1922,27 @@ msgstr "Подравняване вляво"
 msgid "Align right"
 msgstr "Подравняване вдясно"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Избор на шрифт..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1937,11 +1953,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr ""
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "Сянка на текста"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.cs.po

@@ -1935,11 +1935,27 @@ msgstr "Zarovnat vlevo"
 msgid "Align right"
 msgstr "Zarovnat vpravo"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Vyberte písmo..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1950,11 +1966,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr "Phongové stínování textu"
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "Stín textu"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.de.po

@@ -1946,11 +1946,27 @@ msgstr "Links angleichen"
 msgid "Align right"
 msgstr "Rechts angleichen"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Schriftart auswählen..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1961,11 +1977,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr "Text Phong-Schattierung"
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "Textschatten"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.es.po

@@ -1939,11 +1939,27 @@ msgstr "Alinear a la izquierda"
 msgid "Align right"
 msgstr "Alinear a la derecha"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Elegir fuente..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1954,11 +1970,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr "Texto sombreado Phong"
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "Sombra de Texto"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.fi.po

@@ -1925,11 +1925,27 @@ msgstr ""
 msgid "Align right"
 msgstr ""
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Valitse kirjaisin..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1940,11 +1956,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr ""
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr ""
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.fr.po

@@ -1937,11 +1937,27 @@ msgstr "Aligner à gauche"
 msgid "Align right"
 msgstr "Aligner à droite"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr "Bidirectionnel"
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr "Gras"
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Choisir la police..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr "Italique"
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr "Gauche à droite"
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1952,11 +1968,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr "Texte avec ombrage Phong"
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr "Droite à gauche"
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "Ombre de texte"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr "Barré"
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr "Souligné"
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.it.po

@@ -1924,11 +1924,27 @@ msgstr "Allinea a sinistra"
 msgid "Align right"
 msgstr "Allinea a destra"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Scegli carattere"
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1939,11 +1955,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr ""
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "Testo ombrato"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.ja.po

@@ -1932,11 +1932,27 @@ msgstr ""
 msgid "Align right"
 msgstr ""
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "フォント選択..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1947,11 +1963,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr ""
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "テキストシャドゥ"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.kab.po

@@ -1937,11 +1937,27 @@ msgstr "Derrec s azelmaḍ"
 msgid "Align right"
 msgstr "Derrec s ayfus"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Fren tasefsit..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1952,11 +1968,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr "Aḍris s tili Phong"
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "Tili n uḍris"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.lv.po

@@ -1940,11 +1940,27 @@ msgstr "Līdzināt pa kreisi"
 msgid "Align right"
 msgstr "Līdzināt pa labi"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Izvēlies fontu ..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1955,11 +1971,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr "Telpiski burti"
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "Teksta ēna"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.nl.po

@@ -1958,11 +1958,27 @@ msgstr "Links uitlijnen"
 msgid "Align right"
 msgstr "Rechts uitlijnen"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Lettertype kiezen..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1973,11 +1989,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr "Tekst phong shading"
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "Tekstschaduw"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.pl.po

@@ -1946,11 +1946,27 @@ msgstr "Wyrównaj do lewej"
 msgid "Align right"
 msgstr "Wyrównaj do prawej"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Wybierz czcionkę..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1961,11 +1977,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr "Cień tekstu phong"
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "Cień tekstu"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.pot

@@ -1794,10 +1794,26 @@ msgstr ""
 msgid "Align right"
 msgstr ""
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgid "Choose font..."
 msgstr ""
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "tfmain.tool_textoutline.hint"
 msgid "Text outline"
@@ -1807,10 +1823,22 @@ msgstr ""
 msgid "Text phong shading"
 msgstr ""
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgid "Text shadow"
 msgstr ""
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "tfmain.viewcolors.caption"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.pt_BR.po

@@ -1933,11 +1933,27 @@ msgstr "Alinhar à esquerda"
 msgid "Align right"
 msgstr "Alinhar à direita"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Escolher tipo de letra..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1948,11 +1964,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr "Texto Phong de sombreamento"
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "Sombra do texto"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 36 - 9
lazpaint/release/bin/i18n/lazpaint.ru.po

@@ -237,14 +237,6 @@ msgctxt "tfcanvassize.label_width.caption"
 msgid "Width :"
 msgstr "Ширина:"
 
-#: uresourcestrings.rsaddtopalette
-msgid "Add color to palette"
-msgstr "Добавить цвет в палитру"
-
-#: uresourcestrings.rsremovefrompalette
-msgid "Remove color from palette"
-msgstr "Удилить цвет из палитры"
-
 #: tfchoosecolor.caption
 msgctxt "TFCHOOSECOLOR.CAPTION"
 msgid "Color"
@@ -1170,7 +1162,6 @@ msgid "Brush"
 msgstr "Кисть"
 
 #: tfmain.label_coordinates.caption
-#| msgid "99999x99999"
 msgid "9999x9999"
 msgstr "9999x9999"
 
@@ -1932,11 +1923,27 @@ msgstr "По левому краю"
 msgid "Align right"
 msgstr "По правому краю"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Выбрать шрифт..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1947,11 +1954,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr "Затенение текста по Фонгу"
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "Тень текста"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"
@@ -2737,6 +2756,10 @@ msgstr "Действие в процессе"
 msgid "Add files to the image processing list"
 msgstr "Добавить файлы в список обработки изображений"
 
+#: uresourcestrings.rsaddtopalette
+msgid "Add color to palette"
+msgstr "Добавить цвет в палитру"
+
 #: uresourcestrings.rsalignshape
 msgid "Align shape"
 msgstr "Выровнять фигуру"
@@ -3506,6 +3529,10 @@ msgstr "Растровое изображение было изменено. В
 msgid "Removable"
 msgstr "Съёмный"
 
+#: uresourcestrings.rsremovefrompalette
+msgid "Remove color from palette"
+msgstr "Удилить цвет из палитры"
+
 #: uresourcestrings.rsrender
 msgctxt "uresourcestrings.rsrender"
 msgid "Render"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.sv.po

@@ -1934,11 +1934,27 @@ msgstr "Justera till vänster"
 msgid "Align right"
 msgstr "Justera till höger"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "Välj typsnitt..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1949,11 +1965,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr "Phongskuggning för text"
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "Textskugga"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 28 - 0
lazpaint/release/bin/i18n/lazpaint.zh_CN.po

@@ -1934,11 +1934,27 @@ msgstr "向左对齐"
 msgid "Align right"
 msgstr "向右对齐"
 
+#: tfmain.tool_textbidirectional.hint
+msgid "Bidirectional"
+msgstr ""
+
+#: tfmain.tool_textbold.hint
+msgid "Bold"
+msgstr ""
+
 #: tfmain.tool_textfont.hint
 msgctxt "TFMAIN.TOOL_TEXTFONT.HINT"
 msgid "Choose font..."
 msgstr "选择字体..."
 
+#: tfmain.tool_textitalic.hint
+msgid "Italic"
+msgstr ""
+
+#: tfmain.tool_textltr.hint
+msgid "Left to right"
+msgstr ""
+
 #: tfmain.tool_textoutline.hint
 msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT"
 msgid "Text outline"
@@ -1949,11 +1965,23 @@ msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT"
 msgid "Text phong shading"
 msgstr "文本高光渲染"
 
+#: tfmain.tool_textrtl.hint
+msgid "Right to left"
+msgstr ""
+
 #: tfmain.tool_textshadow.hint
 msgctxt "TFMAIN.TOOL_TEXTSHADOW.HINT"
 msgid "Text shadow"
 msgstr "文本阴影"
 
+#: tfmain.tool_textstrikeout.hint
+msgid "Strikeout"
+msgstr ""
+
+#: tfmain.tool_textunderline.hint
+msgid "Underline"
+msgstr ""
+
 #: tfmain.viewcolors.caption
 msgctxt "TFMAIN.VIEWCOLORS.CAPTION"
 msgid "Colors"

+ 48 - 1
lazpaint/tools/utool.pas

@@ -221,6 +221,7 @@ type
     FTextFontSize: single;
     FTextFontStyle: TFontStyles;
     FTextAlign: TAlignment;
+    FTextBidiMode: TFontBidiMode;
     FTextOutline: boolean;
     FTextOutlineWidth: single;
     FTextPhong: boolean;
@@ -336,6 +337,7 @@ type
     function ScriptGetShapeRatio(AVars: TVariableSet): TScriptResult;
     function ScriptGetSplineStyle(AVars: TVariableSet): TScriptResult;
     function ScriptGetTextAlign(AVars: TVariableSet): TScriptResult;
+    function ScriptGetTextBidiMode(AVars: TVariableSet): TScriptResult;
     function ScriptGetTextOutline(AVars: TVariableSet): TScriptResult;
     function ScriptGetTextPhong(AVars: TVariableSet): TScriptResult;
     function ScriptGetTolerance(AVars: TVariableSet): TScriptResult;
@@ -397,6 +399,7 @@ type
     function ScriptSetShapeRatio(AVars: TVariableSet): TScriptResult;
     function ScriptSetSplineStyle(AVars: TVariableSet): TScriptResult;
     function ScriptSetTextAlign(AVars: TVariableSet): TScriptResult;
+    function ScriptSetTextBidiMode(AVars: TVariableSet): TScriptResult;
     function ScriptSetTextOutline(AVars: TVariableSet): TScriptResult;
     function ScriptSetTextPhong(AVars: TVariableSet): TScriptResult;
     function ScriptSetTolerance(AVars: TVariableSet): TScriptResult;
@@ -428,6 +431,8 @@ type
     procedure SetShapeRatio(AValue: Single);
     procedure SetSplineStyle(AValue: TSplineStyle);
     procedure SetTextAlign(AValue: TAlignment);
+    procedure SetTextBidiMode(AValue: TFontBidiMode);
+    procedure SetTextFontStyle(AValue: TFontStyles);
     procedure SetTextPhong(AValue: boolean);
     procedure SetTextShadow(AValue: boolean);
     procedure SetTextShadowBlurRadius(AValue: single);
@@ -551,8 +556,9 @@ type
     property BrushSpacing: integer read FBrushSpacing write SetBrushSpacing;
     property TextFontName: string read GetTextFontName;
     property TextFontSize: single read GetTextFontSize;
-    property TextFontStyle: TFontStyles read GetTextFontStyle;
+    property TextFontStyle: TFontStyles read GetTextFontStyle write SetTextFontStyle;
     property TextAlign: TAlignment read FTextAlign write SetTextAlign;
+    property TextBidiMode: TFontBidiMode read FTextBidiMode write SetTextBidiMode;
     property TextOutline: boolean read FTextOutline;
     property TextOutlineWidth: single read FTextOutlineWidth;
     property TextPhong: boolean read FTextPhong write SetTextPhong;
@@ -1507,6 +1513,22 @@ begin
   if Assigned(FOnTextAlignChanged) then FOnTextAlignChanged(self);
 end;
 
+procedure TToolManager.SetTextBidiMode(AValue: TFontBidiMode);
+begin
+  if FTextBidiMode=AValue then Exit;
+  FTextBidiMode:=AValue;
+  ToolUpdate;
+  if Assigned(FOnTextAlignChanged) then FOnTextAlignChanged(self);
+end;
+
+procedure TToolManager.SetTextFontStyle(AValue: TFontStyles);
+begin
+  if FTextFontStyle=AValue then Exit;
+  FTextFontStyle:=AValue;
+  ToolUpdate;
+  if Assigned(FOnTextFontChanged) then FOnTextFontChanged(self);
+end;
+
 procedure TToolManager.SetTextPhong(AValue: boolean);
 begin
   if FTextPhong=AValue then Exit;
@@ -2173,6 +2195,17 @@ begin
   result := srOk;
 end;
 
+function TToolManager.ScriptGetTextBidiMode(AVars: TVariableSet): TScriptResult;
+begin
+  case TextBidiMode of
+  fbmAuto: AVars.Strings['Result'] := 'BidiAuto';
+  fbmLeftToRight: AVars.Strings['Result'] := 'LeftToRight';
+  fbmRightToLeft: AVars.Strings['Result'] := 'RightToLeft';
+  else exit(srException);
+  end;
+  result := srOk;
+end;
+
 function TToolManager.ScriptGetTextOutline(AVars: TVariableSet): TScriptResult;
 begin
   if TextOutline then
@@ -2780,6 +2813,17 @@ begin
   result := srOk;
 end;
 
+function TToolManager.ScriptSetTextBidiMode(AVars: TVariableSet): TScriptResult;
+begin
+  case AVars.Strings['BidiMode'] of
+  'BidiAuto': TextBidiMode:= fbmAuto;
+  'LeftToRight': TextBidiMode:= fbmLeftToRight;
+  'RightToLeft': TextBidiMode:= fbmRightToLeft;
+  else exit(srInvalidParameters);
+  end;
+  result := srOk;
+end;
+
 function TToolManager.ScriptSetTextOutline(AVars: TVariableSet): TScriptResult;
 begin
   if AVars.IsDefined('Width') and (AVars.Floats['Width'] > 0) then
@@ -2881,6 +2925,7 @@ begin
   FTextFontName := TTextShape.DefaultFontName;
   FTextFontStyle:= [];
   FTextAlign := taLeftJustify;
+  FTextBidiMode := fbmAuto;
   FTextPhong := False;
   FTextShadowBlurRadius := 4;
   FTextShadowOffset := Point(5,5);
@@ -3292,6 +3337,8 @@ begin
   FScriptContext.RegisterScriptFunction('ToolGetFontStyle', @ScriptGetFontStyle, ARegister);
   FScriptContext.RegisterScriptFunction('ToolSetTextAlign', @ScriptSetTextAlign, ARegister);
   FScriptContext.RegisterScriptFunction('ToolGetTextAlign', @ScriptGetTextAlign, ARegister);
+  FScriptContext.RegisterScriptFunction('ToolSetTextBidiMode', @ScriptSetTextBidiMode, ARegister);
+  FScriptContext.RegisterScriptFunction('ToolGetTextBidiMode', @ScriptGetTextBidiMode, ARegister);
   FScriptContext.RegisterScriptFunction('ToolSetTextOutline', @ScriptSetTextOutline, ARegister);
   FScriptContext.RegisterScriptFunction('ToolGetTextOutline', @ScriptGetTextOutline, ARegister);
   FScriptContext.RegisterScriptFunction('ToolSetTextPhong', @ScriptSetTextPhong, ARegister);

+ 24 - 1
lazpaint/tools/utooltext.pas

@@ -20,6 +20,7 @@ type
     FPrevShadowOffset: TPoint;
     FPrevShadowRadius: single;
     function ShapeClass: TVectorShapeAny; override;
+    function CreateShape: TVectorShape; override;
     function AlwaysRasterizeShape: boolean; override;
     procedure IncludeShadowBounds(var ARect: TRect);
     function GetCustomShapeBounds(ADestBounds: TRect; AMatrix: TAffineMatrix; ADraft: boolean): TRect; override;
@@ -49,6 +50,13 @@ begin
   result := TTextShape;
 end;
 
+function TToolText.CreateShape: TVectorShape;
+begin
+  Result:=inherited CreateShape;
+  if result is TTextShape then
+    (result as TTextShape).FontBidiMode:= Manager.TextBidiMode
+end;
+
 function TToolText.AlwaysRasterizeShape: boolean;
 begin
   Result:= Manager.TextShadow;
@@ -138,7 +146,11 @@ end;
 procedure TToolText.ShapeEditingChange(ASender: TObject);
 begin
   with (FShape as TTextShape) do
+  begin
+    Manager.TextFontStyle := FontStyle;
+    Manager.TextBidiMode := FontBidiMode;
     Manager.TextAlign := ParagraphAlignment;
+  end;
   inherited ShapeEditingChange(ASender);
 end;
 
@@ -159,7 +171,13 @@ begin
     Aliased := Manager.ShapeOptionAliasing;
     LightPosition := AMatrix*Manager.LightPosition;
     AltitudePercent:= Manager.PhongShapeAltitude;
-    ParagraphAlignment:= Manager.TextAlign;
+    if FontBidiMode <> Manager.TextBidiMode then
+    begin
+      FontBidiMode:= Manager.TextBidiMode;
+      Manager.TextAlign := ParagraphAlignment; // alignment depend on bidi mode
+    end
+    else
+      ParagraphAlignment:= Manager.TextAlign;
     PenPhong := Manager.TextPhong;
   end;
   if (Manager.TextShadow <> FPrevShadow) or
@@ -199,7 +217,10 @@ function TToolText.DoToolKeyDown(var key: Word): TRect;
 var
   keyUtf8: TUTF8Char;
   handled: Boolean;
+  alignBefore: TAlignment;
 begin
+  if FShape is TTextShape then
+    alignBefore := (FShape as TTextShape).ParagraphAlignment;
   if Key = VK_SPACE then
   begin
     keyUtf8:= ' ';
@@ -222,6 +243,8 @@ begin
     Key := 0;
   end else
     Result:=inherited DoToolKeyDown(key);
+  if (FShape is TTextShape) and (alignBefore <> (FShape as TTextShape).ParagraphAlignment) then
+    Manager.TextAlign := (FShape as TTextShape).ParagraphAlignment;
 end;
 
 function TToolText.ToolCommand(ACommand: TToolCommand): boolean;

+ 10 - 0
resources/scripts/lazpaint/tools.py

@@ -67,6 +67,10 @@ ALIGN_LEFT = 'Left'
 ALIGN_CENTER = 'Center'
 ALIGN_RIGHT = 'Right'
 
+BIDI_AUTO = 'BidiAuto'
+BIDI_LEFT_TO_RIGHT = 'LeftToRight'
+BIDI_RIGHT_TO_LEFT = 'RightToLeft'
+
 SHAPE_OPTION_DRAW_SHAPE = 'DrawShape'
 SHAPE_OPTION_FILL_SHAPE = 'FillShape'
 SHAPE_OPTION_CLOSE_SHAPE = 'CloseShape'
@@ -345,6 +349,12 @@ def set_text_align(align):
 def get_text_align():
   return command.send('ToolGetTextAlign?')
 
+def set_text_bidi_mode(bidi_mode):
+  command.send('ToolSetTextBidiMode', BidiMode=bidi_mode)
+
+def get_text_bidi_mode():
+  return command.send('ToolGetTextBidiMode?')
+
 def set_text_outline(width: float):
   command.send('ToolSetTextOutline', Width=width)
 

+ 8 - 0
resources/vector/textbold32.svg

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="32" xmlns="http://www.w3.org/2000/svg" height="32" viewBox="0 0 32 32" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+  <g opacity="1" xmlns:bgra="https://wiki.freepascal.org/LazPaint_SVG_format" inkscape:label="Layer1" inkscape:groupmode="layer" bgra:originalViewBox="0 0 29 28">
+    <path d="M28.84375 6.59375 0.09375 0.03125" fill="black" stroke="none" fill-opacity="1"/>
+    <path d="M9 28 9 3 15 3 15 28 z" fill="black" stroke="none" fill-opacity="0.7921569"/>
+    <path d="M15 28 18.88461 27.94471 Q22.76923 27.88942 24.86298 25.60817 26.95673 23.32692 26.97836 20.16346 27 17 25.75 15.25 24.5 13.5 22.25 12.75 20 12 17.5 12 L15 12 15 16 17 16 Q19 16 20.5 17 22 18 21.82211 20.03846 21.64423 22.07692 20.26923 22.98317 18.89423 23.88942 16.94711 23.94471 L15 24 z" fill="black" stroke="none" fill-opacity="0.7921569"/>
+  </g>
+</svg>

+ 9 - 0
resources/vector/textdirectionany32.svg

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="32" xmlns="http://www.w3.org/2000/svg" height="32" viewBox="0 0 32 32" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+  <g opacity="1" xmlns:bgra="https://wiki.freepascal.org/LazPaint_SVG_format" inkscape:label="Layer1" inkscape:groupmode="layer" bgra:originalViewBox="-15 0 62 29">
+    <path d="M3.5 22 10 15.5 10 20 22 20 22 15.5 28.5 22 22 28.5 22 24 10 24 10 28.5 z" fill="black" stroke="none" fill-opacity="0.7921569"/>
+    <text x="0" y="0" fill="black" stroke="none" font-size="15" font-style="normal" font-family="FreeSans" font-weight="normal" fill-opacity="0.9686275" text-decoration="">
+      <tspan x="11.828" y="14" direction="ltr" textLength="8.344001">?</tspan>
+    </text>
+  </g>
+</svg>

+ 9 - 0
resources/vector/textdirectionltr32.svg

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="32" xmlns="http://www.w3.org/2000/svg" height="32" viewBox="0 0 32 32" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+  <g opacity="1" xmlns:bgra="https://wiki.freepascal.org/LazPaint_SVG_format" inkscape:label="Layer1" inkscape:groupmode="layer" bgra:originalViewBox="-10 -1 56 30">
+    <path d="M4 20 22 20 22 15.5 28.5 22 22 28.5 22 24 4 24 z" fill="black" stroke="none" fill-opacity="0.7921569"/>
+    <text x="4" y="-1" fill="black" stroke="none" font-size="14" font-style="normal" font-family="FreeSans" font-weight="normal" fill-opacity="0.9686275" text-decoration="">
+      <tspan x="4" y="12" direction="ltr" textLength="23.15413">αβγ</tspan>
+    </text>
+  </g>
+</svg>

+ 9 - 0
resources/vector/textdirectionrtl32.svg

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="32" xmlns="http://www.w3.org/2000/svg" height="32" viewBox="0 0 32 32" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+  <g opacity="1" xmlns:bgra="https://wiki.freepascal.org/LazPaint_SVG_format" inkscape:label="Layer1" inkscape:groupmode="layer" bgra:originalViewBox="-15 0 59 29">
+    <path d="M3.5 22 10 15.5 10 20 28 20 28 24 10 24 10 28.5 z" fill="black" stroke="none" fill-opacity="0.7921569"/>
+    <text x="0" y="0" fill="black" stroke="none" font-size="15" font-style="normal" font-family="FreeSans" font-weight="normal" fill-opacity="0.9686275" text-decoration="">
+      <tspan x="29" y="14" direction="rtl" textLength="22.568">אבג</tspan>
+    </text>
+  </g>
+</svg>

+ 9 - 0
resources/vector/textitalic32.svg

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="32" xmlns="http://www.w3.org/2000/svg" height="32" viewBox="0 0 32 32" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+  <g opacity="1" xmlns:bgra="https://wiki.freepascal.org/LazPaint_SVG_format" inkscape:label="Layer1" inkscape:groupmode="layer" bgra:originalViewBox="0 0 29 28">
+    <path d="M28.84375 6.59375 0.09375 0.03125" fill="black" stroke="none" fill-opacity="1"/>
+    <path d="M11 28 16.5 13 20.5 13 15 28 z" fill="black" stroke="none" fill-opacity="0.7921569"/>
+    <path d="M18 10 19 6 23 6 21.71875 10.09375 z" fill="black" stroke="none" fill-opacity="0.7921569"/>
+    <path d="M24.40625 14.34375 1.09375 0.03125 z" fill="black" stroke="none" fill-opacity="0.7921569"/>
+  </g>
+</svg>

+ 7 - 0
resources/vector/textstrikeout32.svg

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="32" xmlns="http://www.w3.org/2000/svg" height="32" viewBox="0 0 32 32" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+  <g opacity="1" xmlns:bgra="https://wiki.freepascal.org/LazPaint_SVG_format" inkscape:label="Layer1" inkscape:groupmode="layer" bgra:originalViewBox="5 9 22 19">
+    <path d="M5.5 20 5.5 16 26.5 16 26.5 20 z" fill="black" stroke="none" fill-opacity="0.7921569"/>
+    <path d="M12.75251 22.04217 13.09534 23.19122 Q13.43817 24.34027 14.87291 24.68846 16.30765 25.03665 17.72187 25.00318 19.13608 24.96971 19.62222 24.21841 20.10835 23.46711 19.84319 22.09709 19.57802 20.72707 17.63348 20.15254 15.68893 19.57802 13.656 19.04769 11.62307 18.51736 10.6508 17.58928 9.678525 16.6612 9.715137 15.01844 9.751749 13.37567 10.37491 12.35699 10.99807 11.3383 12.40692 10.6495 13.81577 9.960694 16.07282 9.905777 18.32986 9.85086 19.50702 10.39635 20.68418 10.94185 21.48281 11.75473 22.28145 12.56761 22.42475 13.25641 L22.56806 13.94522 19.36463 14.05505 18.8343 13.45242 Q18.30397 12.84978 16.6969 12.91006 15.08982 12.97034 14.06355 13.59442 13.03728 14.2185 12.9489 14.86533 12.86051 15.51216 15.55635 16.39604 18.25219 17.27992 19.53383 17.72186 20.81546 18.16381 21.74354 18.91511 22.67161 19.66641 22.89258 21.12482 23.11356 22.58323 22.76 23.90905 22.40645 25.23488 20.58506 26.62634 18.76368 28.01781 16.35797 27.99636 13.95226 27.97491 12.90324 27.45439 11.85423 26.93386 10.85476 26.08437 9.855302 25.23488 9.720498 23.62022 L9.585694 22.00556 z" fill="black" stroke="none" fill-opacity="0.7921569"/>
+  </g>
+</svg>

+ 9 - 0
resources/vector/textunderline32.svg

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="32" xmlns="http://www.w3.org/2000/svg" height="32" viewBox="0 0 32 32" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+  <g opacity="1" xmlns:bgra="https://wiki.freepascal.org/LazPaint_SVG_format" inkscape:label="Layer1" inkscape:groupmode="layer" bgra:originalViewBox="-31 -5 94 35">
+    <text x="0" y="-5" fill="black" stroke="none" font-size="31" font-style="normal" font-family="FreeSans" font-weight="normal" fill-opacity="0.7921569" text-decoration="">
+      <tspan x="7.377867" y="23" direction="ltr" textLength="17.24427">u</tspan>
+    </text>
+    <path d="M6.5 30 6.5 26 25.5 26 25.5 30 z" fill="black" stroke="none" fill-opacity="0.7921569"/>
+  </g>
+</svg>