Skip to content

chore: convert all remaining unicode to nerd font #523

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

Merged
merged 9 commits into from
Dec 14, 2024

Conversation

alex-courtis
Copy link
Member

@alex-courtis alex-courtis commented Dec 13, 2024

Converted remaining unicode glyphs to nerd font:

: ; lua ../../../audit.lua | grep NOGLYPH
NOGLYPH-                  1/1 0x02699 ⚙ cpy
NOGLYPH-                  1/1 0x02699 ⚙ cob
NOGLYPH-                  1/1 0x0235d ⍝ apl
NOGLYPH-                  1/1 0x02699 ⚙ cbl
NOGLYPH-                  1/1 0x003bb λ signature
NOGLYPH-                  1/1 0x02389 ⎉ bqn
NOGLYPH-                  1/1 0xf0509 󰔉 material
NOGLYPH-                  1/1 0x0003e > nu
NOGLYPH-                  1/1 0x0221e ∞ mo
NOGLYPH-                  1/1 0x003bb λ sig
NOGLYPH-                  1/1 0x02699 ⚙ cobol
NOGLYPH-                  1/1 0x003bb λ sml
local lunajson = require "lunajson"
local icons_by_filename = require("icons-default").icons_by_filename
local icons_by_file_extension = require("icons-default").icons_by_file_extension
local icons_by_operating_system = require("icons-default").icons_by_operating_system

-- read the json
local f, err, rc = io.open("glyphnames.json", "r")
if not f then
  io.stderr:write(string.format("%s\n", err))
  os.exit(rc)
end

-- parse the json
local ok, glyphnames = pcall(lunajson.decode, f:read())
f:close()
if not ok then
  io.stderr:write(string.format("%s\n", glyphnames))
  os.exit(1)
end
---@cast glyphnames table

-- map name by codepoint value
local names_by_codepoint = {}
for name, data in pairs(glyphnames) do
  if name and data and data.code then
    local code = tonumber(data.code, 16)
    if not names_by_codepoint[code] then
      names_by_codepoint[code] = {}
    end
    table.insert(names_by_codepoint[code], name)
  end
end

-- calculate codepoint for icons and output the name(s), codepoint, icon and web-devicons name
local function output(icons)
  for name, data in pairs(icons) do
    local cp = utf8.codepoint(data.icon)
    local names = names_by_codepoint[cp] or { "NOGLYPH-" }
    local i = 1
    for _, n in ipairs(names) do
      print(string.format("%-25s %d/%d 0x%05x %s %-25s", n, i, #names, cp, data.icon, name))
      i = i + 1
    end
  end
end

output(icons_by_filename)
output(icons_by_file_extension)
output(icons_by_operating_system)

@alex-courtis
Copy link
Member Author

Here are the numbers of icons from each "family".

I might look into completing #418 now.

: ; lua ../../../audit.lua | sed -E 's/^([^-]+)-.*/\1/g' | sort | uniq -c | sort -nr
    176 seti
    134 linux
    118 md
     95 dev
     75 fa
     59 custom
     28 oct
     17 cod
     12 NOGLYPH
      8 fae

Copy link
Collaborator

@hasecilu hasecilu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Certainly all icons now are bigger.

@alex-courtis alex-courtis merged commit 8a8e066 into master Dec 14, 2024
4 checks passed
@alex-courtis alex-courtis deleted the chore-convert-all-unicode-to-nerd-font branch December 14, 2024 00:11
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 this pull request may close these issues.

2 participants