Comments (2)
See the solution as making the NkFontAtlas
actually owning the NkFont
pointers (stored in Vec<*mut NkFont>
), as this actually happens at the C level. Otherwise I have to return a borrow with 'NkFont' which will have a lifetime while being stored, and this this will pollute all the user code.
NkFontID
type, left of early versions, fits the purpose perfectly.
from nuklear-rust.
Ok, so far this will work by querying a font from atlas with FontAtlas::font(font_id)
. While this utilizes native library font storage and does not introduce segfaults, it has a performance drawback of traversing the linked list with fonts. So far the possible solution is to unsafely copy the font pointer to the user code and store it there, and don't forget to std::mem::forget()
it before purge.
from nuklear-rust.
Related Issues (20)
- Use `bitflags!` in place of raw C flags
- Format examples according to the Rust guidelines HOT 6
- Stability and Lifetime/Maintenance HOT 1
- Fix raw pointer issues at the Rust heap allocator HOT 2
- Styles HOT 2
- Font ids inversion? HOT 2
- Remove logger
- Rename `nk_group_begin` to `group_begin`
- gfx backend mouse input is scaled by 2 on Mac HOT 3
- Linux or SDL2 HOT 4
- No way of accessing clipboard struct on context HOT 5
- Pulled from Crates.io, nuklear-sys build script panics HOT 1
- How draw a line
- SDL2 HOT 3
- Crash on i686 target HOT 3
- style_push_* API seem to be unusable HOT 1
- Is it possible to remove default Titlebar and other window chrome? HOT 1
- Please derive Debug on CommandType
- i8 u8 tomato tomato? HOT 1
- vulkan example via gfx-rs
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 nuklear-rust.