-
-
Notifications
You must be signed in to change notification settings - Fork 973
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
feat(options): add modify_font option #5265
Conversation
only if there is a matching script name or a wildcard specified
@kovidgoyal would be good to get an early sense check on this PR i.e. the general approach, code style vs conventions etc. This essentially works (give or take some outstanding bug with unsigned ints and strike-through positioning) locally for the use case I described in the original comment I made, i.e. I'm able to change the thickness and height of the underline etc. I haven't done anything about the size of fonts yet since I'm less sure about how that functionality should work I guess somewhere in the codebase the cell size of each font including fallbacks is being determined, and I need to get the config value over to there. I appreciate you included this in the required feature set but presumably if a general mechanism for specifying font overrides in the config and them flowing through is done then this could maybe be added without needed a refactor i.e. at that point it's just an additional feature |
I'll review it when I have some time. cell sizes are calculated only for baseline adjustment probably needs to be per font face as well. |
rather than unsigned ints
@kovidgoyal thanks for clarifying so if I understand correctly based on
Cell size is calculated for only the main ("medium") face here Line 338 in b0666c9
and currently all the other fonts inherit this calculation? So when you say size, since you've clarified you don't mean cell size what dimension specifically do you mean you've mentioned the baseline, so you mean altering the baseline for non-main fonts similar to how it is altered in Apologies if you're having to go over this a few times, I've honestly never dealt with font rendering or anything in this area. I don't think I even know what the outcome of setting adjust size is supposed to actually look like, are these specific fonts now supposed to appear higher or lower in the cell or actually smaller or larger within the cell (I didn't/don't even know if that's possible) FWIW the rest of it now works, i.e. strikethrough/underline positions and thickness |
adjust_font_size should adjust the actual pt size used to render Currently what happens is the alternate font's size is set to the same And yes changing of baseline can either be automatic as it is currently |
Thanks for implementing this @kovidgoyal 🙏🏿 and for your patience with my attempt 👍🏿 |
You're welcome! |
This fixes the issue of not being able to modify a font attributes, namely the
underline_thickness
,strikethrough_position
,underline_position
and (eventually)size
. It supersedes #4723.To-do:
modify_font
*_position
as neither currently move the line down nor up.int
but maybe should accept%
forsize
Notes for review:
I'm largely new to python and c so any formatting issues or method usages etc. feel free to correct as I've just focused on getting something working and don't know what the best practices are.