Override the wgpu::text renderer

Hello everyone, my first post here! First, I just want to thank you all for this amazing GUI library, feels amazing to work with.

I’m using iced for some personal projects, and now I want to learn more about how Apple’s CoreText works and how to make it work with Rust project. I’m already able to use it to shape and draw the glyph’s paths using plain wgpu using the Servo bindings, but I’m not sure how to override the default text renderer from iced to accomplish that.

Basically, I want to override the default iced_wgpu::text::backend and provide my own implementation for that, so every widget will use my CoreText implementation instead. Is that even possible with the current state of iced structure?

Thank you in advance!

I haven’t found the iced_wgpu::text::backend module your talking about, what you could do is create your own iced_core::renderer::Rendrer with iced_graphics::renderer::Renderer by creating a backend. I don’t think you can do otherwise, and unfortunately internals of iced_wgpu::Rendrer do not seem do be accessible other than by copy paste. I don’t think either that having interchangeable text rendering system is very doable. I your case creating a MacOS specific renderer would make sense though.

Sorry, I’ve a typo on my original post! I meant override the text renderer in iced_wgpu::backend, thanks for pointing that out!

Makes sense, I was trying to not do a lot of copy-paste but seems to be the only way at the moment. I’ll create a specific renderer for macOS and try it out. I’ll post the results here when I have something working. I’ll also try something different and try to let cocoa render all the iced widgets, just for fun :laughing:

Thank you!