View Single Post
Old 02-16-2018, 08:04 PM   #12
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)
I tend to think that there should be no "invisible characters" in Code view. Code view job is to show the code. Point.

This said, if it's good to display "something" to attest the presence of nnbsp, I understand it does not to need to be of the exact width of a nnbsp. To display an entity name in Code view is better than to leave a confusing and undocumented white space. For this reason I find your suggested "preserve entity" solution a clever workaround for this question.

The question of representing exactly the space size is relevant only for Preview and even more so to Book view. That said I shall look if I can find a fixed-width font with nnbsp suppport which can be used in Code view.

nbsp have, at least theorically, a proportional width. For example, this was true with Word 2013 and has been reverted to fixed width for Word 2016 (reason unknown).

Contrary to nbsp, nnbsp do have a fixed width (with variable interpretations ).

Edit: I remember six years ago, using Jellby's advice, I had added support to nnbsp in a Linux Libertine font using fontforge (in other words inserted the nnbsp glyph in an opensource font). Now this is no more needed at least for this font because nnbsp support has much increased but this technique could provide you with an instant solution.

Quote:
To add the #8239 character, just open your font in FontForge, select the space character (#32, before the !), copy it (Ctrl+C), go to #8239 (View -> Go to, write 8239), paste (Ctrl+V), double-click the character and drag the vertical line somewhat to the left, to make the space narrower. I believe the non-breaking property is implicit, but maybe something else should be done.
https://www.mobileread.com/forums/sh...45&postcount=5

Last edited by roger64; 02-16-2018 at 08:39 PM. Reason: link
roger64 is offline   Reply With Quote