[Lazarus] Lazarus IDE text display

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Lazarus IDE text display

Free Pascal - Lazarus mailing list
Working on High Sierra Lazarus compiled for Cocoa shows odd character spacing for program text - each character looks about twice the width it should be. If I compile Lazarus for carbon it looks fine, and text spacing in my apps looks OK, so I suspect a SynEdit related issue. I though I had seen some earlier comments with a similar issues but I can't now find these. Any suggestons?

Colin
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus IDE text display

Free Pascal - Lazarus mailing list
On 16/08/2020 13:45, Colin Western via lazarus wrote:
> Working on High Sierra Lazarus compiled for Cocoa shows odd character spacing for program text - each character looks about twice the width it should be. If I compile Lazarus for carbon it looks fine, and text spacing in my apps looks OK, so I suspect a SynEdit related issue. I though I had seen some earlier comments with a similar issues but I can't now find these. Any suggestons?

This usually happens, if your font is not monospaced.

SynEdit will force the chars into the grid (that would be for monospaced).
To do so, SynEdit looks for the widest char in the font (by looking at
specific samples, like XMW@): "@" is often the widest.

You can use a negative "extra char spacing" (tools > options) to
compensate. But then the wider chars will overlap.

If the font is monospaced, then something is probably wrong with the LCL
measuring....
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus IDE text display

Free Pascal - Lazarus mailing list
On 16.08.2020 14:57, Martin Frb via lazarus wrote:
> To do so, SynEdit looks for the widest char in the font (by looking at
> specific samples, like XMW@): "@" is often the widest.

ATSynEdit takes with of 'grid' as widht of 'N' (before it was 'M', it
gave too big size for non monospaced fonts, 'N' is better).

--
Regards,
Alexey

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus IDE text display

Free Pascal - Lazarus mailing list


On 16 August 2020 13:07:01 BST, "Alexey Tor. via lazarus" <[hidden email]> wrote:
>On 16.08.2020 14:57, Martin Frb via lazarus wrote:
>> To do so, SynEdit looks for the widest char in the font (by looking
>at
>> specific samples, like XMW@): "@" is often the widest.
>
>ATSynEdit takes with of 'grid' as widht of 'N' (before it was 'M', it
>gave too big size for non monospaced fonts, 'N' is better

I have the font set as "default", which had always worked fine before. I will try some different fonts.

Colin
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus IDE text display

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 16/08/2020 14:07, Alexey Tor. via lazarus wrote:
> On 16.08.2020 14:57, Martin Frb via lazarus wrote:
>> To do so, SynEdit looks for the widest char in the font (by looking
>> at specific samples, like XMW@): "@" is often the widest.
>
> ATSynEdit takes with of 'grid' as widht of 'N' (before it was 'M', it
> gave too big size for non monospaced fonts, 'N' is better).
>

And how does a this text look?
MMM@@@WWW
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus IDE text display

Free Pascal - Lazarus mailing list
On 16.08.2020 19:24, Martin Frb via lazarus wrote:
> And how does a this text look?
> MMM@@@WWW

In Pascal syntax, it is 3 tokens; all 3 tokens are clipped on right side
(with non monospaced font).

--
Regards,
Alexey

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus IDE text display

Free Pascal - Lazarus mailing list
On 16/08/2020 18:27, Alexey Tor. via lazarus wrote:
> On 16.08.2020 19:24, Martin Frb via lazarus wrote:
>> And how does a this text look?
>> MMM@@@WWW
>
> In Pascal syntax, it is 3 tokens; all 3 tokens are clipped on right
> side (with non monospaced font).
>
Doing some more tests (with Cocoa) with different fonts:

with "default" as the font - the result looks odd. I thought this was
supposed to work for all platforms, but looking at my Linux (gtk2) setup
this also looks odd if "default" is used. Testing with MMM@@@WWW this
seems to be an issue with the specific font chosen.

with "Menlo" as the font it looks fine

with "Monaco" as the font the spacing is OK, but bold face is lost.

Ideally "default" for the IDE font would give a sensible monospace font
for each platform, but this may be more trouble than is is worth.

Colin


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus IDE text display

Free Pascal - Lazarus mailing list
 > Ideally "default" for the IDE font would give a sensible monospace font for each platform

No, “default” is def variable width font.
But yes, we need new alias for default mono font, eg “def_mono”. And I will use it, and IDE should use it.

Courier isn’t installed on all OS. Courier New too. For new alias, LCL must detect it... Maybe there isn’t such api in main OSes?

Alexey
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus IDE text display

Free Pascal - Lazarus mailing list
On 16/08/2020 23:19, Alexey via lazarus wrote:
>   > Ideally "default" for the IDE font would give a sensible monospace font for each platform
>
> No, “default” is def variable width font.
> But yes, we need new alias for default mono font, eg “def_mono”. And I will use it, and IDE should use it.
>
> Courier isn’t installed on all OS. Courier New too. For new alias, LCL must detect it... Maybe there isn’t such api in main OSes?
>

I dont know if this is still used (from unit synedit)
But it does not have cocoa

procedure InitSynDefaultFont;
begin
   if SynDefaultFontName <> '' then exit;
   Screen.Fonts;
   {$UNDEF SynDefaultFont}
   {$IFDEF LCLgtk}
     SynDefaultFontName   :=
'-adobe-courier-medium-r-normal-*-*-140-*-*-*-*-iso10646-1';
     SynDefaultFontHeight := 14;
     {$DEFINE SynDefaultFont}
   {$ENDIF}
   {$IFDEF LCLcarbon}
     SynDefaultFontName   := 'Monaco'; // Note: carbon is case sensitive
     SynDefaultFontHeight := 12;
     {$DEFINE SynDefaultFont}
   {$ENDIF}
   // LCLgtk2 and LCLQt use default settings
   {$IFnDEF SynDefaultFont}
     SynDefaultFontName   := 'Courier New';
     SynDefaultFontHeight := -13;
   {$ENDIF}
   if Screen.Fonts.IndexOf(SynDefaultFontName) >= 0 then
     exit;
   if Screen.Fonts.IndexOf('DejaVu Sans Mono') >= 0 then begin
     SynDefaultFontName   := 'DejaVu Sans Mono';
     SynDefaultFontHeight := 13;
   end;
end;

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus IDE text display

Free Pascal - Lazarus mailing list
On Mon, 17 Aug 2020 00:14:07 +0200
Martin Frb via lazarus <[hidden email]> wrote:

> On 16/08/2020 23:19, Alexey via lazarus wrote:
> >   > Ideally "default" for the IDE font would give a sensible
> >   > monospace font for each platform  
> >
> > No, “default” is def variable width font.
> > But yes, we need new alias for default mono font, eg “def_mono”.
> > And I will use it, and IDE should use it.
> >
> > Courier isn’t installed on all OS. Courier New too. For new alias,
> > LCL must detect it... Maybe there isn’t such api in main OSes?
>
> I dont know if this is still used (from unit synedit)
> But it does not have cocoa

Cocoa works with Courier New.

I personally use Andale Mono under Cocoa.

Mattias


 

> procedure InitSynDefaultFont;
> begin
>    if SynDefaultFontName <> '' then exit;
>    Screen.Fonts;
>    {$UNDEF SynDefaultFont}
>    {$IFDEF LCLgtk}
>      SynDefaultFontName   :=
> '-adobe-courier-medium-r-normal-*-*-140-*-*-*-*-iso10646-1';
>      SynDefaultFontHeight := 14;
>      {$DEFINE SynDefaultFont}
>    {$ENDIF}
>    {$IFDEF LCLcarbon}
>      SynDefaultFontName   := 'Monaco'; // Note: carbon is case
> sensitive SynDefaultFontHeight := 12;
>      {$DEFINE SynDefaultFont}
>    {$ENDIF}
>    // LCLgtk2 and LCLQt use default settings
>    {$IFnDEF SynDefaultFont}
>      SynDefaultFontName   := 'Courier New';
>      SynDefaultFontHeight := -13;
>    {$ENDIF}
>    if Screen.Fonts.IndexOf(SynDefaultFontName) >= 0 then
>      exit;
>    if Screen.Fonts.IndexOf('DejaVu Sans Mono') >= 0 then begin
>      SynDefaultFontName   := 'DejaVu Sans Mono';
>      SynDefaultFontHeight := 13;
>    end;
> end;
>

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus