hoffstadt/DearPyGui

dpg.add_char_remap() only works for the last added font

Vasile4ek opened this issue · 0 comments

DPG Version: 1.10.1
Operating System: Windows 10

dpg.add_char_remap() only works for the last added font in the case of inputs

dpgremap

Steps to reproduce

  1. set "font_path"
  2. run the code
  3. Enter the № character from the keyboard in the input field
  4. move the slider from 10 to 29
import dearpygui.dearpygui as dpg

font_path = "Roboto-Light.ttf"

dpg.create_context()

with dpg.font_registry():
    for size in range(10, 30):
        with dpg.font(font_path, size=size, tag=f"Font-{size}") as font:
            #  "№"
            dpg.add_font_chars([0x2116])
            dpg.add_char_remap(0x00B9, 0x2116)

with dpg.window() as main_window:
    dpg.add_input_text()
    dpg.add_text("№")
    dpg.add_slider_int(default_value=15, min_value=10, max_value=29, callback=lambda s, d: dpg.bind_item_font(main_window, f"Font-{d}"))

dpg.bind_item_font(main_window, "Font-15")

dpg.create_viewport()
dpg.setup_dearpygui()
dpg.set_primary_window(main_window, True)
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()