View Single Post
Old 06-12-2019, 02:54 AM   #35
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,625
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by BeckyEbook View Post
QSS IMHO will not work.

The non-breaking space is a space, so you can really apply just underlining. For me default thin underlining seems too delicate.

File: Misc\XHTMLHighlighter.cpp [here]

Original code:
Spoiler:
Code:
    special_space_format  .setUnderlineColor(m_codeViewAppearance.xhtml_entity_color);
    special_space_format  .setUnderlineStyle(QTextCharFormat::DashUnderline);


My idea:
Spoiler:
Code:
    QPen outline(special_space_format.textOutline());
    outline.setBrush(m_codeViewAppearance.xhtml_entity_color);
    outline.setWidthF(1.0);
    outline.setStyle(Qt::SolidLine);
    special_space_format.setTextOutline(outline);
    special_space_format.setUnderlineColor(m_codeViewAppearance.xhtml_entity_color);
    special_space_format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
Thanks Becky and Kevin for this work on such a subject.

If I understood correctly (I got a little help about it), I can now get rid of my "160" preserved entity in the Preferences.

As you may know, French are particularly sensitive about no-break spaces because they have to make an intensive use of them. We use nbsp and nnbsp (coded in their own ways).

Replacing the original two short underlines (Kevin's own) with one bold underline (Becky's own) seems better for visibillity.

Would it be possible to go one step further (à la Calibre) and display a yellow highlight (see screenshot) ? I think the visibility would be even better.
Attached Thumbnails
Click image for larger version

Name:	fine.png
Views:	188
Size:	86.0 KB
ID:	171880  

Last edited by roger64; 06-12-2019 at 03:01 AM.
roger64 is offline   Reply With Quote