snappertt / sdl-stb-font Goto Github PK
View Code? Open in Web Editor NEWRenders text using STB_Truetype in pure SDL
Renders text using STB_Truetype in pure SDL
Hi, sorry for bothering you again, I'd just noticed that I'm getting inaccurate text sizes when using the getTextSize()
method. In this included screenshot, I'm wanting to place two elements of text next to each other. I do this by setting the x
coordinate of the second to that of the first, plus the first's width. Unfortunately, this isn't quite working. I've added a method to load a font just before the text is measured to no avail.
sdl_stb_formatted_text text;
text << "Hello";
int w, h;
sdl2::fc.getTextSize(w, h, text);
...
sdl_stb_formatted_text text;
text << "Bye";
int w, h;
sdl2::fc.getTextSize(w, h, text);
The returned dimensions for each are w: 32, h: 20
and w: 24, h: 20
respectively.
Is there a way to make text stylised? :P
I'm just wondering if there is support for such features? Otherwise, really easy to use library. Nice work ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.