Giter Club home page Giter Club logo

iced_baseview's Issues

When trying to create iced_baseview::Settings, I get a Type Error (in https://github.com/BillyDM/iced-baseplug-examples )

mismatched types

expected struct `baseview::window_open_options::WindowOpenOptions`, found struct `baseview::WindowOpenOptions`

note: perhaps two different versions of crate `baseview` are being used?rustc(E0308)
lib.rs(321, 21): expected struct `baseview::window_open_options::WindowOpenOptions`, found struct `baseview::WindowOpenOptions`

image
I'm sorry, I'm still new to Rust, so I'm not sure what this means.

Loading Custom Fonts

Looks like iced 0.10 have a new way to load custom fonts. It's not really documented, but using the wgpu integration example, I was able to load the fonts via the renderer instance:

// This is the WGPU renderer
let wgpu_renderer = iced_wgpu::Renderer::new(Backend::new(&device, &queue, Settings::default(), format));

// We wrap the renderer in a type that implements the iced renderer trait
let mut renderer = iced_renderer::Renderer::Wgpu(wgpu_renderer);

// load custom fonts
renderer.load_font(Cow::from(MY_CUSTOM_FONT1_BYTES)); // &[u8]
renderer.load_font(Cow::from(MY_CUSTOM_FONT2_BYTES)); // &[u8]

Then, you can use those fonts using Family::Name("CustomFontName").

I am experimenting on my fork passing fonts extending the IcedBaseviewSettings.

How to pass keyboard events into iced_baseview?

I was wondering if there is a way to pass keyboard events into iced_baseview? Previously I did this by storing the Handle returned by iced_baseview::Runner, but it looks like that's been removed somewhat recently (and then hackilly forwarding keyboard events to it). Is there a different way to do this now? I noticed you added open_parented, but I'm not sure how to actually pass through a keyboard event, since it doesn't look like you get a handle or anything.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.