Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 11-11-2023, 12:24 AM   #1
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,107
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Special Character highlighting

Hello @kovidgoyal

I am wondering if the following is expected behaviour.

I have added a background colour to Special Character as shown in the image.

The problem is that the highlighting disappears when the cursor is placed on the same line, so it is a bit like whack-a-mole when trying to edit special characters. Is that meant to happen?
See video...

https://streamable.com/wqgvey
Attached Thumbnails
Click image for larger version

Name:	specialcharacter.jpg
Views:	103
Size:	35.2 KB
ID:	204654  
Karellen is online now   Reply With Quote
Old 11-11-2023, 02:00 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Its probably conflicting with the current line highlighting, try turning that off.
kovidgoyal is offline   Reply With Quote
Advert
Old 11-11-2023, 02:34 PM   #3
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,107
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Thanks @kovidgoyal

Sorry I am not sure which is "current line highlighting". Is it "CursorLine" in the custom theme dialogue? It is not set but I clicked the X button to clear it anyway and it made no difference.
Karellen is online now   Reply With Quote
Old 11-11-2023, 09:22 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes its cursorline the other option is change the special characcter highlight style to use a different foreground color or an underline.
kovidgoyal is offline   Reply With Quote
Old 11-11-2023, 11:25 PM   #5
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,107
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
the other option is change the special characcter highlight style to use a different foreground color or an underline.
Thanks.
Yep using a foreground colour works in a limited capacity. As long as there is something to display, then it shows that character in a different colour. Unfortunately for non displaying items like em, en etc spaces, there is nothing to colour.

Then using an underline is too subtle and either blends into a misspelt word underline, or is just too hard to see at a glance.

I guess it's probably too hard to fix the conflict. No problems, I've been working with the issue for quite a while now, so just business as usual. Thought I would raise it in case no-one had come across it before.

Last edited by Karellen; 11-13-2023 at 01:35 PM. Reason: blooper in description
Karellen is online now   Reply With Quote
Advert
Old 11-12-2023, 05:29 AM   #6
lomkiri
Zealot
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
Posts: 136
Karma: 1000102
Join Date: Jul 2021
Device: N/A
Quote:
Originally Posted by Karellen View Post
Thought I would raise it in case no-one had come across it before.
I did indeed, I run in the very same need (and issue) than you, trying to configure the editor to make visible the special chars inside the highlight lines, but I've failed as well. I have to move the selected line downward to see if there is a special char in the targeted line, which is not very practical, but I can live with this :-).

Anyway, if it would be possible to give precedence to the background color of the special chars over the background color of the selected line, it would be helpful. But maybe it's a Qt feature, not a calibre one ?
lomkiri is offline   Reply With Quote
Old 11-12-2023, 04:35 PM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,513
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Karellen View Post
Yep using a foreground colour works in a limited capacity. As long as there is something to display, then it shows that character in a different colour. Unfortunately for non displaying items like em, en etc, there is nothing to colour.
Out of curiosity, what are you doing to make em or en characters non-displaying?
DNSB is offline   Reply With Quote
Old 11-12-2023, 05:25 PM   #8
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,107
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by DNSB View Post
Out of curiosity, what are you doing to make em or en characters non-displaying?
Either picking the space character from the "Insert Special Character" dialogue, or
Using one of my snippets, or
typing html   which then auto-converts.

Why, do your space characters display something?
Karellen is online now   Reply With Quote
Old 11-12-2023, 05:45 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,513
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Sorry, I was thinking of the em — and en – dash. An   is a non-breaking space though you could also be using  ,  ,  ,  ,  ,   or   for other width spaces and other than the ‍, they do display as spaces of varying width so I don't think of them as non-displaying—I reserve that for characters that have no visible effect such as the ‍.

I seldom using the non-breaking space so I've never worried about seeing them.
DNSB is offline   Reply With Quote
Old 11-12-2023, 05:51 PM   #10
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,107
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by DNSB View Post
Sorry, I was thinking of the em — and en – dash. An   is a non-breaking space though you could also be using  ,  ,  ,  ,  ,   or   for other width spaces and other than the ‍, they do display as spaces of varying width so I don't think of them as non-displaying—I reserve that for characters that have no visible effect such as the ‍.

I seldom using the non-breaking space so I've never worried about seeing them.
No problems.
Some books I see are littered with unusual spaces, especially the no-break space, for no apparent reason. Some are obvious why they are needed, like the elongated ellipses with spaces between each dot or between nested quotation marks... " 'I quote', he told me!". Most instances have a standard space accompanying it for some reason. So I clean them out.
Karellen is online now   Reply With Quote
Old 11-12-2023, 11:30 PM   #11
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,513
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
For characters like the ellipsis, I replace the fake ellipsis with a real one ( . . . vs … ). This does disagree with some stylebooks that suggest either 3 periods with non-breaking spaces or 3 periods with no spacing but I prefer the single ellipsis character.

What is likely my most disliked &nbsp; usage is when every bloody paragraph ends with &160;</p>. Again something that I use saved searches to clean up. One other horrid example was an indie author who decided that they wanted 2 spaces between each sentence so each sentence ended in a &nbsp;<space> pair.
DNSB is offline   Reply With Quote
Old 11-13-2023, 03:08 AM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...7bc9ecd09a7616
kovidgoyal is offline   Reply With Quote
Old 11-13-2023, 03:29 AM   #13
lomkiri
Zealot
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
Posts: 136
Karma: 1000102
Join Date: Jul 2021
Device: N/A
Thanks a lot, Kovid :-)
lomkiri is offline   Reply With Quote
Old 11-13-2023, 03:37 AM   #14
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,107
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Oh wow!! I wasn't expecting a fix.

Thank you @kovidgoyal

Karellen is online now   Reply With Quote
Old 11-13-2023, 01:10 PM   #15
nabsltd
Evangelist
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 417
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
Quote:
Originally Posted by DNSB View Post
Sorry, I was thinking of the em — and en – dash. An &nbsp; is a non-breaking space though you could also be using &ensp;, &emsp;, &emsp13;, &hairsp;, &thinsp;, &puncsp; or &numsp; for other width spaces and other than the &zwj;, they do display as spaces of varying width so I don't think of them as non-displaying—I reserve that for characters that have no visible effect such as the &zwj;.
The equivalent non-displaying space is &ZeroWidthSpace;. HTML renderers will break lines as if it were a visible space, but the character has an Advance Width of zero.

&zwj; is for joining two characters that should semantically be one, but cannot be because of Unicode limitations.

&nbsp; and &NoBreak; are the non-breaking companions to the space character and &ZeroWidthSpace;.
nabsltd is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Special Character Background Colour BetterRed Editor 2 12-12-2018 08:03 PM
Insert special character: some niggles Phssthpok Editor 2 11-19-2016 12:55 PM
"preprocess_regexps with special character ' scissors Recipes 12 12-28-2011 03:10 PM
special character in metadata search happyuser Calibre 1 10-19-2011 11:33 AM
Special Character searches ElMiko Calibre 2 09-05-2011 10:52 PM


All times are GMT -4. The time now is 03:36 AM.


MobileRead.com is a privately owned, operated and funded community.