Originally there is only a shared `FT_Library` object. However, if we create multiple `NVGcontext` objects and as soon as we delete one, the shared `FT_Library` object will be released, too. And that would cause a problem for the rest of `NVGcontext` objects.
In Visual Studio 17, I get warnings related to these variables:
````
fontstash.h(241): warning C4018: '<': signed/unsigned mismatch
fontstash.h(242): warning C4018: '<': signed/unsigned mismatch
````
Making them unsigned fixes it.
- nvgTextBreakLines: wordMinX was relative to rowStartX, which caused
problems when rowStartX change on line break, but wordMinX was still
relative to the previous rowStartX
- fixed font size on perf graphs
- made demo to use row minx/maxx instead of row->width
- fixed demo hover distance
This commit fixes the issue that font size is inconsistent between different font files. `stb_truetype.h` is also updated to the latest version to support additional font types such as OpenType fonts.
This commit fixes the bug that `glnvg__convexFill()` tried to draw fringes depending on whether `NVG_ANTIALIAS` is set. However, #386 adds `nvgShapeAntiAlias()` for chaning anti-alias state explicitly, and `glnvg__convexFill()` would cause error If the anti-alias state is disabled.
This commit changes the type of the view size accepted by `nvgRenderFrame()` from `int` to `float` so it matches the type defined in `GLNVGcontext`. This would prevent a framebuffer missing a pixel in final rendering result.
This commit updates font stash to render glyph's bitmap data on demand. This change is intended to fix the issue that `nvgTextBounds()` may return an unreliable result when font atlas is full. This situation usually happens when auto scaling a large font text to fit a small rectangle.
The `fons__getGlyph()` function now accepts a new parameter indicating whether bitmap data is optional, and only `nvgText()` requires it. All of `nvgTextGlyphPositions()`, `nvgTextBreakLines()`, `nvgTextBounds()` and `nvgTextBoxBounds()` functions are changed to work without glyph’s bitmap data.
This commit fixes the bug that `glnvg__renderFill()` allocates unused quad vertices for `GLNVG_CONVEXFILL`, which causes unused vertices uploaded to the GPU.
Besides, the quad for the `GLNVG_FILL` type is changed to drawn by `GL_TRIANGLE_STRIP` instead of `GL_TRIANGLES` so two more vertices can be reduced per quad.
In one of my test case, I need to paste an image to a framebuffer about 5,000 times, and this change would reduce the total number of uploaded vertices from `52,106` to `22,476`. It is good for FPS and battery consumption.