Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

up definitions for glyphs from nerd-fonts #67

Closed
delphinus opened this issue Jan 27, 2022 · 7 comments · Fixed by #88
Closed

up definitions for glyphs from nerd-fonts #67

delphinus opened this issue Jan 27, 2022 · 7 comments · Fixed by #88

Comments

@delphinus
Copy link
Owner

delphinus commented Jan 27, 2022

Now SF Mono Square has glyphs from nerd-fonts.

  • source → Codepoints the source font has.
  • nerd-fonts → Codepoints the current build of nerd-fonts has.
  • current → Codepoints the current build of SF Mono Square has.
Font Name source nerd-fonts current
Seti-UI + Custom E4FA-E52E E5FA-E62E
Devicons E600-E6C5 E700-E7C5
Powerline Symbols E0A0-E0B3
Powerline Extra Symbols E0B4-E0D4
Pomicons E000-E00A
Font Awesome F000-F2E0
Font Awesome Extension E000-E0A9 E200-E2A9
Power Symbols 23FB-2B58
Material F001-F847 F500-FD46 F500-F8FF,E800-EC47
Weather Icons F000-F0EB E300-E3EB
Font Logos (Font Linux) F100-F11C F300-F31C
Octicons F000-F105 F400-F4ED
Octicons 2665-2665
Octicons 26A1-26A1
Octicons F27C-F27C F4A9-F4A9
Codeicons EA60-EBEB None

There are some differences.

Here are glyphs on Private Use Areas in current.

codepoints current count
E000-E00A Pomicons 11
E00B-E09F - 149
E0A0-E0A3 Powerline Symbols 4
E0A4-E0AF - 12
E0B0-E0B3 Powerline Symbols 4
E0B4-E0D4 Powerline Extra Symbols 33
E0D5-E1FF - 299
E200-E2A9 Font Awesome Extension 170
E2AA-E2FF - 86
E300-E3EB Weather Icons 236
E3EC-E5F9 - 526
E5FA-E62E Seti-UI + Custom 53
E62F-E6FF - 209
E700-E7C5 Devicons 198
E7C6-E7FF - 58
E800-EC47 Material 1096
EC48-EFFF - 952
F000-F2E0 Font Awesome 737
F2E1-F2FF - 31
F300-F31C Font Logos (Font Linux) 29
F31D-F3FF - 227
F400-F4ED Octicons 238
F4EE-F4FF - 18
F500-F8FF Material 1024
F0000-10FFFF - 131072

So there are some plans to place Codeicons glyphs (#66) (396 glyphs).

plan 1 EA60-EBEB
  • Pros - Products depending on Codeicons work without any change.
  • Pros - Many applications support these codepoints.
  • Cons - It overwrites Material glyphs.
plan 2 E400-E58B or ED00-EE8B or EE00-EF8B
  • Pros - It does not overwrite Material glyphs.
  • Pros - Many applications support these codepoints.
  • Cons - You should customize settings to use products depending on Codeicons.
  • Cons - nerd-fonts will use these areas to support some other glyh sets, maybe.
plan 3 FEA60-FEBEB
  • Pros - It does not overwrite Material glyphs.
  • Pros - Codepoints are easy to memorize.
  • Cons - You should customize settings to use products dependingOn Codeicons.

I think either plan 2 or plan 3 is better. How do you think, @yuki-yano ?


I have written this issue up to here, and known a new PR is filed in nerd-fonts.

We maybe should proceed this discussion with contact to there.

@delphinus
Copy link
Owner Author

@yuki-yano I have created the feature/add_codicons_patched branch that implements plan 3 above. You can test this with code below.

git checkout feature/add_codicons_patched
brew install --build-from-source ./sfmono-square.rb

This installs SF Mono Square v1.4.0-pre-codicons-01. You can use it with these settings.

lspkind settings
      local lspkind_format = require("lspkind").cmp_format {
        mode = "symbol_text",
        maxwidth = maxwidth,
        symbol_map = {
          Text = "󾪓", -- 0xFEA93
          Method = "󾪌", -- 0xFEA8C
          Function = "󾪌", -- 0xFEA8C
          Constructor = "󾪌", -- 0xFEA8C
          Field = "󾭟", -- 0xFEB5F
          Variable = "󾪈", -- 0xFEA88
          Class = "󾭛", -- 0xFEB5B
          Interface = "󾭡", -- 0xFEB61
          Module = "󾪋", -- 0xFEA8B
          Property = "󾭥", -- 0xFEB65
          Unit = "󾪖", -- 0xFEA96
          Value = "󾪕", -- 0xFEA95
          Enum = "󾪕", -- 0xFEA95
          Keyword = "󾭢", -- 0xFEB62
          Snippet = "󾭦", -- 0xFEB66
          Color = "󾭜", -- 0xFEB5C
          File = "󾩻", -- 0xFEA7B
          Reference = "󾪔", -- 0xFEA94
          Folder = "󾪃", -- 0xFEA83
          EnumMember = "󾪕", -- 0xFEA95
          Constant = "󾭝", -- 0xFEB5D
          Struct = "󾪑", -- 0xFEA91
          Event = "󾪆", -- 0xFEA86
          Operator = "󾭤", -- 0xFEB64
          TypeParameter = "󾪒", -- 0xFEA92
        },
      }

How do you think about this patch?

@delphinus
Copy link
Owner Author

I force-pushed the tag v1.4.0-pre-condicons-01 on the branch to be installed validly.

@delphinus
Copy link
Owner Author

Finally I released v1.4.0 to include codicons by plan 3. See #68.

@delphinus
Copy link
Owner Author

delphinus commented Sep 5, 2022

Updated. I fix the table above to solve this problem below.

Font Name source nerd-fonts SF Mono Square v2.0.0
Seti-UI + Custom E4FA-E52E E5FA-E62E
Devicons E600-E6C5 E700-E7C5
Powerline Symbols E0A0-E0B3
Powerline Extra Symbols E0B4-E0D4
Pomicons E000-E00A
Font Awesome F000-F2E0
Font Awesome Extension E000-E0A9 E200-E2A9
Power Symbols 23FB-2B58
Material F001-F847 F500-FD46 F500-F8FE,E7FF-EC46
Weather Icons F000-F0EB E300-E3E3
Font Logos (Font Linux) F100-F11C F300-F31C
Octicons F000-F105 F400-F4A8
Octicons 2665-2665
Octicons 26A1-26A1
Octicons F27C-F27C F4A9-F4A9
Codeicons EA60-EBEB FEA60-FEBEB

@delphinus
Copy link
Owner Author

delphinus commented Sep 7, 2022

Updated again. I found a problem. SF Mono has some glyphs on PUA that Material overwrites. I move these glyphs below to the area outside BMP.

Material nerd-fonts SF Mono Square v2.0.0
0xF1D6 0xF6D5 0xFF6D5
0xF1D7 0xF6D6 0xFF6D6
0xF1D8 0xF6D7 0xFF6D7
0xF1D9 0xF6D8 0xFF6D8
0xF400 0xF8FF 0xFF8FF

So SF Mono Square v2.0.0 (still unreleased) uses this codepoints.

Font Name source nerd-fonts plan 3 SF Mono Square v2.0.0
Seti-UI + Custom E4FA-E52E E5FA-E62E
Devicons E600-E6C5 E700-E7C5
Powerline Symbols E0A0-E0B3
Powerline Extra Symbols E0B4-E0D4
Pomicons E000-E00A
Font Awesome F000-F2E0
Font Awesome Extension E000-E0A9 E200-E2A9
Power Symbols 23FB-2B58
Material F001-F847 F500-FD46 F500-F8FF,E800-EC46 F500-F6D4,F6D9-F8FE,E800-EC46,FF8FF,FF6D5-FF6D8
Weather Icons F000-F0EB E300-E3E3
Font Logos (Font Linux) F100-F11C F300-F31C
Octicons F000-F105 F400-F4A8
Octicons 2665-2665
Octicons 26A1-26A1
Octicons F27C-F27C F4A9-F4A9
Codeicons EA60-EBEB FEA60-FEBEB

@delphinus
Copy link
Owner Author

Now ryanoasis/nerd-fonts#365 has been closed! According to that, I will upgrade SF Mono Square to catch up nerd-fonts v3's codepoints.

@delphinus delphinus mentioned this issue May 1, 2023
4 tasks
@delphinus
Copy link
Owner Author

delphinus commented May 7, 2023

nerd-fonts v3.0.0 has been released! So I will update SF Mono Square to use the latest codepoints. PR is here → #88

Font Name source nerd-fonts v2 nerd-fonts v3 SF Mono Square v3
Seti-UI + Custom E4FA-E5AC E5FA-E6AC
Devicons E600-E6C5 E700-E7C5
Powerline Symbols E0A0-E0B3
Powerline Extra Symbols E0B4-E0D4
Pomicons E000-E00A
Font Awesome F000-F2E0
Font Awesome Extension E000-E0A9 E200-E2A9
Power Symbols 23FB-2B58
Material F001-F847 F500-FD46 F0001-F1AF0
Weather Icons F000-F0EB E300-E3E3
Font Logos (Font Linux) F300-F32F
Octicons F000-F105 F400-F4A8
Octicons 2665-2665
Octicons 26A1-26A1
Octicons F27C-F305 F4A9-F532
Codeicons EA60-EBEB

Now SF Mono Square v3 uses completely the same codepoints as the ones in nerd-fonts v3. Here is the difference SF Mono Square v2 & v3 below.

Font Name source SF Mono Square v2 SF Mono Square v3
Material F001-F847 E800-EC46,F500-F6D4,F6D9-F8FE,FF6D5-FF6D8,FF8FF F0001-F1AF0
Codeicons EA60-EBEB FEA60-FEBEB EA60-EBEB

I'm creating a migration script named convert_codepoints. You can use this to convert all characters to catch up these changes.

# convert all files below the current directory
# from v2 => v3 (default values)
% convert_codepoints .

# specify versions
% convert_codepoints -f v1 -t v3 .
 
# also you can convert between nerd_fonts versions
% convert_codepoints -f nerd_fonts_v2 -t nerd_fonts_v3 .

Here is an example that I executed this in my dotfiles.

An example for convert_codepoints
~ ❯❯❯ convert_codepoints --gitignore ~/git/dotfiles
/Users/jinnouchi.yasushi/git/dotfiles/bin/tmux-vpn.sh:3:38: (U+E9A8) => 󰖩 (U+F05A9)
/Users/jinnouchi.yasushi/git/dotfiles/bin/tmux-vpn.sh:5:31: (U+E9A9) => 󰖪 (U+F05AA)
/Users/jinnouchi.yasushi/git/dotfiles/.screen/memory:0:0:This is not a text file.
/Users/jinnouchi.yasushi/git/dotfiles/.screen/cpu:0:0:This is not a text file.
/Users/jinnouchi.yasushi/git/dotfiles/.config/AquaSKK/kana-rule.conf:0:0:This is not a text file.
/Users/jinnouchi.yasushi/git/dotfiles/ansible/templates/tmux-vpn.j2:8:28: (U+E9A8) => 󰖩 (U+F05A9)
/Users/jinnouchi.yasushi/git/dotfiles/ansible/templates/tmux-vpn.j2:9:29: (U+E9A9) => 󰖪 (U+F05AA)
/Users/jinnouchi.yasushi/git/dotfiles/ansible/templates/tmux-vpn.j2:10:26: (U+F7DB) => 󰋜 (U+F02DC)
/Users/jinnouchi.yasushi/git/dotfiles/.vim/rc/dein/default.toml:381:5: (U+F542) => 󰁃 (U+F0043)
/Users/jinnouchi.yasushi/git/dotfiles/.vim/rc/dein/defx_lazy.toml:19:5: (U+E92B) => 󰔬 (U+F052C)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:263:19:󾪓 (U+FEA93) =>  (U+EA93)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:264:21:󾪌 (U+FEA8C) =>  (U+EA8C)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:265:23:󾪌 (U+FEA8C) =>  (U+EA8C)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:266:26:󾪌 (U+FEA8C) =>  (U+EA8C)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:267:20:󾭟 (U+FEB5F) =>  (U+EB5F)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:268:23:󾪈 (U+FEA88) =>  (U+EA88)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:269:20:󾭛 (U+FEB5B) =>  (U+EB5B)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:270:24:󾭡 (U+FEB61) =>  (U+EB61)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:271:21:󾪋 (U+FEA8B) =>  (U+EA8B)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:272:23:󾭥 (U+FEB65) =>  (U+EB65)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:273:19:󾪖 (U+FEA96) =>  (U+EA96)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:274:20:󾪕 (U+FEA95) =>  (U+EA95)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:275:19:󾪕 (U+FEA95) =>  (U+EA95)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:276:22:󾭢 (U+FEB62) =>  (U+EB62)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:277:22:󾭦 (U+FEB66) =>  (U+EB66)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:278:20:󾭜 (U+FEB5C) =>  (U+EB5C)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:279:19:󾩻 (U+FEA7B) =>  (U+EA7B)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:280:24:󾪔 (U+FEA94) =>  (U+EA94)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:281:21:󾪃 (U+FEA83) =>  (U+EA83)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:282:25:󾪕 (U+FEA95) =>  (U+EA95)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:283:23:󾭝 (U+FEB5D) =>  (U+EB5D)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:284:21:󾪑 (U+FEA91) =>  (U+EA91)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:285:20:󾪆 (U+FEA86) =>  (U+EA86)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:286:23:󾭤 (U+FEB64) =>  (U+EB64)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/cmp.lua:287:28:󾪒 (U+FEA92) =>  (U+EA92)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/opt.lua:407:26: (U+F651) => 󰅒 (U+F0152)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/opt.lua:408:26: (U+F867) => 󰍨 (U+F0368)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/lazies/opt.lua:426:17:󾪜 (U+FEA9C) =>  (U+EA9C)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/core/lazy/init.lua:57:14:󾯇 (U+FEBC7) =>  (U+EBC7)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/core/lazy/init.lua:59:16:󾪆 (U+FEA86) =>  (U+EA86)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/core/lazy/init.lua:66:16:󾫓 (U+FEAD3) =>  (U+EAD3)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/core/lazy/init.lua:68:15: (U+E8B1) => 󰒲 (U+F04B2)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:174:19:󾪓 (U+FEA93) =>  (U+EA93)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:175:21:󾪌 (U+FEA8C) =>  (U+EA8C)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:176:23:󾪌 (U+FEA8C) =>  (U+EA8C)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:177:26:󾪌 (U+FEA8C) =>  (U+EA8C)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:178:20:󾭟 (U+FEB5F) =>  (U+EB5F)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:179:23:󾪈 (U+FEA88) =>  (U+EA88)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:180:20:󾭛 (U+FEB5B) =>  (U+EB5B)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:181:24:󾭡 (U+FEB61) =>  (U+EB61)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:182:21:󾪋 (U+FEA8B) =>  (U+EA8B)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:183:23:󾭥 (U+FEB65) =>  (U+EB65)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:184:19:󾪖 (U+FEA96) =>  (U+EA96)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:185:20:󾪕 (U+FEA95) =>  (U+EA95)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:186:19:󾪕 (U+FEA95) =>  (U+EA95)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:187:22:󾭢 (U+FEB62) =>  (U+EB62)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:188:22:󾭦 (U+FEB66) =>  (U+EB66)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:189:20:󾭜 (U+FEB5C) =>  (U+EB5C)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:190:19:󾩻 (U+FEA7B) =>  (U+EA7B)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:191:24:󾪔 (U+FEA94) =>  (U+EA94)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:192:21:󾪃 (U+FEA83) =>  (U+EA83)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:193:25:󾪕 (U+FEA95) =>  (U+EA95)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:194:23:󾭝 (U+FEB5D) =>  (U+EB5D)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:195:21:󾪑 (U+FEA91) =>  (U+EA91)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:196:20:󾪆 (U+FEA86) =>  (U+EA86)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:197:23:󾭤 (U+FEB64) =>  (U+EB64)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/cmp/config.lua:198:28:󾪒 (U+FEA92) =>  (U+EA92)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/opt/init.lua:281:26: (U+F651) => 󰅒 (U+F0152)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/opt/init.lua:282:26: (U+F867) => 󰍨 (U+F0368)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/lua/modules/opt/config.lua:157:17:󾪜 (U+FEA9C) =>  (U+EA9C)
/Users/jinnouchi.yasushi/git/dotfiles/.config/nvim/dict/migemo/utf-8/migemo-dict:0:0:This is too large (> 1000000 bytes).

@delphinus delphinus changed the title Clean up definitions for glyphs from nerd-fonts up definitions for glyphs from nerd-fonts May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant