Git Product home page Git Product logo

rfont's Introduction

RFont

logo image

Simple single header modular font rendering library
The library is designed to be lightweight while also supporting the ablitiy to add your own rendering system.\

Build statuses

cplus workflow cplus workflow windows cplus workflow windows

Native supported rendering APIs

  • OpenGL Legacy
  • Modern OpenGL (opengl 3.3 +)
  • RGL (OPENGL version abstraction layer)

Contacts

Documentation

For documentation read the RFont.h file and check out the example in ./example

todo

- backup font system for when a character is not supported by the main font

uses

A Terminal emulator created using RFont by Noxomix
RSGL (my GUI library)

Credits

stb_truetype

RFont uses stb_truetype for working with fonts.

A modified version of stb_truetype is included in the RFont header.
But you can use an external copy by adding #define RFONT_EXTERNAL_STB to your code

Fontstash

Fontstash is another font rendering library with simular goals.

Fontash was used as a reference for some of this code.

However, this library is intended to have better perfromance and be more lightweight than fontstash.

rfont's People

Contributors

colleagueriley avatar

Stargazers

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

Watchers

 avatar

Forkers

southdy

rfont's Issues

Crashes when certain UTF-8 Text is sent

The library poorly renders the unsupported text and then crashes.

This text is "๐™ธ mฬตฬอ„eฬทฬ‰ฬ‹aฬดอ’ฬ‹nฬดฬ“ฬš ๐•ด ๐‘ช๐’‚๐’ ๐““๐“ธ ๐•‹๐•™๐•š๐•ค"

(Again, I will solve this issue, this is just here for organization's sake)

Render Background gets overwritten?

Hello, Im using RFont with GLFW and Glad (openGL 3.3) when I render my Font the Background gets set to black, and everything I render afterwards (like draw cycles, rectangles and so on) is not beeing displayed. If I place the draw text before my other render stuff, only the text with black background is displayed in the window ... and if i do my rendering first and then the text... its again just displayed the text on black background.

Is there a thing needs to done before? For example hook in the GLFW Context or the Glad RFont context pointer into Glad (like this GLFW load user pointer)?

Edit: Im doing Bindings right now, and not expericing it in a C example... so it should be a binding error i will look into that

stb_truetype CVEs?

If I understand correctly there are a number of internal offsets in the code that don't validate against the overall buffer size, so there isn't any robustness to unsafe data (which is why stb_truetype.h warns users about that in their comments.) I would imagine RFont has the same limitations, since it uses stb_truetype code? If so, I was wondering if there might be any plans to make RFont more robust by adding the offset validations?

Very odd 'X' coordinate spacing for a few letters using a Helvetica font

Text using the Helvetica font in RFont usually looks fine, however in some instances some letters have very odd spacing that makes them look very awkward compared to the rest of the string. In the example below you can see that happening with the letter 'v', where it's off by a few pixels:
image

Using LibreOffice Writer, this is how I expect the text to look more or less:
image

And it isn't only with 'v'. "Button" suffers from the same issue, alongside many other random combinations of words.
image

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.