amit 3 Posted January 19, 2021 (edited) Delphi IDE editor is used for a long time but it will not support well in my Language. I need to know if it will have any chance to improve the IDE Editor to support more fonts. As you can see in the attach picture compare between VS Editor and Delphi IDE Editor. Is there any trick to make delphi IDE work with other fonts than it provided? Edited January 19, 2021 by amit Share this post Link to post
Guest Posted January 19, 2021 Editor font Select a font type from the available screen fonts installed on your system (shown in the list). The Code Editor displays and uses only monospaced screen fonts, such as Courier. Sample text is displayed in the Sample box. For this answer, only Embarcadero can say it! Fonts are fixed width, like: Courier New (default) Consolas Lucida Console if your language is Thai, try this site for download some fonts to install in MSWindows and try it! https://www.fonts.com/search/all-fonts?searchtext=thai&submit=Search https://www.myfonts.com/search/thai Share this post Link to post
amit 3 Posted January 19, 2021 I downloaded monotype fonts and install them in windows however I never see those fonts in the selection list of the Editor Fonts. Share this post Link to post
Lars Fosdal 1792 Posted January 19, 2021 Does any of these work? https://catalog.monotype.com/language/thai Share this post Link to post
amit 3 Posted January 19, 2021 (edited) Any Monotype fonts install in Windows will not be existed in the Selection list of the Editor in Delphi. It shown only the Original list of Delphi provided. By the way, monotype font should not be the final solution to solve this problem because it still display incorrectly. If Delphi change the Editor to use the non monotype font it should be display correctly as shown in the VS Code Editor. I wish Embarcadero will change change it soon. Edited January 19, 2021 by amit Share this post Link to post
Lars Fosdal 1792 Posted January 20, 2021 Most of these fonts presented in the Options | UI | Editor | Display list of my Delphi, are not installed with Delphi, nor are they installed with Windows. Their common trait is that they are monospaced - which also is the default for VS Code, btw. Searching for monospaced and Thai, this shows up - and it is monospaced, has Thai characters, but doesn't appear to support Unicode Thai - so I am unsure if it will work as desired. https://www.dafont.com/pw-thai-monospaced-.font Edit 1: I also found https://bwaiwai.blogspot.com/2013/06/DejaVuSansMonoThai.html - but couldn't find a free download to check its Unicode coverage. Edit 2: The last comment on this page, suggests some other alternatives as well. https://forum.portswigger.net/thread/thai-characters-not-displayed-correctly-in-the-burp-suite-f39cb4ff My list of Delphi available fonts. Share this post Link to post
Guest Posted January 20, 2021 (edited) if dont exist "free or payed", then create it: https://fontforge.org/en-US/ DejaVu Sans Mono Thai https://en.m.fontke.com/font/10351322/ License type: Free The way of authorization is for reference only. Please contact the copyright party to purchase commercial authorization. BUT DONT APPEARS ON DELPHI EDITOR!!! Edited January 20, 2021 by Guest Share this post Link to post
amit 3 Posted January 24, 2021 Thank you all for trying to help. I finally found that the monotype or monospace font that use in Delphi editor is not suitable for displaying Thai Language. Even it can display Thai but it display incorrectly. Delphi Editor should be upgrade to make it capable to use non monotype or monospace font. You can see the picture that how it display Thai incorrectly compare to the correct one. I hope one day Embarcadero will make a better editor to display Thai language correctly soon. Share this post Link to post
Lars Fosdal 1792 Posted January 25, 2021 On 1/24/2021 at 6:07 AM, amit said: I finally found that the monotype or monospace font that use in Delphi editor is not suitable for displaying Thai Language. Even it can display Thai but it display incorrectly. For future reference: Which font was it and where did you find it? Edit: An idea for a future enhancement of development IDEs would be support for custom fonts (that not necessarily are monospaced) for string constants in the source code. I won't be holding my breath for that to arrive, though - since it opens a hornet's nest of questions such as "Why does the cursor jump many characters to the right when I navigate up or down from this string constant?" 1 Share this post Link to post
Lars Fosdal 1792 Posted January 25, 2021 Another solution to the font predicament is to use a translation tool for the actual text to be displayed, keeping the string constant in the code in English. In translation tools, you are usually not bound to monospaced fonts. This would also allow programmers not fluent in Thai to understand the text, and it would make the application ready for translation to a multitude of languages. Share this post Link to post
TiGü 21 Posted January 26, 2021 Please stop to wonder about the font(s). It does not matter! The problem is the text rendering itself in the editor of the Delphi IDE. In the screenshot you can see a few examples in the Delphi IDE and in Visual Studio Code. In both cases, the font is the famous Consolas from Microsoft (https://en.wikipedia.org/wiki/Consolas). Most european languages like German, Swedish or Hungarian are well rendered. Even Greek is displayed nice. But all others looks like a pile of shit. Arabic is broken, Thai has to much space between the symbols. The same problem occours in Khmer and Sinhala (mispelled as Shinghal in the source code). Chinese look okay, but not perfect. Conclusion: The Delphi IDE Editor is designed for European character sets only. 1 Share this post Link to post
Lars Fosdal 1792 Posted January 26, 2021 @TiGü The IDE editor supports Unicode, but most fonts do not have every Unicode character for every language defined, hence which font is being used, really matters. The editor is definitively left to right, and made for monospaced fonts, which does not work well with national character sets that uses ligatures and variable kerning. VS Code is many years younger than the Delphi Editor, which started supporting Unicode source in Delphi 2009 - so yes, it could use modernization. Your example is definitively a good one - and should be reported as an issue in https://quality.embarcadero.com/ If you do, make sure you attach the original .pas file as well as the screen shots. Share this post Link to post
Lajos Juhász 293 Posted January 26, 2021 1 hour ago, Lars Fosdal said: The IDE editor supports Unicode, but most fonts do not have every Unicode character for every language defined, hence which font is being used, really matters. Are you sure about that? Pleas try to paste this to the IDE (example from: https://en.wikipedia.org/wiki/Precomposed_character) Åström (U+0041 U+030A U+0073 U+0074 U+0072 U+006F U+0308 U+006D) The result is: It doesn't render it well. If you assign this string to a label.caption then Windows will display it correctly: Even if I paste the code from Delphi here the forum can display it correctly. procedure TForm4.FormCreate(Sender: TObject); begin label1.Caption:='Åström (U+0041 U+030A U+0073 U+0074 U+0072 U+006F U+0308 U+006D)'; end; Share this post Link to post
TiGü 21 Posted January 26, 2021 1 hour ago, Lars Fosdal said: The IDE editor supports Unicode, but most fonts do not have every Unicode character for every language defined, In my example screenshot the font is the same for both editors. Share this post Link to post
Lars Fosdal 1792 Posted January 26, 2021 34 minutes ago, Lajos Juhász said: Åström (U+0041 U+030A U+0073 U+0074 U+0072 U+006F U+0308 U+006D) Or, Åström (U+00C5 U+0073 U+0074 U+0072 U+00F6 U+006D) which is using the correct Unicode chars, i.e. not built from composites - which we know is not handled for monospaced fonts in the IDE. Share this post Link to post
Lars Fosdal 1792 Posted January 26, 2021 45 minutes ago, TiGü said: In my example screenshot the font is the same for both editors. Yes. Same Consolas font in two different editors. The new VS Code, and the old IDE. I get it. I wonder - do you and I actually have the same Consolas font file? Mine has Greek and Cyrillic, but not Thai and Arabic. Edit: Original spec doesn't seem to include these either: https://docs.microsoft.com/en-us/typography/font-list/consolas Could you attach that .pas file, please - so that I can see how it looks in my IDE? Share this post Link to post
Lajos Juhász 293 Posted January 26, 2021 Now I understand Unicode for now is only the subset of the Unicode that the Delphi IDE can display correctly and that's not the definition of a Unicode editor. The editor in the IDE can display only the subset of a Unicode. Share this post Link to post
TiGü 21 Posted January 26, 2021 1 hour ago, Lars Fosdal said: Could you attach that .pas file, please - so that I can see how it looks in my IDE? Project1.dpr Share this post Link to post
Jacek Laskowski 57 Posted January 26, 2021 See my discovery in other thread about rendering fonts... Share this post Link to post
Lars Fosdal 1792 Posted January 27, 2021 @TiGü I do get Thai, Arabic, Chinese - even when using a font that does not have such characters in it. The reason seems to be that there is trickery going on under the hood for glyph substitution. https://docs.microsoft.com/en-us/globalization/input/font-technology It does look good and behave well in VS Code - and it does look like shit in the Delphi IDE. In VS Code - even navigation with right arrow goes right to left within the Arabic parts of the text. Did you create a report in Quality Central? Share this post Link to post
Fr0sT.Brutal 900 Posted January 27, 2021 20 hours ago, Lars Fosdal said: VS Code is many years younger than the Delphi Editor, which started supporting Unicode source in Delphi 2009 - so yes, it could use modernization. Side note: VS Code is Chromium in fact Share this post Link to post
TiGü 21 Posted January 29, 2021 On 27.1.2021 at 8:07 AM, Lars Fosdal said: Did you create a report in Quality Central? No, you or someone else can do. Feel free. I'm not affected by this behavior (as a german). Share this post Link to post
amit 3 Posted February 5, 2021 (edited) On 1/30/2021 at 1:21 AM, TiGü said: No, you or someone else can do. Feel free. I'm not affected by this behavior (as a german). I had created the report in Quality Central already ( RSP-32335 ). I also attached your Project1.dpr with the report. Edited February 5, 2021 by amit 1 2 Share this post Link to post
Brandon Staggs 278 Posted January 27, 2022 (edited) The problem is that the Delphi editor does not correctly handle Unicode diacritics. The editor expects to show one character right next to the previous, and ignores the fact that there are whole Unicode blocks that require the glyph to be positioned in a specific way over the previous character. The IDE editor just doesn't do it. https://en.wikipedia.org/wiki/Combining_character Edited January 27, 2022 by Brandon Staggs Share this post Link to post
Lajos Juhász 293 Posted January 27, 2022 Even some Unicode arrow characters are not supported by the IDE :(. Share this post Link to post