PolyMeilex / Neothesia

Flashy Synthesia Like Software For Linux,Windows and MacOs
GNU General Public License v3.0
893 stars 60 forks source link

Missing text on GUI #77

Open auroraanna opened 9 months ago

auroraanna commented 9 months ago

On master (d724865059e876f14a3b92ba18a1c5dbe3485131), the text on the GUI is missing, e.g. all the buttons, select menus but now the hints for what key plays what note. Therefore I guess, assuming that Neothesia renders the note hints, not iced, that this is an issue with iced.

The previous issue about this seems to have fixed this by switching to DX12. I am on Linux so this application should only be able to run on Vulkan on my system.

Screenshots of what it looks like: image image

This doesn't occur on 0.0.16 and for 1.0.0, I can't get it building in nixpkgs (https://github.com/NixOS/nixpkgs/pull/256882).

PolyMeilex commented 9 months ago

Yep, text rendered while playing the song is rendered by Neothesia directly, in menu it's done by iced

PolyMeilex commented 9 months ago

You could try with opengl

auroraanna commented 9 months ago

You could try with opengl

So, I figured you can set the WGPU_BACKEND environment variable but it launches successfully on nothing but gl. So it must've been running on OpenGL this whole time. I thought vulkan would work but no.

$ WGPU_BACKEND="vulkan" ./result/bin/neothesia
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: AdapterRequest', neothesia/src/main.rs:243:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: queue 0x55b0209b1650 destroyed while proxies still attached:
  xdg_wm_base@20 still attached
  wl_output@14 still attached
  wl_seat@13 still attached
  xdg_activation_v1@12 still attached
  wp_viewporter@11 still attached
  zwp_text_input_manager_v3@10 still attached
  zwp_pointer_constraints_v1@9 still attached
  zwp_relative_pointer_manager_v1@8 still attached
  zxdg_decoration_manager_v1@7 still attached
  wl_subcompositor@6 still attached
  wl_compositor@5 still attached
  wl_shm@4 still attached
  wl_registry@2 still attached

For games on Steam, vulkan works though. vkcube runs too.

I guess I could told from the missing mangohud overlay I get on all other vulkan apps that it's not running on vulkan.

PolyMeilex commented 9 months ago

Could you try with "RUST_LOG=debug" env

auroraanna commented 9 months ago

Could you try with "RUST_LOG=debug" env

With that env variable I found out the problem with running on vulkan was that it didn't have libvulkan.so.1 in it's path which it has now.

So, it runs on vulkan but the text is still missing. However, the Neothesia logo shows now: image

auroraanna commented 9 months ago

Oh, it was logging that it failed to find a bunch of fonts which I have all installed. Recompiling with fontconfig in runtime path.

This might just end up being a missing libraries thing.

auroraanna commented 9 months ago

Hmm, fontconfig in it's runtime PATH doesn't help. For vulkan-loader with libvulkan.so.1 I had to explicitly put it's lib folder into LD_LIBRARY_PATH though. Maybe fontconfig is not accessible to it?

auroraanna commented 9 months ago

The database can try to load system fonts. Currently, this is implemented by scanning predefined directories. The library does not interact with the system API.

--https://crates.io/crates/fontdb

I looked in the dependency graph and found fontdb. Assuming this crate is used for using system fonts, scanning predefined directories doesn't work on my Linux distro (NixOS). That must be why adding fontconfig to the runtime PATH didn't help.

I will try to put it in a FHS environment then so the predefined directories will work.

auroraanna commented 9 months ago

So, I was told putting it in an FHS env is not ideal. Patching the source code of the fontdb dependency would be better, but complex. Another option is Neothesia switching to using fontconfig. You can't expect fonts to be in predefined paths. Not every systen works the same way.

PolyMeilex commented 9 months ago

I wonder if it would be possible to hardcode the iced font the same way I do for Neothesia, for Neothesia I just prebundle the hardcoded font and that's why it works, iced on the other hand is "smarter" and tries to use system's font.

Could you try one of iced demos/examples? So we can at least report this upstream before I strip the font detection part out (if it manifests upstream that is)

auroraanna commented 9 months ago

So we can at least report this upstream

Upstream in iced? Shouldn't this be reported in cosmic-text or fontdb itself? (fontdb is a direct dependency of cosmic-text)

auroraanna commented 9 months ago

Hmm, there's already issues about this:

and https://github.com/pop-os/cosmic-text/pull/174 was merged so I guess cosmic-text needs to be updated in glyphon and iced_tiny_skia but there hasn't been a release of cosmic-text since it was merged.