emilk/egui

Cosmic Text for font rendering

Open

#3,378 建立於 2023年9月23日

在 GitHub 查看
 (30 留言) (7 反應) (0 負責人)Rust (2,037 fork)batch import
epainthelp wantedtext

倉庫指標

Star
 (29,051 star)
PR 合併指標
 (平均合併 11天 20小時) (30 天內合併 47 個 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.

貢獻者指南