Re: [Interest] Make a specific Unicode glyph wider in a QTextLayout

2024-12-16 Thread Eskil Abrahamsen Blomfeldt via Interest
Hi! For certain things, such as spaces and line/paragraph separators etc. we do support this: https://doc.qt.io/qt-6/qtextoption.html#Flag-enum There's no way to customize how those look, though, except through the font. For more detailed control, you could get the glyph runs from the layout wi

Re: [Interest] Make a specific Unicode glyph wider in a QTextLayout

2024-12-15 Thread Wang Gary
> But since you want to edit it, it is probably too cumbersome. Of your two > suggested approached I think the QTextLayout has the best chance of working. So do you mean subclassing QTextLayout and accessing the private APIs? I also think it might be the way to do so but I'm just not sure if that'

Re: [Interest] Make a specific Unicode glyph wider in a QTextLayout

2024-12-15 Thread Allan Sandfeld Jensen
On Sunday 15 December 2024 18:07:46 Central European Standard Time Wang Gary wrote: > Hi again, > > > > > Replace the non-visible character in the model with a visible one in > > > > the > > > > view? > > > > > > Well, there are some reasons that I personally would like to avoid > > > that. Firs

Re: [Interest] Make a specific Unicode glyph wider in a QTextLayout

2024-12-15 Thread Wang Gary
Hi again, > > > Replace the non-visible character in the model with a visible one in the > > > view? > > Well, there are some reasons that I personally would like to avoid > > that. Firstly this > > feature itself is more of a view-level function, modifying the model > > sounds weird[1]. > My sugg

Re: [Interest] Make a specific Unicode glyph wider in a QTextLayout

2024-12-15 Thread Allan Sandfeld Jensen
On Sunday 15 December 2024 15:56:53 Central European Standard Time Wang Gary wrote: > > > So the question is, what's the proper approach to implement such a > > > feature > > > using Qt's public API? Do the mentioned two approaches sound right? > > > > Replace the non-visible character in the mod

Re: [Interest] Make a specific Unicode glyph wider in a QTextLayout

2024-12-15 Thread Wang Gary
> > So the question is, what's the proper approach to implement such a feature > > using Qt's public API? Do the mentioned two approaches sound right? > > > Replace the non-visible character in the model with a visible one in the view? Well, there are some reasons that I personally would like to a

Re: [Interest] Make a specific Unicode glyph wider in a QTextLayout

2024-12-15 Thread Allan Sandfeld Jensen
On Sunday 15 December 2024 08:23:50 Central European Standard Time Wang Gary wrote: > Hi, > > I'm attempting to implement a feature in a plain text editor that similar > to Notepad++'s "show hidden characters", which allows toggle the visibility > of non-printable characters, like zero-width spac