Coder Social home page Coder Social logo

snappertt / sdl-stb-font Goto Github PK

View Code? Open in Web Editor NEW
53.0 53.0 2.0 16.23 MB

Renders text using STB_Truetype in pure SDL

Shell 0.07% C++ 47.67% Makefile 0.27% C 49.74% Lua 2.07% Scala 0.14% SuperCollider 0.04%
bgfx font sdl sdl2 stb text-rendering

sdl-stb-font's People

Contributors

snappertt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sdl-stb-font's Issues

Use different text styles

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 ๐Ÿ‘

Text Measuring is returning incorrect sizes

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.
capture_2020-11-06_23:09:02

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.