Skip to content

Update makefont.c#271

Open
PanuiQ wants to merge 1 commit into
rougier:masterfrom
PanuiQ:patch-1
Open

Update makefont.c#271
PanuiQ wants to merge 1 commit into
rougier:masterfrom
PanuiQ:patch-1

Conversation

@PanuiQ

@PanuiQ PanuiQ commented Feb 23, 2023

Copy link
Copy Markdown

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

rougier commented Feb 27, 2023

Copy link
Copy Markdown
Owner

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

PanuiQ commented Mar 3, 2023

Copy link
Copy Markdown
Author

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

rougier commented Mar 17, 2023

Copy link
Copy Markdown
Owner

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