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

Can not display Chinese character #403

Closed
quanwenbo opened this issue Jun 12, 2020 · 2 comments
Closed

Can not display Chinese character #403

quanwenbo opened this issue Jun 12, 2020 · 2 comments
Labels
duplicate This issue or pull request already exists
Milestone

Comments

@quanwenbo
Copy link

`use iced::{Element, Sandbox, Settings, Text};

pub fn main() {
Hello::run(Settings::default())
}

struct Hello;

impl Sandbox for Hello {
type Message = ();

fn new() -> Hello {
    Hello
}

fn title(&self) -> String {
    String::from("A cool application")
}

fn update(&mut self, _message: Self::Message) {
    // This application has no interactions
}

fn view(&mut self) -> Element<Self::Message> {
    Text::new("Hello,无法显示中文 world!").into()
}

}`

I tried this , but there were no chinese character displayed on it. just empty blocks.

@hecrj hecrj added the duplicate This issue or pull request already exists label Jun 12, 2020
@hecrj hecrj added this to the 0.2.0 milestone Jun 12, 2020
@hecrj
Copy link
Member

hecrj commented Jun 12, 2020

See #33, #208, #213, and #227.

@hecrj hecrj closed this as completed Jun 12, 2020
@hecrj hecrj modified the milestones: 0.2.0, 1.0.0 Jun 12, 2020
@aisq2008
Copy link

let setting = Settings {
    window: window::Settings  {
        size:(800,600),
        resizable: true,
        decorations: true,
    },
    flags:(),
    default_font:Some(include_bytes!("../fonts/fang_song.ttf")),  //设置中文的.ttf字体可以支持中文
    antialiasing:true
};

Counter::run(setting);

可以从C:\Windows\Fonts 中找宋体的ttf字体设置

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants