ryanoasis / nerd-fonts

Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts: Hack, Source Code Pro, more. Glyph collections: Font Awesome, Material Design Icons, Octicons, & more
https://NerdFonts.com
Other
53.78k stars 3.62k forks source link

Add documentation for "less" LESSUTFCHARDEF (Private Use Area characters definition) option #1337

Open tkapias opened 1 year ago

tkapias commented 1 year ago

Issue

On Linux,less, the most common pager, will no longer print Private Use Area characters by default. I don't know when the transition took place, the version present in the Debian testing repositories (590) does still display Nerd-fonts characters, but the compiled master (633) no longer displays them.

A commit dated September 25, 2022 introduces a new option (LESSUTFCHARDEF) that allows you to declare the type of character display according to the code points range.

Using this option to declare code points listed in the wiki with the last version force less to display Nerd-fonts characters.

export LESSUTFCHARDEF=23fb-23fe:p,2665:p,26a1:p,2b58:p,e000-e00a:p,e0a0-e0a2:p,e0a3:p,e0b0-e0b3:p,e0b4-e0c8:p,e0ca:p,e0cc-e0d4:p,e200-e2a9:p,e300-e3e3:p,e5fa-e6a6:p,e700-e7c5:p,ea60-ebeb:p,f000-f2e0:p,f300-f32f:p,f400-f532:p,f500-fd46:p,f0001-f1af0:p

Solution

I think that instructions to export the correct variable should be given to Nerd-fonts users in the wiki or the readme.

Other

image

acidghost commented 1 year ago

Thanks for the fix!

I just spent an entire morning trying to pin-point the issue. I found this #1337 issue while looking for the code points used by Nerd Fonts.

For additional reference, I the version of less that introduced the LESSUTFCHARDEF is 632, more details are discussed in gwsw/less#275.

From what I understand of the linked issue PUA characters were never meant to be displayed. Maybe it has something to do with the v3 changes in Nerd Fonts?

Finii commented 11 months ago

more is just more then less ;-D

After I took me years to switch from more to less I probably will switch back ;-)

image

I will try to come up with a documentation change. Thank you both very much!! :medal_sports:

Cyb3rGhoul commented 11 months ago

Can you assign me this issue?

Finii commented 11 months ago

@Cyb3rGhoul Of course, thank you

powerman commented 2 months ago

Here is value suitable for Nerd Fonts v3.2.1 non-Mono version (with nice double width large icons :smile:):

LESSUTFCHARDEF=23fb-23fe:w,2665-2665:w,2b58-2b58:w,e000-e00a:w,e0a0-e0a3:p,e0b0-e0bf:p,e0c0-e0c8:w,e0ca-e0ca:w,e0cc-e0d7:w,e200-e2a9:w,e300-e3e3:w,e5fa-e6b5:w,e700-e7c5:w,ea60-ec1e:w,ed00-efce:w,f000-f2ff:w,f300-f375:w,f400-f533:w,f0001-f1af0:w

Mono version will needs the same value with all :w replaced by :p.

injust commented 2 months ago

Here is value suitable for Nerd Fonts v3.2.1 non-Mono version (with nice double width large icons 😄):

LESSUTFCHARDEF=23fb-23fe:w,2665-2665:w,2b58-2b58:w,e000-e00a:w,e0a0-e0a3:p,e0b0-e0bf:p,e0a0-e0c8:w,e0ca-e0ca:w,e0cc-e0d7:w,e200-e2a9:w,e300-e3e3:w,e5fa-e6b5:w,e700-e7c5:w,ea60-ec1e:w,ed00-efce:w,f000-f2ff:w,f300-f375:w,f400-f533:w,f0001-f1af0:w

Mono version will needs the same value with all :w replaced by :p.

How is this value generated? I'm not sure how to tell which code points are double-width.

Also, I think e0a0-e0c8:w overlaps with e0a0-e0a3:p and e0b0-e0bf:p?

powerman commented 2 months ago

How is this value generated? I'm not sure how to tell which code points are double-width.

Manually. :disappointed:

Also, I think e0a0-e0c8:w overlaps with e0a0-e0a3:p and e0b0-e0bf:p?

Yeah, sorry, it was a typo I have already fixed somewhere else but missed to fix here: it should be e0c0-e0c8:w (just fixed in my original comment).

injust commented 2 months ago

According to https://github.com/gwsw/less/blob/v661/less.nro.VER#L2015-L2017, the code point ranges can also be single code points. It's probably clearer to do that for 2665, 2b58, and e0ca, which results in:

LESSUTFCHARDEF=23fb-23fe:w,2665:w,2b58:w,e000-e00a:w,e0a0-e0a3:p,e0b0-e0bf:p,e0c0-e0c8:w,e0ca:w,e0cc-e0d7:w,e200-e2a9:w,e300-e3e3:w,e5fa-e6b5:w,e700-e7c5:w,ea60-ec1e:w,ed00-efce:w,f000-f2ff:w,f300-f375:w,f400-f533:w,f0001-f1af0:w