View Issue Details

IDProjectCategoryView StatusLast Update
0013651LazarusIDEpublic2013-09-03 12:07
Reportermalcome Assigned ToMartin Friebe  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.27 (SVN) 
Target Version0.9.28Fixed in Version0.9.27 (SVN) 
Summary0013651: Strange display of IDE Editor on Ubuntu 9.04.
DescriptionSee attached PNGs.
TagsNo tags attached.
Fixed in Revision19907
LazTarget1.4
WidgetsetGTK 2
Attached Files

Activities

2009-05-05 01:51

 

ubuntu.png (30,987 bytes)   
ubuntu.png (30,987 bytes)   

2009-05-05 01:52

 

win.PNG (23,349 bytes)   
win.PNG (23,349 bytes)   

Martin Friebe

2009-05-05 16:50

manager   ~0027333

Can you please confirm, your font settings?
Name?
Size?
Proprtional or Monospaced?

Can you also check if the problem is:
1) the correct font, but incorrectly displayed (not enough space given/cut off)
2) The wrong font. SynEdit uses a diff / diff-size font for bold?

In order to check this use a word processing or similar app, write some text in the same font, make some of it bold, and compare the size to what Synedit uses.

---
It will likely be (1). Which will mean if this is fixed, and SynEdit calculates the needed Width per Char more correctly, then the Space between the none-bold chars will also be increased. This is because Synedit is a monospace editor, it is designed to force all chars into a grid, the width of the grid to be determined by the width of the widest char.

Martin Friebe

2009-05-05 16:57

manager   ~0027334

As a temp workaround you can specify extra-char-spacing > 0. That should enforce a better display.

malcome

2009-05-06 02:46

reporter   ~0027352

I tried extra-char-spacing=1 then enforce a better display. thanks.
I attached some tested result on extra-char-spacing=0.
FontSize>=12 is OK, but FontSize<12 or FontSize>=12 and FontStyle=Bold is NG.

2009-05-06 02:46

 

Size8.png (98,417 bytes)   
Size8.png (98,417 bytes)   

2009-05-06 02:47

 

Size10.png (100,424 bytes)   
Size10.png (100,424 bytes)   

2009-05-06 02:47

 

Size12.png (105,366 bytes)   
Size12.png (105,366 bytes)   

2009-05-06 02:47

 

Size12_Bold.png (106,377 bytes)   
Size12_Bold.png (106,377 bytes)   

2009-05-06 02:47

 

Size12_Italic.png (111,172 bytes)   
Size12_Italic.png (111,172 bytes)   

Graeme Geldenhuys

2009-05-06 09:08

reporter   ~0027363

I'm using "Bitstream Vera Sans Mono" with font height at -13 and the editor displays fine. See graeme_ubuntu-904.png image. Also using Ubuntu 9.04 and X11 is set at 96 dpi.

==========
~ $ xdpyinfo | grep inch
  resolution: 96x96 dots per inch
===========

I must admit there are some display bugs with Ubuntu 9.04, but nothing related to Lazarus or what you reported.

2009-05-06 09:08

 

graeme_ubuntu-904.png (15,008 bytes)   
graeme_ubuntu-904.png (15,008 bytes)   

malcome

2009-05-06 11:53

reporter   ~0027374

Probably there are bugs with Ubuntu 9.04. But it works fine in "Geany"with Monospace 10 definitely. Therefore I am disappointed.

2009-05-06 15:20

 

t.rar (94,610 bytes)

Martin Friebe

2009-05-06 15:22

manager   ~0027387

Please run the attached app, and report the output (from the memo)

Please check the font-settings to match the settings that causes the problem.

Graeme Geldenhuys

2009-05-06 15:30

reporter   ~0027389

I just tried my Lazarus with "Monospace 10" font and still it look perfect under Ubuntu 9.04.

malcome

2009-05-07 03:29

reporter   ~0027417

Graeme, I have know that probably happens on some environments. But my Ubuntu 9.04 was just clean-installed to test Lasarus 0.9.27 only (for testing http://wiki.lazarus.freepascal.org/How_to_setup_a_FPC_and_Lazarus_Ubuntu_repository issue).

Martin, I will try your attached app.

malcome

2009-05-07 15:49

reporter   ~0027431

Martin, I changed from "uses Windows" to "uses LCLType" and tried.

FontName=Monospace
FontSize=10
fpDefault
TM ave= 6 over= 0 max= 7
no abc
TextWidth 11
fpDefault bold
TM ave= 7 over= 0 max= 8
no abc
TextWidth 11
fpFixed
TM ave= 6 over= 0 max= 7
no abc
TextWidth 11
fpFixed bold
TM ave= 7 over= 0 max= 8
no abc
TextWidth 11
fpVariable
TM ave= 6 over= 0 max= 7
no abc
TextWidth 11
fpVariable bold
TM ave= 7 over= 0 max= 8
no abc
TextWidth 11


FontName=Monospace
FontSize=12
fpDefault
TM ave= 8 over= 0 max= 8
no abc
TextWidth 11
fpDefault bold
TM ave= 8 over= 0 max= 9
no abc
TextWidth 11
fpFixed
TM ave= 8 over= 0 max= 8
no abc
TextWidth 11
fpFixed bold
TM ave= 8 over= 0 max= 9
no abc
TextWidth 11
fpVariable
TM ave= 8 over= 0 max= 8
no abc
TextWidth 11
fpVariable bold
TM ave= 8 over= 0 max= 9
no abc
TextWidth 11

Martin Friebe

2009-05-08 18:34

manager   ~0027449

I have just installed Ubuntu 9 myself.
Lazarus from SVN /FPC 2.2.4

Using Monospace font, in various sizes. The display is absolutely fine. (Display on local X-Server, as well as on remote xming)
(Actually going below 8 in the size, exposes a *different* issue / even so with similar effects).

I set the target to post 1.2 => there is a workaround in setting extra char spacing. (And probably this causes the same output, as there should have been. It adds the extra spacing, that should have been detected on the bold font.)


- Please make sure that this is not caused by a broken font on your system.
- It may be a problem with the driver for you gfx card (Can you try remote display ?)
- A problem with your Gtk/cairo whatever version ?
- Otherwise more information to reproduce this is needed.
Check your display settings, such as DPI, font rendering etc, and see if they solve the problem. If any of them solves it, please report which one, then I can try to reproduce again.

Sorry, but I need to be able to reproduce.
Alternative if you want to look into it yourself, please mail on the mailinglist, and I will give you some hints which values to watch, in order to see what may be happening.

malcome

2009-05-09 01:23

reporter   ~0027451

Last edited: 2009-05-09 01:49

Because I do not have any problem in the "Geany", I am disappointed, but am satisfied because there is a workaround. thanks.
I will try https://lists.ubuntu.com/archives/ubuntu-x/2009-April/000518.html .

Martin Friebe

2009-05-09 02:41

manager   ~0027452

BTW, the 2nd set of pictures: How did you manage to get all text bold or not-bold?

Did you configure every single highlight item to bold (or non bold)? Because whatever I select in the font dialog, it will (and should) ignore the bold and italic, and display the text with just some token bold, and some not bold.
I have never seen the preview in the editor options all-bold, or all-none-bold...

malcome

2009-05-09 03:12

reporter   ~0027453

In Options > Editor > Colors > Use syntax hilight = OFF ?

malcome

2009-05-09 06:03

reporter   ~0027454

Last edited: 2009-05-09 06:05

It seems to depend on setting of Ubuntu Language.
I got along well in "English(US)".

In English mode:
FontName=Monospace
FontSize=10
fpDefault
TM ave= 8 over= 0 max= 8
no abc
TextWidth 12
fpDefault bold
TM ave= 8 over= 0 max= 8
no abc
TextWidth 12
fpFixed
TM ave= 8 over= 0 max= 8
no abc
TextWidth 12
fpFixed bold
TM ave= 8 over= 0 max= 8
no abc
TextWidth 12
fpVariable
TM ave= 8 over= 0 max= 8
no abc
TextWidth 12
fpVariable bold
TM ave= 8 over= 0 max= 8
no abc
TextWidth 12

I do not get along well in "日本語(Japanese)". Please help us.

malcome

2009-05-09 09:33

reporter   ~0027455

Last edited: 2009-05-09 09:49

I tried in "Korean" too.

FontName=Monospace
FontSize=10
fpDefault
TM ave= 6 over= 0 max= 11
no abc
TextWidth 11
fpDefault bold
TM ave= 6 over= 0 max= 12
no abc
TextWidth 11
fpFixed
TM ave= 6 over= 0 max= 11
no abc
TextWidth 11
fpFixed bold
TM ave= 6 over= 0 max= 12
no abc
TextWidth 11
fpVariable
TM ave= 6 over= 0 max= 11
no abc
TextWidth 11
fpVariable bold
TM ave= 6 over= 0 max= 12
no abc
TextWidth 11

And see new attached png. It is slightly different, but after all is strange.
Possibly is GetTextMetrics() func. untrustworthy?
The "Geany" works fine always, so I think that there is some method.

2009-05-09 09:34

 

ko.png (98,739 bytes)   
ko.png (98,739 bytes)   

Martin Friebe

2009-05-09 13:56

manager   ~0027458

Last edited: 2009-05-09 14:03

Thanks for the feedback.
I can now reproduce it. (After I eventually found out GDM_LANG=ja_JP.UTF-8)

The Korean issue is another problem (actually 2)
Look closely at the letters, compare the "i".
The korean picture has different font. In all Monospace fonts, the "i" has a little horizontal line on its lower end. In the korean one, it does not.

It is simple possible that the Monospace font is not available with korean letters, therefore the system substitutes it.
And it took (too all appearance) a proportional font.
This explains the odd spacing, as the "i" is simple drawn at the very left of the virtual-grid-cell it belong into => so there is too much space behind it.

Also it seems that for that font the grid is chosen to small.

And there is a problem where bold text, looses it's very last pixel. (In your original case there is more than one pixel lost, and the causes are 2 different issues)

Martin Friebe

2009-05-09 14:18

manager   ~0027459

The issue is: SynEdit has 2 drawing modes:
- Let the system do the spacing of the Font. this works for *true* monospace fonts, because they are drawn with every char the same width. So each Char will be in the virtual display grid (lines/columns).
- Output each char separately. Needed for proportional fonts, where chars have different Widths, and would not align to the columns of the grid.

The problem with the 2nd mode is that it uses more CPU. And Lazarus runs across a wide range of PCs, and an equal range of available CPU resources.

So Lazarus attempts to determine if it can use the 1st method.

And while I have no reason to doubt the Results of GetTextMetrics, they are insufficient. One think is that Monospace Fonts should have the same Average as Max Width. In you example this is already not the case.
but using Chinese, even in a Monospaced font this does not apply, as even in Monospace, Chinese chars are double-width. (See the korean example you posted 6/11) So taking the MaxWidth would lead to very wrong results too.

Then count in issues with overhang, kerning, .....
Overhang is the reason why in the korean example the last (and only the las ONE) pixel of bold text is cut off.

Martin Friebe

2009-05-09 15:16

manager   ~0027460

I don't have "Geany", but I used GEdit as reference

MonoSpace indeed uses different char width for bold, and non bold. This can be seen in GEdit, and in the font selector dialog.

I compared, and the Width used for the bold text in SynEdit is the correct width for monospace bold.

The error is that the grid-width is detected to small.
Since the none-bold font fits into the smaller grid, the none-bold font is printed too narrow.
Also all cursor placement is based on the too narrow grid.

To explain "the none bold font is to narrow": On it's one alone, it has the right size. But in synedit all chars must have one width. since none-bold chars are more narrow than bold ones, they should be forced to a wider display. (and so should the cursor placement).

This means once fixed, with the given font selection all charrs will be printed wider (except for bold ones which are already)
Since "Extra char space" does exactly this, it means, that once fixed SynEdit should display the text as it currently does with "extra char width" = 1

I don't know how other editors deal with this:
- In GEdit I couldn't mix bold/non-bold, I could only either all-bold/ all non-bold.
- Does "Geany" use a grid-layout (all chars in column n are lined out at the same x-position / so if you type the same line and make one bold, will they have the same length, or is the none-bold one more narrow?
If it is grid layout: Does it stick to the size of the bold font, or the none bold font? (Compare with the same text in gedit)

malcome

2009-05-10 02:06

reporter   ~0027467

Last edited: 2009-05-10 03:32

You don't have "Geany"? Type "sudo apt-get install geany". He is great editor for programmer, Of course next to Lazarus.

"Geany" and "Gedit" do not use a grid-layout probably. See new attached screen shot.

2009-05-10 03:32

 

Screenshot.png (198,249 bytes)   
Screenshot.png (198,249 bytes)   

Martin Friebe

2009-05-10 17:05

manager   ~0027492

Please test and close if ok.

Note this fixes the cutoff of long bold text, which was the main issue of the bug.

The Display of the Korean font will be more readable too.
But the issue that for some fonts on italic (maybe bold too) text one pixel (but not a full char) at the end of the token can be missing is still open.

malcome

2009-05-11 12:38

reporter   ~0027508

Good job, Martin. You saved Japan. Speak soon.

Issue History

Date Modified Username Field Change
2009-05-05 01:51 malcome New Issue
2009-05-05 01:51 malcome File Added: ubuntu.png
2009-05-05 01:51 malcome Widgetset => GTK 2
2009-05-05 01:52 malcome File Added: win.PNG
2009-05-05 09:04 Vincent Snijders LazTarget => 0.9.28
2009-05-05 09:04 Vincent Snijders Assigned To => Martin Friebe
2009-05-05 09:04 Vincent Snijders Status new => assigned
2009-05-05 09:04 Vincent Snijders Target Version => 0.9.28
2009-05-05 16:50 Martin Friebe Note Added: 0027333
2009-05-05 16:50 Martin Friebe Status assigned => feedback
2009-05-05 16:57 Martin Friebe Note Added: 0027334
2009-05-06 02:46 malcome Note Added: 0027352
2009-05-06 02:46 malcome File Added: Size8.png
2009-05-06 02:47 malcome File Added: Size10.png
2009-05-06 02:47 malcome File Added: Size12.png
2009-05-06 02:47 malcome File Added: Size12_Bold.png
2009-05-06 02:47 malcome File Added: Size12_Italic.png
2009-05-06 09:08 Graeme Geldenhuys Note Added: 0027363
2009-05-06 09:08 Graeme Geldenhuys File Added: graeme_ubuntu-904.png
2009-05-06 11:53 malcome Note Added: 0027374
2009-05-06 15:20 Martin Friebe File Added: t.rar
2009-05-06 15:22 Martin Friebe Note Added: 0027387
2009-05-06 15:30 Graeme Geldenhuys Note Added: 0027389
2009-05-07 03:29 malcome Note Added: 0027417
2009-05-07 15:49 malcome Note Added: 0027431
2009-05-07 16:18 Martin Friebe Status feedback => assigned
2009-05-08 18:13 Martin Friebe LazTarget 0.9.28 => post 1.2
2009-05-08 18:13 Martin Friebe Target Version 0.9.28 =>
2009-05-08 18:34 Martin Friebe Note Added: 0027449
2009-05-08 18:34 Martin Friebe Status assigned => feedback
2009-05-09 01:23 malcome Note Added: 0027451
2009-05-09 01:49 malcome Note Edited: 0027451
2009-05-09 02:41 Martin Friebe Note Added: 0027452
2009-05-09 03:12 malcome Note Added: 0027453
2009-05-09 06:03 malcome Note Added: 0027454
2009-05-09 06:04 malcome Note Edited: 0027454
2009-05-09 06:05 malcome Note Edited: 0027454
2009-05-09 09:33 malcome Note Added: 0027455
2009-05-09 09:34 malcome File Added: ko.png
2009-05-09 09:49 malcome Note Edited: 0027455
2009-05-09 13:56 Martin Friebe Note Added: 0027458
2009-05-09 13:56 Martin Friebe Status feedback => assigned
2009-05-09 14:03 Martin Friebe Note Edited: 0027458
2009-05-09 14:18 Martin Friebe Note Added: 0027459
2009-05-09 15:16 Martin Friebe Note Added: 0027460
2009-05-10 02:06 malcome Note Added: 0027467
2009-05-10 03:32 malcome Note Edited: 0027467
2009-05-10 03:32 malcome File Added: Screenshot.png
2009-05-10 17:05 Martin Friebe Fixed in Revision => 19907
2009-05-10 17:05 Martin Friebe Status assigned => resolved
2009-05-10 17:05 Martin Friebe Fixed in Version => 0.9.27 (SVN)
2009-05-10 17:05 Martin Friebe Resolution open => fixed
2009-05-10 17:05 Martin Friebe Note Added: 0027492
2009-05-10 17:05 Martin Friebe Target Version => 0.9.28
2009-05-11 12:38 malcome Note Added: 0027508
2009-05-11 12:39 malcome Status resolved => closed
2013-09-03 12:07 Martin Friebe LazTarget post 1.2 => 1.4