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

Tour and other examples doesn't render most text #2563

Open
4 tasks done
thankfulmachine opened this issue Aug 31, 2024 · 3 comments
Open
4 tasks done

Tour and other examples doesn't render most text #2563

thankfulmachine opened this issue Aug 31, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@thankfulmachine
Copy link

Is your issue REALLY a bug?

  • My issue is indeed a bug!
  • I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

When running the tour with cargo run --package tour, most text does not display. See attached screenshot.

20240830_19h44m05s_grim

If I change the settings to specify the default_font to be MONOSPACE, the tour more or less works correctly, so I suspect there is a font issue with the default font, but I have searched and searched and can't find anything wrong with my system.

Configuration

  • iced 0.12.1
  • Arch Linux (updated as of this writing)
  • Ryzen 7 7840U (with and without Vulkan drivers)
  • Installed fonts:
    • Fira Sans OTF
    • Fira Mono OTF
    • Adobe Source Code Pro OTF
    • Noto Color Emoji TTF
    • Liberation* TTF

.config/fontconfig/fonts.conf:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>

 <alias>
  <family>sans-serif</family>
  <prefer>
   <family>Fira Sans</family>
   <family>Noto Color Emoji</family>
  </prefer>
 </alias>

 <alias>
  <family>serif</family>
  <prefer>
   <family>Fira Sans</family>
   <family>Noto Color Emoji</family>
  </prefer>
 </alias>

 <alias>
  <family>monospace</family>
  <prefer>
   <family>Fira Mono</family>
   <family>Noto Color Emoji</family>
  </prefer>
 </alias>
</fontconfig>

What is the expected behavior?

I expect the tour to render correctly with sans-serif fonts.

Version

crates.io release

Operating System

Linux

Do you have any log output?

2024-08-31T03:14:38.432005Z  INFO iced_wgpu::window::compositor: Settings {
    present_mode: AutoVsync,
    internal_backend: Backends(
        VULKAN | GL | METAL | DX12 | BROWSER_WEBGPU,
    ),
    default_font: Font {
        family: SansSerif,
        weight: Normal,
        stretch: Normal,
        style: Normal,
    },
    default_text_size: Pixels(
        16.0,
    ),
    antialiasing: None,
}    
2024-08-31T03:14:38.434739Z  INFO iced_wgpu::window::compositor: Selected: AdapterInfo {
    name: "AMD Radeon 780M (RADV GFX1103_R1)",
    vendor: 4098,
    device: 5567,
    device_type: IntegratedGpu,
    driver: "radv",
    driver_info: "Mesa 24.2.1-arch1.1",
    backend: Vulkan,
}    
2024-08-31T03:14:38.435061Z  INFO iced_wgpu::window::compositor: Available formats: Copied {
    it: Iter(
        [
            Bgra8UnormSrgb,
            Rgba8UnormSrgb,
            Bgra8Unorm,
            Rgba8Unorm,
        ],
    ),
}    
2024-08-31T03:14:38.435075Z  INFO iced_wgpu::window::compositor: Available alpha modes: [
    Opaque,
    PreMultiplied,
]
@thankfulmachine thankfulmachine added the bug Something isn't working label Aug 31, 2024
@thankfulmachine
Copy link
Author

Adding to this, if I install noto-fonts I get correct behavior. This doesn't seem right, but does the text system specifically require Noto Sans to be installed when the default font is used in the settings? I would've expected my fontconfig to be honored. Hopefully I didn't miss anything.

@thankfulmachine
Copy link
Author

thankfulmachine commented Aug 31, 2024

Finally found some fallbacks in

https://github.com/pop-os/cosmic-text/blob/e16b39f29c84773a05457fe39577a602de27855c/src/font/fallback/unix.rs#L6

I feel it would be good to document this dependency somewhere or perhaps update the examples to use an included font?

Although, this doesn't really explain why default_font: Font::MONOSPACE works, but not Font::DEFAULT or Font::default().

iced/src/settings.rs

Lines 18 to 21 in 0dcec51

/// The default [`Font`] to be used.
///
/// By default, it uses [`Family::SansSerif`](crate::font::Family::SansSerif).
pub default_font: Font,

@inferrna
Copy link

inferrna commented Sep 4, 2024

Same with markdown example on Clear Linux + Gnome + Wayland + Mesa.
I can select lines and click links, but text iteself is not visible.
Screenshot from 2024-09-04 11-04-09

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@inferrna @thankfulmachine and others