Chinese font width error when using third party font
- Dominant language
- Java
- Stars
- 14.6k
- Forks
- 7k
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
When I change default font to some third party font
such as
`editor.font=Source Code Pro,plain,13`
and
`editor.font=JetBrains Mono,plain,13`
in `preferences.txt`, Chinese font width(2 English character width) narrowed, but display as expected.
When selecting Chinese text, the highlight width is only one English character width.

```
Arduino IDE version: 1.8.13 (also tested in the nighty version)
Operating system: Archlinux
```
Contributor guide
Research direction
Reproduce the issue in Arduino IDE 1.8.13 on Arch Linux using preferences.txt with Source Code Pro and JetBrains Mono. Start by tracing the editor's font measurement and text-selection highlighting behavior; done means Chinese selection highlights span the displayed two-character width with third-party fonts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100