Standardize Font Handling #60

Closed
opened 2024-03-09 20:54:16 +00:00 by john · 5 comments
Owner

43 feat: Caption font member, set outside of __init__, change font, etc. This is the "standardize font handling" feature, too. [depends on RAII]

See #4, #5 - not strict dependencies, but related work

43 feat: Caption font member, set outside of `__init__`, change font, etc. This is the "standardize font handling" feature, too. \[depends on RAII] See #4, #5 - not strict dependencies, but related work
john added the
Minor Feature
Alpha Release Requirement
labels 2024-03-09 20:54:16 +00:00
john added this to the All Datatypes Behaving milestone 2024-03-13 13:00:13 +00:00
john added this to the The Datatype Overhaul project 2024-03-13 13:06:39 +00:00
john added a new dependency 2024-03-13 13:14:54 +00:00
john removed a dependency 2024-03-13 13:15:45 +00:00
john added a new dependency 2024-03-13 13:21:55 +00:00
john removed a dependency 2024-03-13 13:22:02 +00:00
john added a new dependency 2024-03-13 14:46:15 +00:00
Author
Owner

Goal: Speed. Copy PyTexture for the structure of this object.

Goal: **Speed**. Copy `PyTexture` for the structure of this object.
Author
Owner

159658521c

I was hoping for a quick win, but this will take a little bit longer to not introduce instability.

I've also got default items added to the module, but mcrfpy.default_font fails the type check within UICaption's init. When executing type(mcrfpy.default_font), I get a segfault. So I'm obviously missing some step somewhere either to make the types fully available to Python, or to assign the type to new objects that I'm building in C++ with GenericAlloc and friends.

159658521c64a0cee8dd97ae7a2872a4eea2d9fa I was hoping for a quick win, but this will take a little bit longer to not introduce instability. I've also got default items added to the module, but `mcrfpy.default_font` fails the type check within UICaption's init. When executing `type(mcrfpy.default_font)`, I get a segfault. So I'm obviously missing some step somewhere either to make the types fully available to Python, or to assign the type to new objects that I'm building in C++ with GenericAlloc and friends.
john added spent time 2024-04-01 01:44:39 +00:00
1 hour 10 minutes
Author
Owner
https://discuss.python.org/t/instantiating-python-objects-from-c-segfault-on-type-obj-class-attribute-missing/50432 I'm on the Python Discussion boards asking what I'm doing wrong.
Author
Owner

commit: a19781b56a

notes on Python Discuss instance: https://discuss.python.org/t/instantiating-python-objects-from-c-segfault-on-type-obj-class-attribute-missing/50432/5

I used mcrfpy.default_texture / PyTextureType to determine the process.

  • fetch the fully initialized type from the post-initialization imported module with auto type = (PyTypeObject*)PyObject_GetAttrString(McRFPy_API::mcrf_module, "Texture"); (where the Python type attribute string is switched)
  • perform alloc / new steps on the custom type with tp_alloc or the C++ class's pynew static method.
  • sideload stuff into the struct as desired.
commit: a19781b56a87b68309e63c88e4eb68d22523267d notes on Python Discuss instance: https://discuss.python.org/t/instantiating-python-objects-from-c-segfault-on-type-obj-class-attribute-missing/50432/5 I used `mcrfpy.default_texture` / `PyTextureType` to determine the process. * fetch the **fully initialized** type from the **post-initialization imported module** with `auto type = (PyTypeObject*)PyObject_GetAttrString(McRFPy_API::mcrf_module, "Texture");` (where the Python type attribute string is switched) * perform alloc / new steps on the custom type with `tp_alloc` or the C++ class's `pynew` static method. * sideload stuff into the struct as desired.
john added spent time 2024-04-07 19:25:28 +00:00
2 hours
john deleted spent time 2024-04-07 19:25:39 +00:00
- 2 hours
Author
Owner

I'll add a separate issue to solve the type bug - that wasn't part of the Font feature.

I'll add a separate issue to solve the type bug - that wasn't part of the Font feature.
john closed this issue 2024-04-08 02:53:14 +00:00
john added spent time 2024-04-08 02:53:55 +00:00
1 hour 30 minutes
Sign in to join this conversation.
No Assignees
1 Participants
Notifications
Total Time Spent: 2 hours 40 minutes
john
2 hours 40 minutes
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: john/McRogueFace#60
No description provided.