DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

MTLTextureDescriptor failed assertion when trying to use dpg.font_registry()

Open Youjin1985 opened this issue 1 year ago • 1 comments

Version of Dear PyGui

Version: 1.11.1 Operating System: macOs 14.5

My Issue/Question

Cannot use custom fonts - any attempt to include dpg.font_registry() into the code leads to crash with message:

-[MTLTextureDescriptorInternal validateWithDevice:]:1357: failed assertion `Texture Descriptor Validation MTLTextureDescriptor has width of zero. MTLTextureDescriptor has height of zero.

To Reproduce

Steps to reproduce the behavior:

  1. save example code from "Font Loading Instructions" https://dearpygui.readthedocs.io/en/latest/documentation/fonts.html input python file. Place file NotoSerifCJKjp-Medium.otf at same path.
  2. run that python file
  3. See error

Expected behavior

Expected normal usage.

import dearpygui.dearpygui as dpg

dpg.create_context()

# add a font registry
with dpg.font_registry():
    # first argument ids the path to the .ttf or .otf file
    default_font = dpg.add_font("NotoSerifCJKjp-Medium.otf", 20)
    second_font = dpg.add_font("NotoSerifCJKjp-Medium.otf", 10)

with dpg.window(label="Font Example", height=200, width=200):
    dpg.add_button(label="Default font")
    b2 = dpg.add_button(label="Secondary font")
    dpg.add_button(label="default")

    # set font of specific widget
    dpg.bind_font(default_font)
    dpg.bind_item_font(b2, second_font)

dpg.show_font_manager()

dpg.create_viewport(title='Custom Title', width=800, height=600)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

Youjin1985 avatar Jul 05 '24 08:07 Youjin1985

same issue

-[MTLTextureDescriptorInternal validateWithDevice:]:1357: failed assertion `Texture Descriptor Validation
MTLTextureDescriptor has height (32768) greater than the maximum allowed size of 16384.

utmcontent avatar Sep 02 '24 10:09 utmcontent