GithubHelp home page GithubHelp logo

font-stash's People

Contributors

akrinke avatar sjml 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

font-stash's Issues

Bitmap support

Hi,

I'm looking to use bitmap support in fontstash, however the example in the main.c file looks quite primitive.

I used the AngelCode creator to generate the .fnt file with associated .tga. Can fontstash load that .fnt file and set up the bitmap font automatically without having to write my own surface code and adding each glyph individually? If so, is there an example somewhere?

Thanks!

Possible memory leak

Hi,

One of our developers found a possible memory leak, caught when doing integration tests. Attached is the diff (viewable here: http://code.google.com/p/bitfighter/source/diff?spec=svn4604e38f9ee3b26453e306e2bf43c32d5ee52f13&r=4604e38f9ee3b26453e306e2bf43c32d5ee52f13&format=side&path=/fontstash/fontstash.c)

diff -r 775e2f415e84 -r 4604e38f9ee3 fontstash/fontstash.c
--- a/fontstash/fontstash.c Wed Nov 13 08:06:17 2013 -0600
+++ b/fontstash/fontstash.c Wed Nov 13 12:48:27 2013 -0600
@@ -196,6 +196,8 @@
        free(stash);
    if (texture != NULL)
        free(texture);
+   if (empty_data != NULL)
+       free(empty_data);
    return NULL;
 }


Right justification

Not exactly an issue, more a question: is there any way to specify right justification for text when using sth_draw_text(), i.e. so that the x argument would be interpreted as where the text should end, not begin?

Thanks!

Recreation of stash when changing resolution adds graphic artifacts

Upon losing an OpenGL context with a resolution change in our game, we need to reinitialize the font stashes. However when switching to full screen mode and back to windowed mode, most letters show OK save a few that seem to have artifacts. Here is a screenshot after switching the resolution back and forth:

snapshot4

Note the artifacts on several letters displayed throughout, especially the white text at the top.

After some research, I found this solution to a similar problem:
http://stackoverflow.com/questions/1191093/im-seeing-artifacts-when-i-attempt-to-rotate-an-image/1191281#1191281

However after adding the suggested OpenGL calls to various parts within my application and within fontstash.c, the problem is still there.

Could this just be related to my hardware? (I'm running on an NVidia NVS 3100M chip)

Here is how we're using Font-Stash in our application (we initialize with FontManager::initialize()):
https://code.google.com/p/bitfighter/source/browse/zap/FontManager.cpp

Thanks for a great library!

String width problem?

When I use sth_dim_text to calculate the width of a string, I get surprising results. I would expect the following two strings to be the same length:

"LLLLL " and "LLL LL".

However, it appears that strings with terminal spaces are reported to be shorter than expected. I have confirmed that in both cases the function iterates properly over all characters in the string, and is selecting what seem to be the proper glyphs. However the length of those glyphs seems to not be consistently calculated.

I have tried this with several TTF fonts, including the venerable OCRA. Is it possible this is somehow related to TTF hinting? Or is it a problem with Font-Stash?

visual bug with rotation

When you do a glRotate the font is rendered with a thin outline corresponding to the bounding box.
Try doing glRotated(2, 0, 0, 1) before calling font.draw() to see the problem.
It sometimes also happens if you do a glTranslate.
letter_outline

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.