Comments (8)
@kiwidoggie I'm using Golang binding so I guess I cannot help you one this...
from nuklear.
As mentioned in Credits in Readme.md, by default Nuklear embeds stb_truetype for basic font rendering, but you're free to use e.g. freetype (there might be some examples in this repo IIRC).
On the other hand, it seems stb_truetype
wasn't updated for quite long in Nuklear and upstream has a new version where chances are, that the blurring will be less significant.
from nuklear.
@dumblob Thanks for your reply. I checked those two codes, is there any utils to generate from stb_truetype? So far as I see, the code is hand write line by line, not just embed directly. It seems to update is not an easy work. Am I correct?
from nuklear.
@AllenDang yeah, you're right - feel free to make a PR and separate stb_truetype completely (we use the Python packing script in the same folder through paq.sh
/paq.bat
- see also minor changes to this "amalgamation" which we didn't have time yet to finally review and merge).
from nuklear.
@AllenDang how are you rendering the Chinese font's. I'm having an issue from wchar_t to char conversion using the nk_label's.
from nuklear.
@dumblob I'm trying to update stb_truetype embeded in nuklear_font.h and I find out that I need to do a lot of function and struct naming replacement there.
I'm wondering how do you do it at first place? All hand-writing or there is a script which does the "search-and-replace" work?
from nuklear.
I have had issues with blurry fonts as well.
What fixed it for me is finding the correct scaling value. For whatever reason, in my testing each font has a scaling value, where the font is sharp. These sharp scaling values come in steps of integers.
One font always remains sharp in steps of 4, size 24, 28, 32 etc... whilst one font only remains sharp in steps of 6, size 19, 25, 31 etc... All other values make stb_truetype produce blurry results.
All of this with oversample_v = 1, oversample_h = 1 and pixel_snap = 1.
Cranking up oversampling only helps a teeny tiny bit whilst costing a bunch of memory. If you have Window's OpenGL software fallback, then you are limited to max 1024 size textures. Oversampling easily shoots past that and you get black squares.
I tied the font scale to a slider + bake loop and tried out different fonts and sizes in real time. This is the way I found out about it and the right values. So maybe try the same.
Hope this will be fixed with the new exellent PR #53 (Although stb_truetype still does not support font hinting...)
from nuklear.
@AllenDang could you retest if the update of stb_truetype (see PR #53 ) solved your problem?
from nuklear.
Related Issues (20)
- After set an opened Combo Box to invisible, no response from the entire window.
- How to do multiple render with one update HOT 2
- Events not working with multiple Nuklear windows
- Add `delta_time_seconds` to each renderer
- GUI "cards" HOT 6
- Multiple window instances HOT 2
- Inputs propagating to windows in background HOT 1
- No documentation explaining how to convert an nk_rune to a char. HOT 1
- Fragment shader used in the GLFW GL4 wrapper doesn't compile
- Getting some strange text clipping behavior when dragging windows around. HOT 1
- prefilling and updating an nk_edit_string while allowing manual editing ?
- 2 errors HOT 2
- Can`t assemble from src in msvs win HOT 2
- feature request: extend NO_SCROLLBAR with horizontal/vertical options HOT 6
- how to fix size of array '_dummy_array214' is negative error? HOT 1
- No NK_EDIT_DEACTIVATED flag is returned when switching from one nk_edit_string to a previous one
- Widget in 3D space HOT 3
- nk_color_hex_rgb / nk_color_hex_rgba outputs a string length of 4 rather than 6 and 8 respectively HOT 1
- Defining NK_UINT_DRAW_INDEX causes rendering issues.
- Crash: tooltips cause an infinite loop HOT 2
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.