Verified Commit dbeb917c authored by Bernd Paysan's avatar Bernd Paysan
Browse files

Cartoon demo requires reopen font several times

parent e41528a2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -87,15 +87,21 @@ void init( void )
    font->rendermode = RENDER_OUTLINE_POSITIVE;
    font->outline_thickness = 7;
    add_text( buffer, font, "Freetype GL", pen, black, black );
    texture_font_close( font, MODE_ALWAYS_OPEN, MODE_FREE_CLOSE );

    font = texture_font_new_from_file( atlas, 128, "fonts/LuckiestGuy.ttf" );
    font->rendermode = RENDER_OUTLINE_POSITIVE;
    font->outline_thickness = 5;
    add_text( buffer, font, "Freetype GL", pen, yellow, yellow );
    texture_font_close( font, MODE_ALWAYS_OPEN, MODE_FREE_CLOSE );

    font = texture_font_new_from_file( atlas, 128, "fonts/LuckiestGuy.ttf" );
    font->rendermode = RENDER_OUTLINE_EDGE;
    font->outline_thickness = 3;
    add_text( buffer, font, "Freetype GL", pen, black, black );
    texture_font_close( font, MODE_ALWAYS_OPEN, MODE_FREE_CLOSE );

    font = texture_font_new_from_file( atlas, 128, "fonts/LuckiestGuy.ttf" );
    font->rendermode = RENDER_NORMAL;
    font->outline_thickness = 0;
    add_text( buffer, font, "Freetype GL", pen, orange1, orange2 );
+2 −2
Original line number Diff line number Diff line
@@ -815,8 +815,8 @@ cleanup_stroker:
	glyph->advance_x = slot->advance.x * self->scale;
	glyph->advance_y = slot->advance.y * self->scale;
    } else {
	glyph->advance_x = slot->advance.x / HRESf;
	glyph->advance_y = slot->advance.y / HRESf;
	glyph->advance_x = slot->advance.x * self->scale / HRESf;
	glyph->advance_y = slot->advance.y * self->scale / HRESf;
    }

    texture_font_index_glyph(self, glyph, ucodepoint);