Comments (8)
Shaping and scaling unfortunately do require heap allocations due to indeterminate memory requirements or upper bounds that are too large for stack allocation.
That said, the crate could be core+alloc, but certain components of the underlying path engine require floating point intrinsics that are currently unavailable in core. This is a known problem and when it is resolved, I would like to remove the std dependency.
from swash.
It doesn't seem like there's been any work towards it in the aforementioned issue for ~3 years. It might be worth feature gating it with support for libm or micromath? Not really familiar with this kind of stuff, though. std::io
and yazi
might still be an issue, but probably solvable with traits.
Edit: Proof of Concept (I won't actually be implementing this, I'm too busy.)
from swash.
I will be attempting to add this feature.
from swash.
@jackpot51 Are you on this?
It does seem like it'll be a while before math-in-core is stable. I think it would certainly be worth using something like libm
in the mean time.
As for std::io
, what's the status on that? I know we won't be getting core::io
for a long time (mainly due to std::io::Error
), so some alternative approach would likely be useful. Assuming it's only used in the loader, I think delegating to an external loader, like rustybuzz and many other crates do, could actually be worthwhile. For example, ttf-parser
, which is used in rustybuzz, already supports no_std
.
yazi
does now support no_std
(as seen in this thread).
from swash.
I was working on it but got distracted by other things. I can take another crack at it if it's important to you.
from swash.
I was actually thinking about using swash for early console rendering inside of my OS, so I'd love it if you could add support. I can also try to help out with anything, as I have lots of experience with no_std (see said OS).
from swash.
Thanks to @notgull, all dependencies should support no_std now. Doing so for swash is mostly grunt work that involves integrating libm and importing alloc::vec::Vec where required. I donβt really have time to do it myself but Iβm happy to accept a PR.
from swash.
Something I've seen in a lot of other crates is simply extern crate alloc as std;
. This allows you to keep the old code that uses std
, and simply switch it out for alloc
in no_std
.
from swash.
Related Issues (20)
- AAT ligatures HOT 1
- Subpixel Format Rendering? HOT 2
- Extract text analysis code into separate crate HOT 1
- Add support for COLRv1 HOT 1
- Implement a reference rasterizer for COLRv1 outlines HOT 2
- expose the panose subfield for detecting the GenericFamily in fount HOT 1
- Testing swash
- π€ and πͺ΅ are rendered incorrectly it would seem HOT 7
- Some fonts are rasterised very small
- Cannot render `U+1FB87 : RIGHT ONE QUARTER BLOCK` HOT 1
- i is not rendered properly when using JetBrains Mono HOT 1
- Support for CFF seac / enchar
- Rust Nightly 4-1-2023 and forward breaks swash. HOT 2
- Use ttf-parser for font parsing HOT 5
- How is unicode_data.rs generated? HOT 1
- "Panic: misaligned pointer reference" in rustc 1.70.0 HOT 3
- CharMap does not include substitutions
- Expose public C/C++ API
- Documentation: what does "code units" means? HOT 1
- crate-private type `Outlines<'_>` in public interface HOT 8
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 swash.