emilk/egui

Cosmic Text for font rendering

开放

#3,378 创建于 2023年9月23日

 (30 条评论) (7 个反应) (0 位负责人)Rust (2,093 个派生)batch import
epainthelp wantedtext

仓库指标

星标
 (29,972 个星标)
PR 合并指标
 (平均合并 17天 17小时) (30 天内合并 41 个 PR)

描述

As discussed in #1016 , I have done some testing on cosmic-text.

First of all, they have some docs that I've been exploring. And I was testing their example. They do have no_std and wasm support too according to the Cargo.toml they have.

I've noticed that the way it renders, is by drawing rectangles. Which is something I've seen for the first time to be honest. You can check it here. It gives a x,y,width,height, and color which is usually just color predefined and alpha channel being different for aliasing and stuff.

There is also another method if rectangles aren't possible: Swash Image which basically returns an image bytes to be rendered instead of individually creating rectangles. It requires some things I couldn't implement myself to be honest.

I was able to sort of hack the rectangle method in my engine image

It had... not good results to be honest image

Although maybe that's on me for having some issues with the engine as their examples do work and work very well. But yeah, that's my findings so far on cosmic text.

贡献者指南