Comments (3)
ahh yeah, the font stuff in iced might be making changes soon which can help with this too.
from iced_aw.
There is a horizontal clipping bug as well, but it goes away if the font is changed (even to itself):
// Converted from `.woff2` from the latest release
// https://github.com/twbs/icons/releases/tag/v1.10.3
const BOOTSTRAP_ICONS: iced::Font = iced_native::Font::External {
name: "Bootstrap-Icons",
bytes: include_bytes!("../resources/bootstrap-icons.ttf"),
};
fn view(&self) -> iced::Element<'_, Self::Message, iced::Renderer<Self::Theme>> {
use iced::widget::text;
use iced_aw::graphics::IconText;
use iced_aw::ICON_FONT;
use iced_native::Alignment::Center;
let gear = '\u{F3E5}';
let icons = "\u{F159}\u{F156}";
let content = container(
column![
row![text("Icon::Gear"), IconText::new(Icon::Gear).size(40.0),].align_items(Center),
row![
text("Icon::Gear, ICON_FONT"),
IconText::new(Icon::Gear).font(ICON_FONT).size(40.0)
]
.align_items(Center),
row![
text("Icon::Gear, bootstrap-icons.ttf"),
IconText::new(Icon::Gear).font(BOOTSTRAP_ICONS).size(40.0)
]
.align_items(Center),
row![text("Gear code"), IconText::new(gear).size(40.0)].align_items(Center),
row![
text("Gear code, ICON_FONT"),
IconText::new(gear).font(ICON_FONT).size(40.0)
]
.align_items(Center),
row![
text("Hourglass, bootstrap-icons.ttf"),
IconText::new('\u{F420}').font(BOOTSTRAP_ICONS).size(40.0)
]
.align_items(Center),
row![
text("Gear code, bootstrap-icons.ttf"),
IconText::new(gear).font(BOOTSTRAP_ICONS).size(40.0)
]
.align_items(Center),
row![text("IconText"), IconText::new(icons).size(40.0)].align_items(Center),
row![text("IconText, ICON_FONT"), text(icons).font(ICON_FONT).size(40.0)].align_items(Center),
row![text("text, ICON_FONT"), text(icons).font(ICON_FONT).size(40.0)].align_items(Center),
row![
text("IconText, bootstrap-icons.ttf"),
IconText::new(icons).font(BOOTSTRAP_ICONS).size(40.0)
]
.align_items(Center),
row![
text("text, bootstrap-icons.ttf"),
text(icons).font(BOOTSTRAP_ICONS).size(40.0)
]
.align_items(Center),
]
.spacing(20),
)
.padding(10);
}
Here is bootstrap-icons.ttf
I was using (it's not a .zip
file, change the extension to .ttf
): bootstrap-icons.zip
The vertical clipping is still there, though, but it is much less noticeable.
It also seems that the current icons file has other problems and is somewhat outdated.
from iced_aw.
After investigating I have found that this is 100% a iced issue.
it occurs when the Renderer measures the Text size and returns a incorrect Size.
let (width, height) =
renderer.measure(&self.content, size, self.font.unwrap_or_default(), bounds);
This somehow is not correct and I hope the newer Text renderer will fix this issue.
from iced_aw.
Related Issues (20)
- menu not working with scrollable HOT 7
- color_picker color change HOT 3
- Custom Theme for Tabs HOT 2
- Request: File dialog, console terminal HOT 5
- Eye dropper for the color picker widget HOT 2
- How to distinguish which NumberInput sends the message?
- Modal components are broken HOT 9
- Split doesn't do scrollable operations HOT 3
- How to get the icon fonts like the fonts in tabs example? HOT 5
- Tabs incorrect behavior (tab bar filling widget space) when combined with window menus HOT 4
- How to implement multiple selection button over a map image HOT 1
- Lack of non ::new() widget creation functions HOT 4
- Request table component HOT 4
- [Feature Request] TabBar/Tabs using a type instead of `usize` for `active_tab` HOT 2
- [Help] Custom style for Tabs HOT 2
- NumberInput arrow icons not flexible. HOT 5
- Did wasm stop building? HOT 4
- Menu crash HOT 11
- Menu Needs Documentation added to readme. HOT 1
- expected enum `Font`, found associated type HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iced_aw.