View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0019934||Lazarus||IDE||public||2011-08-08 17:58||2018-07-17 00:04|
|Reporter||cobines||Assigned To||Juha Manninen|
|Product Version||0.9.31 (SVN)|
|Summary||0019934: Editor font dialog should show only fixed pitch (monospace) fonts|
|Description||Currently when changing editor font it shows all fonts. But I searched and found information and confirmed myself on Windows and Linux that SynEdit in Lazarus only supports fixed fonts, so it's logical the font choose dialog could show only fixed fonts.|
I attach a patch that adds [fdFixedPitchOnly] option to the dialog.
|Tags||No tags attached.|
|Fixed in Revision|
editor_monospace_font.diff (647 bytes)
Index: ide/frames/editor_display_options.pas =================================================================== --- ide/frames/editor_display_options.pas (revision 31909) +++ ide/frames/editor_display_options.pas (working copy) @@ -118,7 +118,7 @@ NewHeight := StrToIntDef(EditorFontHeightComboBox.Text, DisplayPreview.Font.Height); RepairEditorFontHeight(NewHeight); Font.Height := NewHeight; - Options := Options + [fdApplyButton]; + Options := Options + [fdApplyButton, fdFixedPitchOnly]; OnApplyClicked := @FontDialogApplyClicked; if Execute then FontDialogApplyClicked(FontDialog);
editor_monospace_font.diff (647 bytes)
The default font setting here is:
-misc-dejavu sans mono-medium-r-normal-*-*-90-*-*-*-*-iso10646-1
There is no way to select such string from anywhere. If I test different fonts and then select Sans again, it looks very different.
How is the selection supposed to work?
You can simply enter the font string in the combo box and remove focus to apply. But the format you've written includes size and style. I don't think that is taken into account, I think only name is taken. For example if I write:
-misc-dejavu sans mono-bold-r-normal-*-*-90-*-*-*-*-iso10646-1
the font does not become bold. If I write:
-misc-dejavu sans mono-medium-r-normal-*-*-140-*-*-*-*-iso10646-1
the font does not become larger.
Size and style is I think set separately.
And if I replace that string with Dejavu Sans Mono it looks exactly the same to me.
1. I think that Gtk2 font handling should be changed in this case, there's no need to use XOrg constructs for font naming (look what qt does).Such naming is
not needed when system uses fontconfig.
2. Under qt font dialog cannot be setted to show monospace fonts only, so that patch won't work
cobines, I did not write that font string myself. It is there by default with Linux + GTK2.
Changing medium to bold does not affect but the size setting does. With "140" the font becomes bigger but then the size selection box has no effect.
If I select only "Sans" using the GUI, the font looks like in my screenshot "editor_sans.png". It is not usable.
It means the whole settings page is quite useless on Linux + GTK2. On Windows it seems to work OK.
I was checking it on Linux QT4 and changing to 140 does not have effect. On GTK2 it does have effect but for me size selection box works fine.
The font dialog on GTK2 also does not support displaying only monospace fonts.
On Windows it does support it.
If you select Sans then this is non-monospace font and SynEdit doesn't show it properly. You need to use monospace fonts like "Dejavu Sans Mono". That's why the patch to not show fonts that don't work. But seems I tested it only on Windows.
||So, we should create specialized font dialog for ide and use EnumerateFontsEx to get list of fonts we want, or fix bug for win32 and add that property enum to exceptions of gtk2,qt and carbon widgetsets.|
Maybe the font dialog could be removed completely?
If I select any styles they are not applied. If I select color (at least on Windows it is possible) it is applied to preview window but not to main SynEdit editors. From what I see the dialog is only used to select font name and size.
Instead, we could put all the supported fonts names into the combo box and let user choose font name from the combo and font size from the spinedit. There already is a preview window which is much better than the one in the font dialog anyway.
||Maybe ownerdrawn combobox is good solution here (name of font drawn with that font), also monospaced fonts are choosed from the result of EnumerateFontsEx.|
Is the FontDialog or combobox, can show only monospaced fonts? on all OSes. Seems no.
Need to compare size (TCanvas.Textwidth) for all chars?
So pls close. "cannot fix".
Maybe a selection option for monospace fonts could be implemented on platforms that support it.
Anyway, I resolve this issue as duplicate.
|2011-08-08 17:58||cobines||New Issue|
|2011-08-08 17:58||cobines||File Added: editor_monospace_font.diff|
|2011-08-08 19:13||Martin Friebe||Relationship added||related to 0014357|
|2011-09-11 23:37||Martin Friebe||Relationship added||duplicate of 0015292|
|2011-09-15 15:30||Juha Manninen||Note Added: 0051862|
|2011-09-16 18:06||cobines||Note Added: 0051919|
|2011-09-16 20:40||Zeljan Rikalo||Note Added: 0051923|
|2011-09-17 11:10||Juha Manninen||File Added: editor_sans.png|
|2011-09-17 11:24||Juha Manninen||Note Added: 0051941|
|2011-09-17 16:09||cobines||Note Added: 0051947|
|2011-09-17 19:47||Zeljan Rikalo||Note Added: 0051955|
|2011-09-18 00:04||cobines||Note Added: 0051968|
|2011-10-07 15:04||Vincent Snijders||LazTarget||=> -|
|2011-10-07 15:04||Vincent Snijders||Status||new => acknowledged|
|2014-09-27 20:39||Zeljan Rikalo||Note Added: 0077756|
|2017-03-12 09:41||CudaText man||Note Added: 0098829|
|2017-03-12 10:10||Juha Manninen||Note Added: 0098833|
|2017-03-12 10:10||Juha Manninen||Status||acknowledged => resolved|
|2017-03-12 10:10||Juha Manninen||Resolution||open => fixed|
|2017-03-12 10:10||Juha Manninen||Assigned To||=> Juha Manninen|
|2017-03-12 10:14||Juha Manninen||Resolution||fixed => duplicate|