goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.87k stars 112 forks source link

HELP: No italic fonts redering #274

Closed RomaLzhih closed 6 months ago

RomaLzhih commented 6 months ago

I have created my custom dashboard from the example, specifically, I want to add some italic fonts. For example, the fortune and the shortcut. However, after many attempts in one day I still failed to make it work (. Any help would be appreciated. Thanks!

This is my config, and the full config is here:

local alpha = require("alpha")
require("alpha.term")
local dashboard = require("alpha.themes.dashboard")
local fortune = require("alpha.fortune")

-- Set header
dashboard.section.header.val = {

    "██╗  ██╗███████╗██╗     ██╗      ██████╗        ██╗    ██╗ ██████╗ ██████╗ ██╗     ██████╗",
    "██║  ██║██╔════╝██║     ██║     ██╔═══██╗       ██║    ██║██╔═══██╗██╔══██╗██║     ██╔══██╗",
    "███████║█████╗  ██║     ██║     ██║   ██║       ██║ █╗ ██║██║   ██║██████╔╝██║     ██║  ██║",
    "██╔══██║██╔══╝  ██║     ██║     ██║   ██║       ██║███╗██║██║   ██║██╔══██╗██║     ██║  ██║",
    "██║  ██║███████╗███████╗███████╗╚██████╔╝▄█╗    ╚███╔███╔╝╚██████╔╝██║  ██║███████╗██████╔╝",
    "╚═╝  ╚═╝╚══════╝╚══════╝╚══════╝ ╚═════╝ ╚═╝     ╚══╝╚══╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝",
}

local function button(sc, txt, keybind, keybind_opts)
    local b = dashboard.button(sc, txt, keybind, keybind_opts)
    b.opts.hl = "AlphaButtons"
    b.opts.hl_shortcut = "AlphaShortcut"
    return b
end

-- Set menu
dashboard.section.buttons.val = {
    button("u", "  > Update plugins", "<cmd> Lazy update<CR>"),
    button("f", "󰮗  > Find file", "<cmd> Telescope find_files<CR>"),
    button("r", "  > Recent", ":Telescope oldfiles<CR>"),
    button("s", "  > Settings", ":e $MYVIMRC | :cd %:p:h | split . | wincmd k | pwd<CR>"),
    button("q", "󰩈  > Quit NVIM", ":qa<CR>"),
}

dashboard.section.footer.val = fortune()

dashboard.section.header.opts.hl = "AlphaHeader"
dashboard.section.buttons.opts.hl = "AlphaButtons"
dashboard.section.footer.opts.hl = "AlphaFooter"

-- Send config to alpha
alpha.setup(dashboard.opts)

-- Disable folding on alpha buffer
vim.cmd([[
    autocmd FileType alpha setlocal nofoldenable
]])

And below is the outcome: image

RomaLzhih commented 6 months ago

Ok, after changing the .hl to italic, things works )