Skip to content

PackFontRanges() creates a sigsegv crash #1377

Answered by heysokam
heysokam asked this question in Q&A
Discussion options

You must be logged in to vote

Been trying to figure out how to use stb_truetype.h to create a font bitmap atlas.
This is the code I have so far:
https://gist.github.com/heysokam/0270e3bcc36c6c0d537b476d5862dbc2#file-fontatlas-c-L291
As you can see, I haven't generated the chardata_for_range array, I just created an empty stbtt_packedchar struct, since I didn't know what to do with it.

As far as my understanding reaches (first year into programming) this data structure contains information that is stored in the font file itself?
But I don't know how to generate such data.

Is there existing documentation somewhere about this that I missed?
If not, how can one create the required array?

Replies: 6 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@nothings
Comment options

Answer selected by heysokam
Comment options

You must be logged in to vote
1 reply
@nothings
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1376 on September 19, 2022 04:40.