Jump to content

vinni

Members
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. vinni

    TTextLayout for Linux

    This is how it looks on Win 11 and Ubuntu 22.04: Are there any solutions to make the same behavior for Linux? The code: unit Unit1; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls, FMX.TextLayout, System.Generics.Collections, System.Character, FMX.Objects; type TMyLabel = class(TLabel) end; type TTextAccess = class(TText); type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); private FLabel: TMyLabel; public { Public declarations } end; var Form1: TForm1; implementation {$R *.fmx} procedure TForm1.FormCreate(Sender: TObject); procedure AddAttr(ALayout: TTextLayout; const AStart, ALength: Integer; const AColor: TAlphaColor; const AFontStyle: TFontStyles = []); var TR: TTextRange; TA: TTextAttribute; begin TR := TTextRange.Create(AStart, ALength); ALayout.Font.Style := AFontStyle; TA := TTextAttribute.Create(ALayout.Font, AColor); ALayout.AddAttribute(TR, TA); end; var Layout: TTextLayout; begin FLabel := TMyLabel.Create(Self); FLabel.Parent := Self; FLabel.Text := 'Red Green Blue'; Layout := TTextAccess(FLabel.TextObject).Layout; AddAttr(Layout, 0, 3, TAlphaColors.Red); AddAttr(Layout, 4, 5, TAlphaColors.Green); AddAttr(Layout, 10, 4, TAlphaColors.Blue); end; procedure TForm1.FormDestroy(Sender: TObject); begin FLabel.Free; end; end.
  2. vinni

    TTextLayout for Linux

    Hey folks, I'm using Delphi 11.3, and it looks like TTextLayout is completely unsupported for Linux. Are there any solutions? Delphi 12.x? FMXLinux? Anything else? Thank you!
  3. vinni

    TWebBrowser + dynamic JS question

    Yes, but setting WebBrowser1.WindowsEngine to TWindowsEngine.EdgeOnly raises an exception: --------------------------- Application Error --------------------------- Exception EBrowserEngineException in module Project1.exe at 0042A2AD. Edge browser engine is unavailable. --------------------------- OK --------------------------- Edge installed, Delphi 11.3.
  4. vinni

    TWebBrowser + dynamic JS question

    Dave, thanks for your suggestion. I gave it a try, but on my side AJavaScriptResult is always 'null' for any website.
  5. vinni

    TWebBrowser + dynamic JS question

    Hello, Is there a similar solution for FireMonkey? FMX.WebBrowser.TWebBrowser does not have Document property.
×