Immediate-Mode-UI / Nuklear

A single-header ANSI C immediate mode cross-platform GUI library
https://immediate-mode-ui.github.io/Nuklear/doc/index.html
Other
9.06k stars 542 forks source link

Using the default Font "nk_proggy_clean_ttf_compressed_data_base85" #546

Closed hexaredecimal closed 5 months ago

hexaredecimal commented 1 year ago

Hello Nuklear community. I recently stumbled across your wonderful UI library and I'm now an addict. I would like to port it to a hobby operating system that I'm working on. It's working fine, even has userspace programs that are actual elf executables. I am facing an issue with using the default font "nk_proggy_clean_ttf_compressed_data_base85". The font is part of the library but it is not documented anywhere. I would like to know how can I use this "internal font" instead of using ttf fonts from the file system. I don't mind loading a ttf font but I would like to use the nk_proggy_clean_ttf_compressed_data_base85 font if that is possible.

If you know how please help, I would very much appreciate it. Thank you.

eleriaqueen commented 1 year ago

I'm unfamiliar with Nuklear but from the looks of it "nk_proggy_clean_ttf_compressed_data_base85" must be the default font.

Actually, a quick text search in nuklear.h would have given you all the info you needed...

/* ---------------------------------------------------------------------------
 *
 *                          DEFAULT FONT
 *
 * ProggyClean.ttf
 * Copyright (c) 2004, 2005 Tristan Grimmer
 * MIT license (see License.txt in http://www.upperbounds.net/download/ProggyClean.ttf.zip)
 * Download and more information at http://upperbounds.net
 *-----------------------------------------------------------------------------*/

#ifdef NK_INCLUDE_DEFAULT_FONT

NK_GLOBAL const char nk_proggy_clean_ttf_compressed_data_base85[11980+1] =