glassfor.blogg.se

Bitmap font creator
Bitmap font creator




bitmap font creator

Create the font renderer, using SDL2 as chosen by the #define above: Xeekworx::bitmapfonts::xwf_font * font = xeekworx::bitmapfonts::generate_font(&config) Int sample_w = 1024, sample_h = 900 // Test environment dimentions Xeekworx::bitmapfonts::xwf_generation_config config Ĭonfig.font_path = "C:\\Windows\\Fonts\\tahoma.ttf" Ĭonfig.page_size = 1024 // Width, Height of the bitmaps

bitmap font creator

Configure the bitmapfont we want to generate: #define XWFONT_RENDERER_SDL // Choose your font renderer You'll see a similar example in the xwf_demo project in this repository. The SDL2 and NanoVG renderers are complete and comes with utility functions to start a test environment. Right now I'm working on the rendering for various rendering backends (sdl2, opengl, and nanovg). Currently only images files are saved, but eventually this glyph crammed image will be saved with another file (maybe json) with all of the glyph metrics. Glyph bitmaps are rendered using freetype2 and copied into an image right side up or rotated 90 degrees so that they can be crammed efficiently. Also, the font generator is implemented in mostly C so that it can be easily imported in C# for future tools. At some point the xwf_font_generator project will turn into a command-line tool used to generate font files that can be loaded for the renderer. The font generator is nearly complete, but functional if generated and used in memory. Here's an early sample of what's been accomplished so far: Currently fonts have to be generated before rendering because saving the font to a file is not yet supported. WARNING: This project has just begun so it may not be completely functional! The font generator, NanoVG renderer, and SDL2 renderer are functional. I've created a Visual Studio 2017 configuration in the freetype projects folder.Ī majority of the projects are in C++, but exposed as exportable C functions for use in an upcoming C# GUI application (XWFONT_API). You'll want to build freetype2 in the third-party directory before the xwfont projects can be built. This is an API and Tools to aid in use of custom Xeekworx Bitmap Fonts in games.






Bitmap font creator