Skip to content

Fonts: Character not displayed even though Font supports it #1295

@KiraResari

Description

@KiraResari

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?

I am writing a program for displaying the relationships between Kanji and related characters. For that, I want to display the character ⺮. I know that the font MS Gothic can display that character. That font consist of two font files:

  • msgothic.ttc
  • msgothic_0.ttc

I have imported them like this:

use iced::Font;
use array_concat::*;

const MS_GOTHIC_PART_1: [u8; 9176636] = *include_bytes!("../resources/fonts/msgothic.ttc");
const MS_GOTHIC_PART_2: [u8; 9165480] = *include_bytes!("../resources/fonts/msgothic_0.ttc");
const MS_GOTHIC: [u8; concat_arrays_size!(MS_GOTHIC_PART_1, MS_GOTHIC_PART_2)]
 = concat_arrays!(MS_GOTHIC_PART_1, MS_GOTHIC_PART_2);

pub struct Fonts{

}

impl Fonts{
    pub fn ms_gothic() -> Font {
        
        Font::External{
            name: "msgothic",
            bytes: &MS_GOTHIC
        }
    }

[...]

This has worked nicely for all characters thus far. However, for ⺮ it only displays ☐ (the missing character symbol).

I suspect that this happens because the multi-file font support is not working as expected.

What is the expected behavior?

The character ⺮ should be displayed correctly.

Version

0.3.0

Operative System

Windows

Do you have any log output?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions