Git Product home page Git Product logo

bitmapfonts's People

Contributors

xeekworx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

glitched-manual

bitmapfonts's Issues

xwfont_library needs to utilize the OpenGL loader for shared

An OpenGL loader exists in the project as xwfglad; basically using dav1d's glad with the prefixes changed so that they don't collide with any library user's glad (if they use it).

If the xwfont_library is built as a shared library (intended for use in C# tools in the future) then the included glad loader needs to actually be utilized so the OpenGL functions used by the NanoVG or future OpenGL rendering backends aren't bad pointers.

It currently works for static builds, because it relies on the library user to load enough of OpenGL for the library to work. It is technically their responsibility. I've not designed the xwfont_library to work outside of static builds unless it's for font generation in future tools that I haven't built yet.

OpenGL Rendering Backend

So far just SDL and NanoVG renderers exist. I would like to also have an OpenGL renderer (granted NanoVG somewhat covers that already). After this is added, eventually I'll be able to add Signed Distance Field features to the font, but those features will be ignored / unused in the SDL and NanoVG renderers.

To create a new renderer for OpenGL, look at renderer_nanovg for clues on what to do. You derive from renderer_base and make sure these functions are overridden (the top three being the most important):

  • on_create_image
  • on_destroy_image
  • on_draw_image
  • on_draw_line
  • on_draw_rect
  • on_fill_rect

If you do not implement on_draw_line, on_draw_rect, and on_fill_rect, be sure to still override those functions, but not do anything within them. The disadvantage is if I implement a feature that needs them (glyph backgrounds, underlined, or strikeout) then that feature just will not render.

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.