Skip to content

Commit

Permalink
use class versions of save/restore fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
dk committed Nov 25, 2024
1 parent e84888a commit 07dd7b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion class/Drawable/mapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ Drawable_switch_font_internal( Handle self, SaveFont *f, uint16_t fid, Bool quic
return true;

if ( fid == 0 ) {
Drawable_restore_font( self, f );
my->restore_font( self, f );
return true;
}

Expand Down
8 changes: 4 additions & 4 deletions class/Image/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ plot_next_glyph(
int default_advance = 0, bpp;

if ( t->fonts )
if ( !Drawable_switch_font(self, savefont, t->fonts[i]))
if ( !my->switch_font(self, savefont, t->fonts[i]))
return true;

if ( downgrade_glyph )
Expand Down Expand Up @@ -476,18 +476,18 @@ plot_glyphs( Handle self, PGlyphsOutRec t, int x, int y )
Image_color2pixel( self, c, ctx.color);
}

Drawable_save_font( self, &savefont );
my->save_font( self, &savefont );
for ( i = 0; i < t->len; i++) {
if ( !plot_next_glyph(
self, t,
i, flags, emulate_mono_alpha, &o, &advance, straight, matrix, pos_matrix,
&ctx, &savefont
)) {
Drawable_restore_font( self, &savefont );
my->restore_font( self, &savefont );
return false;
}
}
Drawable_restore_font( self, &savefont );
my->restore_font( self, &savefont );

if ( var-> font.style & (fsUnderlined|fsStruckOut) )
draw_lines( self, advance, matrix, straight, flags & ggoMonochrome, emulate_mono_alpha, color, &ctx, &gp_save);
Expand Down

0 comments on commit 07dd7b7

Please sign in to comment.