fix synthetic font application - #13606
Conversation
mitchellh
left a comment
There was a problem hiding this comment.
This code quality has major issues. It looks like undisclosed AI to me. If its AI, then I suspect you can learn yourself how to fix it.
|
@mitchellh I don't know the Ghostty team's internal design decisions beyond the comments provided in the code currently, so I wanted to keep my footprint minimal (or at least what I thought was minimal; granted, in retrospect, putting the changes where they are now probably wasn't the best idea). I understand that it is not anyone's responsibility to teach me to code here. However, more specific guidance about your objection, whether it's my code placement, the "style" I used, or something else, would help me correct the changes. I'd rather not try to guess at the project's intended design constraints. This all being said, I would appreciate some clarification on the following questions before I attempt to implement anything more robust:
I really like Ghostty, and would still like to address this issue correctly, but I currently lack a full idea of the expected behavior. |
If this the case, I will dedicate the time to perform a helpful review. When its AI I don't because the person on the other side often doesn't reciprocate, but in this case I shall. Stand by. |
…ace but for which fontconfig returns non-italic/bold face on query
16d0b97 to
ae7bd53
Compare
|
After more trial and error than anticipated, I managed to clean up the implementation following your guidance (even managed to remove the need for converting from int to enum entirely). I couldn't find any way to make it more compact and still handle all(?) the edge cases. Thank you for taking the time to provide comments on my initial implementation. I'm sorry it was subpar, but I shall keep your suggestions in mind for the future. Some notes:
|
Fix synthetic font application for fonts without native italic/bold face but for which fontconfig returns non-italic/bold face on query.
First reported in: #13583
Edit:
I truly apologize for not including this earlier, I was a tad overeager after my vouch request was approved and I was quite rushed and ended up creating this pull request on my phone during lunch and had several errands afterwards.
AI Usage Disclaimer:
GPT 5.6 Sol was used to understand the project structure. Specifically, I basically asked it to look at the codebase and tell me what files/functions were relevant to how Ghostty applies synthetic fonts. From there, I simply used ZLS to jump definitions until I found what I thought was the right spot.