egui icon indicating copy to clipboard operation
egui copied to clipboard

Fix: ctx.set_fonts() Doesn't Apply Fonts with Same Name

Open rustbasic opened this issue 1 year ago • 2 comments

Fix: ctx.set_fonts() Doesn't Apply Fonts with Same Name

If a font file named my_font is set using ctx.set_fonts() and then another font file with the same name is set again using ctx.set_fonts(), it won't be applied.

  1. Additionally, it's recommended to apply fonts immediately using ctx.set_fonts().
  2. This will also allow to reset the fonts and texture.
  • Related #5233
  • Closes #5252
  • Related #5253
  • Related #5228
  • Related #5276

rustbasic avatar Nov 03 '24 07:11 rustbasic

Preview available at https://egui-pr-preview.github.io/pr/5345-patch146 Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

github-actions[bot] avatar Nov 03 '24 07:11 github-actions[bot]

I agree with the suggestion to remove the comparison check in set_fonts, as it seems unnecessary in most cases and could improve performance.

However, I'm not entirely convinced about the need for real-time updates (applying fonts immediately). While real-time updates might be useful in some scenarios, the current behavior of applying changes in the next frame is generally sufficient.

lalala-233 avatar Jan 03 '25 10:01 lalala-233