Arabic text, problem on Linux lazarus / 21-General ---------------------------------------------------------------------- marius.maximus · 2024-04-16 08:04 On Linux I have wrong arabic text picture: https://i.imgur.com/Yb4lXsw.png Correct version (from Windows) picture: https://i.imgur.com/NlgJGMj.png I have correct font And font has correct chars, but Lazarus app on Linux uses only main form of char for example char `seen-arab` has 4 forms: seen-arab seen-arab.fina seen-arab.init seen-arab.medi https://i.imgur.com/1jtNnRQ.png but my app use only `seen-arab` ---------------------------------------------------------------------- AlexTP · 2024-04-16 08:25 Post the code snippet which renders the text. It can be different functions: TCanvas.TextOut, DrawText, ExtTextOut etc. ---------------------------------------------------------------------- Thaddy · 2024-04-16 08:33 I suspect it is merely a font issue. ---------------------------------------------------------------------- marius.maximus · 2024-04-16 08:50 I take font from this web page https://arbfonts.com/the-sans- plain-3-font-download.html?preview=%D8%B3%D8%B7%D9%88%D8%B9+1 I am 100% sure this font is used on my Linux after delete .ttf I have squares instead of letters I open this font in online editor, in my opinion is OK I use this font in Qt application on Windows and is OK In Arabic, the appearance of a letter depends on its position , the character at the beginning, middle and end of the word looks different. In my APP on Linux the Arabic  letter is always the same regardless of position ---------------------------------------------------------------------- wp · 2024-04-16 09:11 How is that text drawn? Is it the Caption of a TLabel or TStaticText? Or is it drawn by Canvas.TextOut/.TextRect? In the latter case, is the text drawn as one string, or character by character? ---------------------------------------------------------------------- Martin_fr · 2024-04-16 10:17 I guess that happens in SynEdit. SynEdit uses the "lpDx" width feature EtxTextOut  https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi- exttextouta On Linux that is emulated (IIRC) by the LCL WS code, which prints the code one char at a time. => which does not work for script languages. However, without this, many fonts wont be correctly monospaced (at least in my testing, long ago). And that would mean, if you start selecting, and extend the selection letter by letter, then the text on the line starts jumping around... (at least latin based text would...) To test components\synedit\syntextdrawer.pp Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TheTextDrawer.NewTextOut(X, Y: Integer; fuOptions: UINT;  const ARect: TRect; Text: PChar; ALength: Integer; AnEto: TEtoBuffer);var  EtoArray: PInteger;  {$IFDEF WINDOWS_LIGATURE}  W: WideString;  Glyphs: array of WideChar;  CharPlaceInfo: GCP_RESULTSW;  {$ENDIF}begin  if AnEto <> nil then    EtoArray := AnEto.Eto  else    EtoArray := nil;  Remove the if condition and just keep "EtoArray := nil;" ---------------------------------------------------------------------- Martin_fr · 2024-04-16 10:23 I just checked, and SynEdit only does that if you - have extra char spacing in the options (which means spaces must be printed between chars....) - SynEdit detected that there are chars with different width (even in a monospaced font). For testing, put this in the editor (after making the change from my last post) Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i MW@XmTi:'Q-MW@XmTi:'Q-Then set the cursor at the start of line, and select the text, one char at a time. ---------------------------------------------------------------------- marius.maximus · 2024-04-16 10:59 Quote from: wp on April 16, 2024, 11:11:54 amHow is that text drawn? Is it the Caption of a TLabel or TStaticText? Or is it drawn by Canvas.TextOut/.TextRect? In the latter case, is the text drawn as one string, or character by character? It is Caption in TLabel ---------------------------------------------------------------------- Zaher · 2024-04-17 10:34 I Tested it "Lazarus 3.99 (rev main_3_99-983-gf3b042ed9d) FPC 3.3.1 x86_64-linux-gtk2" It is work fine with default font ---------------------------------------------------------------------- nouzi · 2024-04-18 15:21 see ---------------------------------------------------------------------- Zaher · 2024-04-20 01:29 His problem with all characters, but he didn't mentioned which version and which GUI platform used.