nerd-fonts
nerd-fonts copied to clipboard
Add LESSUTFCHARDEF instructions for less PUA character display Fixes: #1337
Description
Please explain the changes you made here.
Requirements / Checklist
- [x] Read the Contributing Guidelines
- [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx
- [ ] If this contains a font/glyph add its origin as background info below (e.g. URL)
- [ ] Verified the license of any newly added font, glyph, or glyph set. License is: xxx
What does this Pull Request (PR) do?
This PR adds documentation to explain how users can set the LESSUTFCHARDEF environment variable in less to correctly display Private Use Area (PUA) characters from Nerd Fonts.
How should this be manually tested?
This change is a documentation update, so no specific testing is needed. However, users can verify the instructions by running the following command to set the LESSUTFCHARDEF environment variable in their shell and viewing a file with PUA characters in less:
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
Any background context you can provide?
There have been issues with less not displaying Private Use Area (PUA) characters correctly. This is due to the way less handles characters that fall outside standard Unicode ranges. By setting the LESSUTFCHARDEF environment variable, users can ensure that PUA characters are properly rendered when using Nerd Fonts.
What are the relevant tickets (if any)?
Fixes: #1337
Screenshots (if appropriate or helpful)
@all-contributors please add nikunjmathur08 for doc
@tkapias @Finii Please look into the PR and let me know if anything else is required
I support this PR.
I also propose to update the Wiki page "Glyph Sets and Code Points" (not editable by PR), with a reminder message and a link inside the Overview section:
[!TIP] Less users: read this message about codepoints and the
LESSUTFCHARDEFvariable. (And updateLESSUTFCHARDEF's value when the codepoints change.)
> [!TIP]
> Less users: read [this message](https://github.com/ryanoasis/nerd-fonts#displaying-private-use-area-pua-characters-in-less) about codepoints and the `LESSUTFCHARDEF` variable.
(And update `LESSUTFCHARDEF`'s value when the codepoints change.)
The codepoints in the wiki have been updated at least once a year according to its history.
@tkapias Thank you for the feedback and the support! I’ve made the requested changes in the PR. However, I don’t have permission to edit the Wiki page directly. Could you please update the "Glyph Sets and Code Points" Wiki with the following tip?
Also, could you kindly consider merging this PR as part of Hacktoberfest 2024? I'd love to contribute under the event. Thanks again!
I'm not a collaborator on this project, I just opened the ticket. You'll have to wait for them to come and look at the PR. Maybe @Finii.
Hej!
Thanks for the PR :green_heart:
I wonder if we should "hardcode" the codepoint list; maybe it is better to have a tool to update the list, or something? This will get out of sync with the real codepoints on the next release and then someone has to manually adjust that.
See also https://github.com/ryanoasis/nerd-fonts/issues/1337#issuecomment-2405565628