File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -779,8 +779,17 @@ pub const Element = struct {
779779 self .type .button .text = new_text ;
780780 self .type .button .translated = new_translated ;
781781 if (new_translated .len > 0 ) {
782- if (display .generate_text_texture (self .type .button .translated , self .type .button .font )) | texture | {
783- self .type .button .text_texture = texture ;
782+ if (self .type .button .font_name != null ) {
783+ trace ("use requested font '{s}' for {s}" , .{ self .type .button .font_name .? , self .type .button .translated });
784+ if (display .generate_text_texture (self .type .button .translated , self .type .button .font )) | texture | {
785+ self .type .button .text_texture = texture ;
786+ }
787+ } else {
788+ const font = @import ("chunker.zig" ).guess_language (self .type .button .translated , display );
789+ trace ("use detected font '{s}' for {s}" , .{ font .name , self .type .button .translated });
790+ if (display .generate_text_texture (self .type .button .translated , font )) | texture | {
791+ self .type .button .text_texture = texture ;
792+ }
784793 }
785794 }
786795 },
You can’t perform that action at this time.
0 commit comments