Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Youjin1985 opened this issue Jul 5, 2024 · 1 comment
Labels
state: pending not addressed yet type: bug bug

Comments

@Youjin1985
Copy link

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 Youjin1985 added state: pending not addressed yet type: bug bug labels Jul 5, 2024
@utmcontent
Copy link

utmcontent commented Sep 2, 2024

same issue

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: pending not addressed yet type: bug bug
Projects
None yet
Development

No branches or pull requests

2 participants