Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update makefont.c #271

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update makefont.c #271

wants to merge 1 commit into from

Conversation

PanuiQ
Copy link

@PanuiQ PanuiQ commented Feb 23, 2023

fix bug, in making Texture glyphs codes , if glyph->codepoint >256 , The curly braces of the generated file do not match

fix bug,  in  making Texture glyphs  codes , if  glyph->codepoint   >256 ,  The curly braces of the generated file do not match
@rougier
Copy link
Owner

rougier commented Feb 27, 2023

Can you explain what is the problem exactly? I don't see the line you're pointing. Also, why did you change the whole code?

@PanuiQ
Copy link
Author

PanuiQ commented Mar 3, 2023

Can you explain what is the problem exactly? I don't see the line you're pointing. Also, why did you change the whole code?
code

fprintf(file, " {\n");
    GLYPHS_ITERATOR1(i, glyph, font->glyphs) {
        fprintf(file, " {\n");
        GLYPHS_ITERATOR2(i, glyph, font->glyphs) {
            fprintf(file, "  &%s_glyph_%08x,\n", variable_name, glyph->codepoint);
        }
    else {
    fprintf(file, "  NULL,\n");
    }
    GLYPHS_ITERATOR_END1;
    fprintf(file, " },\n");
    } GLYPHS_ITERATOR_END2;

expand:

    fprintf(file, " {\n");
    for (int index = 0; index < vector_size(font->glyphs); index++)
    {
        {

            texture_glyph_t** __glyphs;
            fprintf(file, " {\n"); 
            if ((__glyphs = *(texture_glyph_t***)vector_get(font->glyphs, index)))
            {
                int __i;
                
                for (__i = 0; __i < 0x100; __i++) 
                {
                    if ((glyph = __glyphs[__i])) 
                    {
                        fprintf(file, "  &%s_glyph_%08x,\n", variable_name, glyph->codepoint);
                    }
                    else 
                    {
                        fprintf(file, "  NULL,\n");
                    }
                };
                fprintf(file, " },\n");
            }
         }
    };

__glyphs = *(texture_glyph_t***)vector_get(font->glyphs, index)
if __glyphs ==NULL, can,t run fprintf(file, " },\n")

1.zip
this file is maked with original code and delete texture data

@rougier
Copy link
Owner

rougier commented Mar 17, 2023

Sorry, my question is why did you remove the GLYPH_ITERATOR part ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants