You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
I know that widgets like Button can use .shaping(text::Shaping::Advanced) for shaping text. However, if the entire project is in Chinese, it's inconvenient to use .shaping(text::Shaping::Advanced) in various widgets or wrap it in a function. Additionally, widgets like Checkbox cannot use .shaping(text::Shaping::Advanced). I hope this issue can be fixed (I suggest making .shaping(text::Shaping::Advanced) the default for text).
What is the expected behavior?
It can normally use Chinese and other non-English languages
Version
master
Operating System
Windows
Do you have any log output?
No response
The text was updated successfully, but these errors were encountered:
Checkboxes have a .text_shaping() method exactly for this. And you can make your own helpers to not have to do that every time, like this:
mod widget_helpers {/// Creates a new [`Checkbox`].////// [`Checkbox`]: crate::Checkboxpubfncheckbox<'a,Message,Theme,Renderer>(label:implInto<String>,is_checked:bool,) -> Checkbox<'a,Message,Theme,Renderer>whereTheme: checkbox::Catalog + 'a,Renderer: core::text::Renderer,{Checkbox::new(label, is_checked).text_shaping(text::Shaping::Advanced)}pubfnbutton<'a>(text:implInto<Text<'a>>) -> Button<'a,Message>{button(text.into().shaping(text::Shaping::Advanced))}/// Creates a new [`Text`] widget with the provided content.pubfntext<'a,Theme,Renderer>(text:impl text::IntoFragment<'a>,) -> Text<'a,Theme,Renderer>whereTheme: text::Catalog + 'a,Renderer: core::text::Renderer,{Text::new(text).shaping(text::Shaping::Advanced)}}
Then instead of importing the normal checkbox, button, text from iced::widget you import them from this widget_helpers (name is just an example) and use them normally like this:
use widget_helpers::*;pubfnview(&self) -> Element<Message>{checkbox("Whatever you want",true).into();}
Other widgets like the radio, toggler, pick_list also have the same method for text shaping. Text inputs I believe use advanced shaping by default and that's why they don't have it...
Is your issue REALLY a bug?
Is there an existing issue for this?
Is this issue related to iced?
What happened?
I know that widgets like Button can use .shaping(text::Shaping::Advanced) for shaping text. However, if the entire project is in Chinese, it's inconvenient to use .shaping(text::Shaping::Advanced) in various widgets or wrap it in a function. Additionally, widgets like Checkbox cannot use .shaping(text::Shaping::Advanced). I hope this issue can be fixed (I suggest making .shaping(text::Shaping::Advanced) the default for text).
What is the expected behavior?
It can normally use Chinese and other non-English languages
Version
master
Operating System
Windows
Do you have any log output?
No response
The text was updated successfully, but these errors were encountered: