fontstash | Light-weight online font texture atlas builder | User Interface library

 by   memononen C Version: Current License: Zlib

kandi X-RAY | fontstash Summary

kandi X-RAY | fontstash Summary

fontstash is a C library typically used in User Interface applications. fontstash has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Light-weight online font texture atlas builder
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              fontstash has a low active ecosystem.
              It has 590 star(s) with 82 fork(s). There are 43 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 11 open issues and 13 have been closed. On average issues are closed in 107 days. There are 4 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of fontstash is current.

            kandi-Quality Quality

              fontstash has no bugs reported.

            kandi-Security Security

              fontstash has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              fontstash is licensed under the Zlib License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              fontstash releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of fontstash
            Get all kandi verified functions for this library.

            fontstash Key Features

            No Key Features are available at this moment for fontstash.

            fontstash Examples and Code Snippets

            No Code Snippets are available at this moment for fontstash.

            Community Discussions

            Trending Discussions on fontstash

            QUESTION

            Why is OpenGL immediate mode faster than core?
            Asked 2020-Nov-25 at 17:00

            I am using the following library to render text in OpenGL: fontstash. I have another header file which adds support for OpenGL 3.0+. The question is why is the render implementation with core profile much slower than the immediate mode?

            Here is the render code with immediate mode:

            ...

            ANSWER

            Answered 2020-Nov-25 at 17:00

            I don't know exactly what gl is in this program, but it's pretty clear that, every time you want to render a piece of text, you perform the following operations:

            1. Allocate storage for a buffer, reallocating whatever storage had been created from the last time this was called.
            2. Perform three separate uploads of data to that buffer.

            These are not good ways to stream vertex data to the GPU. There are specific techniques for doing this well, but this is not one of them. In particular, the fact that you are constantly reallocating the same buffer is going to kill performance.

            The most effective way to deal with this is to have a single buffer with a fixed amount of storage. It gets allocated exactly once and never again. Ideally, whatever API you're getting vertex data from would provide it in an interleaved format, so that you would only need to perform one upload rather than three. But apparently, Fontstash is apparently not so generous.

            In any case, the main idea is to avoid reallocation and synchronization. The latter means never trying to write over data that has been written to recently. So your buffer needs to be sufficiently large to hold twice the number of font vertices you ever expect to render. Essentially, you double-buffer the vertex data: writing to one set of data while the other set is being read from.

            So at the beginning of the frame, you figure out what the byte offset to where you want to render will be. This will either be the start of the buffer or half-way through it. Then, for each blob of text, you write vertex data to this offset and increment the offset accordingly.

            And to avoid having to change VAO state, you should interleave the vertex data manually. Instead of uploading three arrays, you should interleave the vertices so that you're effectively making one gigantic array of vertices. So you never need to call glVertexAttribPointer in the middle of this function; you just use the parameters to glDraw* to draw the part of the array you want.

            This also means you only need one glBufferSubData call. But if you have access to persistent mapped buffers, you don't even need that, since you can just write to the memory directly while using the other portion of it. Though if you use persistent mapping, you will need to use a fence sync object when you switch buffer regions to make sure that you're not writing to vertex data that is still being read by the GPU.

            Source https://stackoverflow.com/questions/65006063

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install fontstash

            You can download it from GitHub.

            Support

            Uses [stb_truetype](http://nothings.org) for font rendering.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/memononen/fontstash.git

          • CLI

            gh repo clone memononen/fontstash

          • sshUrl

            git@github.com:memononen/fontstash.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link