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

Font render failure. #19

Open
ray-x opened this issue Sep 14, 2021 · 6 comments
Open

Font render failure. #19

ray-x opened this issue Sep 14, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@ray-x
Copy link

ray-x commented Sep 14, 2021

Please complete the following information:

  • OS or distro: MacOS
  • neoray version: Head

Describe the bug
Some font failed to render

Steps to reproduce
Can not render emoji
Also some font failed to render:

image
Left: in kitty, same font
Right: neoray

Your neoray config in init.vim (Only the part that concerns neoray!)

vim.api.nvim_set_option('guifont', 'Victor Mono:h14')

Crash log if available (may be generated by neoray after crash)

Debug output (you can generate starting neoray with --verbose option)
[DEBUG] [NVIM] Neovim started with command: nvim --embed
[TRACE] [NVIM] Neovim version 0.6.0
[DEBUG] [NVIM] Attached to neovim as an ui client.
[TRACE] [NEORAY] Glfw version: 3.3.4 Cocoa NSGL EGL OSMesa
[DEBUG] [NEORAY] Monitor count: 1 Selected monitor: Built-in Retina Display
[DEBUG] [NEORAY] Video mode &{Width:1792 Height:1120 RedBits:8 GreenBits:8 BlueBits:8 RefreshRate:60}
[DEBUG] [NEORAY] Glfw window created with size 800 600
[DEBUG] [NEORAY] Monitor diagonal: 15.95 pdpi: 264.98 ldpi: 144.00
[DEBUG] [NEORAY] Using logical dpi.
[DEBUG] [NEORAY] Input callbacks are initialized.
[DEBUG] [RENDERER] Initializing opengl.
[TRACE] [RENDERER] Opengl Version: 4.1 ATI-3.10.22
[DEBUG] [RENDERER] Vendor: ATI Technologies Inc.
[DEBUG] [RENDERER] Renderer: AMD Radeon Pro 5300M OpenGL Engine
[DEBUG] [RENDERER] GLSL: 4.10
[DEBUG] [NEORAY] Loading default font.
[DEBUG] [NEORAY] Default font loaded.
[DEBUG] [NEORAY] Requesting deprecated options.
[DEBUG] [NEORAY] Checking user options.
[DEBUG] [NVIM] Option CursorAnimTime is 0.04
[DEBUG] [NVIM] Option Transparency is 0.95
[DEBUG] [NVIM] Option TargetTPS is 120
[DEBUG] [NVIM] Option ContextMenuOn is true
[DEBUG] [NVIM] Option WindowSize is 120 40
[DEBUG] [NEORAY] Loading font Victor Mono with size 14
[TRACE] [NEORAY] Regular: Victor Mono Regular Nerd Font Complete.ttf
[TRACE] [NEORAY] Bold Italic: Victor Mono Bold Italic Nerd Font Complete.ttf
[TRACE] [NEORAY] Italic: Victor Mono Italic Nerd Font Complete.ttf
[TRACE] [NEORAY] Bold: Victor Mono Bold Nerd Font Complete.ttf

@hismailbulut
Copy link
Owner

Currently neoray doesn't have an ability for rendering emojis, sorry for that. It seems like your font does not have this glyph and kitty uses some sort of another symbol font. Neoray currently can only render glyphs if it is in the specified user font or in default font.

@ray-x
Copy link
Author

ray-x commented Sep 14, 2021

Yes. I am using nvim-web-devicons plugin. So some of the fonts are from devicons but not in nerd fonts.
Also noticed that the ligature is not working.

@reykjalin
Copy link

I have the same issue despite registering the Nerd Font:

[TRACE] [NEORAY] Regular: Fira Code Retina Nerd Font Complete.otf
[WARNING] [NEORAY] Font has no bold italic face.
[WARNING] [NEORAY] Font has no italic face.
[WARNING] [NEORAY] Font has no bold face.

image

Here's the same part in my terminal using the same font:

image

Oddly enough, many other icons work in Neoray, so maybe it's just the arrow symbol that happens to be missing 🤔


However, what matters more to me is that ligatures aren't supported:

image

Do you know if this is a limitation of the font rendering library that's being used?

@ray-x
Copy link
Author

ray-x commented Sep 30, 2021

I solve this by using a manually patched nerdfont. But it took lots of efforts. Would be great neoray can load the graph vector from a built-in default font.

@hismailbulut
Copy link
Owner

hismailbulut commented Oct 12, 2021

@ray-x @reykjalin
Currently neoray using x/image/opentype font library which is a new library and maintained by only one person (I think). It's a complete opentype parser and uses x/image/vector for rasterizing fonts. Both libraries are almost complete, well written in pure go by google devs. This is the reason why I choosed them. But vector library is not drawing well in low dpi lcd monitors like cleartype or freetype and opentype parser library doesn't supports ligatures and emojis. Adding this features requires hard work but I believe golang devs will add them if we open an issue and when they have some free time. But this is not something I can do.

And one simplest solution for missing glyphs is find the actual fonts where these glyphs are coming from and then I can pack them with default font.

Other solution is we can add a new option for letting users to give some alternative font names to neoray and then neoray can use them in order for missing glyphs.

The last solution is like second, but instead asking to user, we will define some default symbol fonts per platform and use it if they available. These font's are not guaranteed to be in the user's system especially for linux.

The last two solutions disadvantage is neoray will load the fonts even when they don't need to be used and will increase memory consumption. Also I haven't got some free time for doing these soon.

@reykjalin
Copy link

Personally I think it's fine to wait for the libraries to add support for these icons/ligatures — no rush from my end. Thank you for the work on neoray, it's great!

@hismailbulut hismailbulut added the enhancement New feature or request label Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants