weimingtom / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
1 stars 0 forks source link

The cursor looks in wrong position when text characters in editor pane are bold #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a syntaxpane in editor pane(xml, java...)
2. type xml text or java text in relative syntaxpane(I haven't tried other
syntaxpanes)
3. if character in syntaxpane is bold, the character size will be enlarged,
but the cursor won't change the position. I think the cursor should also be
next to the bold characters, not still stay in position where next to the
character when not bold.

OS: Windos XP sp2, en_US.
JDK:1.6.0_07

Original issue reported on code.google.com by qil.w...@gmail.com on 20 Nov 2008 at 3:03

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the report.  Are you running Ubuntu?  What font is being used?  It 
should
be a monospaced font with Bold characters same width as non-bold characters.
I do not have access to Ubuntu at the moment, so Can't even reproduce the 
issue.  It
could be with JRE.  
Any takers?

Original comment by ayman.al...@gmail.com on 20 Nov 2008 at 7:50

GoogleCodeExporter commented 9 years ago
I am not running Ubuntu, as I said above, my operation system is Windows XP 
sp2, java
runtime is jdk1.6.0_07.

Original comment by qil.w...@gmail.com on 20 Nov 2008 at 11:30

GoogleCodeExporter commented 9 years ago
Ooops.  The screen shots confused me.  I'm on XP, and used JRE6u6 and u10.  
Didn't
face the problem.  What about bold and non-bold character sizes?

Original comment by ayman.al...@gmail.com on 20 Nov 2008 at 12:13

GoogleCodeExporter commented 9 years ago
Well, I test some specified Fonts in editor of my test source attached above.
editor.setFont(new Font("Dialog", Font.PLAIN, 11));

I tested three types of Fonts: Dialog, Tahoma, Segoe UI.

It is ok only when font name is Segoe UI and font size is 11. Default font type 
in
test is Font.PLAIN

Original comment by qil.w...@gmail.com on 21 Nov 2008 at 5:02

GoogleCodeExporter commented 9 years ago
I suspect the issue is with the Font being used.  I did try Tahoma on my 
system, but
still the cursor is displayed in the right location.  

Any takers?  Otherwise I can only close this as unreproducible.

Original comment by ayman.al...@gmail.com on 24 Nov 2008 at 9:17

GoogleCodeExporter commented 9 years ago

Original comment by ayman.al...@gmail.com on 24 Nov 2008 at 9:19

GoogleCodeExporter commented 9 years ago
Well, I don't know what characters you typed, I just type “String String 
String
String.....”, then it ocurs.

Original comment by qil.w...@gmail.com on 25 Nov 2008 at 2:37

GoogleCodeExporter commented 9 years ago
Still my highlights and cursor line up properly.
Could be a Java Unicode Character thing.  

Original comment by ayman.al...@gmail.com on 25 Nov 2008 at 11:03

GoogleCodeExporter commented 9 years ago
I've no idea about this. Hope some one else on other platform and with other 
language
locals could test it.

Original comment by qil.w...@gmail.com on 25 Nov 2008 at 3:19

GoogleCodeExporter commented 9 years ago
First of all a great thank you for this great piece of software.
Now, to the point. I am using JSyntaxPane for syntax highlighting of a trivial
programming language, but the cursor does not appear at the correct place when 
using
bold or italic fonts. The font I am using is DejaVu Sans under Ubuntu 8.10 
Intrepid
Ibex and Sun Java 1.6.0_10.
Also, everything was fine when using Segoe UI with size 11, but when changed to 
12
the problem occurs again. In the attached screenshot the cursor is actually 
before
the comma (,) character but it appears right after it.

Original comment by cyberpyt...@gmail.com on 22 Dec 2008 at 9:57

Attachments:

GoogleCodeExporter commented 9 years ago
I just tried using Segoe UI size 11 with a large keyword 
(ΠΡΑΓΜΑΤΙΚΕΣ) and set the
style for keywords to bold and had the same problem.

Original comment by cyberpyt...@gmail.com on 22 Dec 2008 at 10:10

GoogleCodeExporter commented 9 years ago
Try the font DejaVu Sans Mono.  The font must be monospaced, with bold and 
non-bold
characters having the same width.

Original comment by ayman.al...@gmail.com on 23 Dec 2008 at 12:56

GoogleCodeExporter commented 9 years ago
Thanks, that worked fine!
(So, the problem is caused by variable-with fonts...)

Original comment by cyberpyt...@gmail.com on 23 Dec 2008 at 2:10

GoogleCodeExporter commented 9 years ago
So closing issue:
Use fixed width (monospace) fonts.

Original comment by ayman.al...@gmail.com on 25 Dec 2008 at 4:58