Embarcadero provided syntax highlighting in the FireDAC SQL editor with the current Delphi 11.2 version. I am using Delphi 11.2 Professional on an HP Spectre x360 with a 4K display. The font size in the editor is tiny, and I can't find anything in the Options settings to change it. Can the font size for this editor be changed, and if it can, where can I find the setting?
Related
Just for test how hard to convert my Delphi 7 program to Delphi XE 5 i wrote simple application on Delphi 7 - placed TStringGrid on Form, and added code on form create:
procedure TFMain.FormCreate(Sender: TObject);
begin
With StringGrid1 do
begin
Cells[0,0]:='čęжэ€';
end;
end;
(actually it wrote as Cells[0,0]:='ce??€', but i expected that). Compile, build, run, no Unicode, of cause. Then reopened project in Delphi XE 5, changed line again to Cells[0,0]:='čęжэ€', compile, build, run - and no Unicode (got something like čę|||) ! That was strange to me. New project build from zero on Delphi Xe 5 with the same code, same TStringGrid is working as expected. I know here is some simple trick, maybe some change in project settings, but i can't google it... Maybe someone can help ?
Best regards.
The default font used by Delphi 7 is MS Sans Serif. When you use this font under Unicode Delphi, the string grid control appears not to draw text correctly with that font. Many other controls will draw your text correctly in that font. But for some reason the string grid control cannot manage to do so.
When you upgrade an old project to XE5 you inherit that Delphi 7 default. When you create a new project in XE5 the default font is different, Tahoma I think, and the string grid painting correctly shows your Cyrillic in that font.
You can work around this problem by using a different font like Tahoma or Segoe UI. You surely don't want to be using MS Sans Serif anyway. A list view in report view style would be another good option. Not least because it is the native platform control.
I must admit that I do not really understand why the string grid control is not behaving better. It would be great if somebody else could shed some light on this.
As David mentions, the issue is the font used in your string grid. However, it is not strictly accurate to say that the default font in Delphi is MS Sans Serif. It used to be MS Sans Serif but was changed (in Delphi 2006) to Tahoma.
You can see how a particular version of Delphi chooses the default font by inspecting the source of the Graphics unit in the RTL source of that particular Delphi version (since the IDE is built using that code). Specifically the InitDefFontData procedure (and, in older versions of Delphi, the DefFontData record).
As of (at least) Delphi XE4 the default Tahoma font will be replaced by any setting for a font substitution for a value identified as MS Shell Dlg 2, as set in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes\
NB - from inspecting the code in XE4 it is possible that if this key does not exist or cannot be accessed, or if there is no substitution entry for MS Shell Dlg 2 font, then MS Sans Serif will still be used. It is hard to tell since this is the behaviour when "CLR" is defined, which should not be the case any more since Delphi no longer supports .NET and the IDE is presumably not compiled with CLR defined, but there is no way to be certain simply from inspecting the code what conditional defines might be applied when the IDE is compiled.
However, whichever font the IDE is using and however it is choosing that font, this affects only new forms created in the IDE.
For existing forms, as in this case, the issue is not with TStringGrid as such but rather the fact that you created the project in a version of Delphi which applied a default font which did/does not support Unicode.
The act of opening the project in the newer version of Delphi did not change the font used in your form(s), so the form saved in Delphi 7 using the MS Sans Serif font is still using that font when opened in Delphi XE5.
The TStringGrid control is then using the MS Sans Serif font because this is the font set on the form, and the default for controls on a form is to use their parent control font.
i.e. This specific instance of TStringGrid is using MS Sans Serif because the form on which it is placed is (still) using MS Sans Serif.
In such cases you should change the form font to Tahoma or a. n. other suitable, Unicode enabled font.
All controls on the form still set to use their parent control's font will then adopt this font also. When performing this on an actual application you may find some controls with ParentFont set FALSE which will need to be addressed individually and that even where font settings are being "inherited" your form designs may need further work to tidy things up due to changes in appearance resulting from the change of font.
Note that even this change to Tahoma has been overtaken by changes in Windows itself, and if you wish to apply some other default font (in new forms/projects) you may find useful information here.
I'm using C++ Builder 2010 and for some odd reason today when I opened my project all the non english font(aka korean font) turned into a box and when I try to retype them it still comes out as a box. I was wonder if anyone knows how to fix this
The box indicates that the text encoding is understood, but the font has no glyph for this particular character. You need a font that has support for the characters that you use.
The font used in the IDE's editor windows is specified in your preferences under: Tools > Options > Editor Options > Display.
You need to choose a font that supports the language in your code. It sounds like you did that once but somehow the setting has got lost, or perhaps the installed font has been modified.
Am developing a Delphi firemonkey desktop application with XE5.
I use Unicode characters to localize the application (Asian language call Sinhala).
Everything is perfect with windows 7 (We haven't tested it with Vista). But when we test it with windows XP, it display every character as a box (except in title bar).
What is the problem? Is delphi firemonkey support unicode in XP?
Is there any way to get it display correctly on XP?
(This happens only with firemonkey, everything is OK with VCL. Since am going to make it support for MAC, I have to use firemonkey.)
AFAIK FireMonkey does not implement the so-called Font fall-back mechanism. It does not use the Uniscribe API.
I suspect the font you are using (e.g. Tahoma) does not contain the needed characters in XP - whereas the TTF file included with Seven/Vista does contain them. So FireMonkey is not able to display the text as expected in XP.
Change the font to one having all needed glyphs. You may have "Arial Unicode MS" available, even on XP, if you have MSOffice installed.
By default, the VCL renderer uses the ExtTextOut GDI API which does implement font fall-back, so it automagically searches the installed fonts for the missing glyphs.
To properly use/display Unicode the OS has to support unicode strings and you have to have fonts installed that can display the Unicode characters. Since their are 65000+ characters not all font manufacturers include every Unicode character.
I think the FireMonkey app uses a font that does not contain Sinhala characters. Play with the font used by the app.
If you need a Sinhala font, the wonderful Alan Wood’s Unicode Resources has a section Large, multi-script Unicode fonts for Windows computers. The South Asian font page names several fonts you can try.
Alternatively, Googing "sinhala unicode font" will also give you plenty of suggestions.
I have checked all these suggestions - but there is no useful turnout of my problem. I have found out the following facts.
Changing the font to Arial MS Unicode or replacing Tahoma with a TTF file from Windows 7 doesn’t work.
Changing the font to “Iskole Pota”, a font which support Sinhala Unicode symbols , solved the problem for TEdit component.
All the components which are descendents of TTextControl don’t work with “Iskole Potha” solution.
I have further noticed that changing the font to something like “Wingdings” for TTextControl descendants don’t show appropriate symbols either. They still show English.
Does anybody knows a way to change the font size of the editor tabs in Delphi 2010 IDE?
With my 1080p 22' monitor the font is too small to read and it causes pain in the eyes.
Some notes
It doesn't respect the system's DPI settings so changing that system setting doesn't help, moreover, I'm using 140% DPI already now, and it's Win7.
I couldn't find any existing 3rd party tools to tweak that.
I'll be willing to write an IDE expert to fix that problem if I know how to do it...
There is not an option to change the font size of these elements, but as you say this can be done writting an expert. Some time ago I started to write an Delphi IDE Expert (This project is not finished yet) which allow you to change the apparence of the Delphi IDE (here you can found the Source Code) , try using some of the code of this project to write your own. Check this image which shows the result of modify the code of the project to increase the font of the TIDEGradientTabSet.
I can change the editor font in RAD Studio 2009 under the [Tools][Options] Editor Options/Display settings form, but the list of fonts is very limited and does not show all the installed fonts. Is there any way to add fonts to the selection ?
There is a work around by setting the font name in the registry, under [HKEY_CURRENT_USER\Software\CodeGear\BDS\6.0\Editor\Options].
You can only select fixed width fonts, so yes it is limited. A good resource for some fonts to try is available at Hivelogic.
Fonts are fixed width.
I have good experience with these fonts:
Courier New (default)
Consolas
Lucida Console
The last two are also great alternatives for Console fonts.
--jeroen