Immediate-Mode-UI / Immediate-Mode-UI/Nuklear

What compression does Nuklear use for fonts?

Open
#819 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
11.4k
Forks
686
Avg merge
4d 1h
Merged PRs (30d)
3

Description

I want to add a font to my project by encoding it in base85 using the function `nk_font_atlas_add_compressed_base85`. Adding a base85 encoded ttf font in this way results in a segfault, when calling `nk_sdl_font_stash_end`, which I suppose is because I need to somehow compress the font before encoding it in base85.
Surprisingly this function does not have a non compressed counterpart. I found out it uses a function `nk_decompress` internally. How should I compress my font, so it can be decompressed using this function? There is no `nk_compress`.

Contributor guide

Open the contributing guide

Research direction

Start by reading nk_font_atlas_add_compressed_base85 and nk_decompress, then trace the call from nk_sdl_font_stash_end that produces the segfault. Determine the compression format expected by nk_decompress and document how a font should be prepared, or clarify whether this API is unsupported without a corresponding compressor.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
frontend
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.