-
Notifications
You must be signed in to change notification settings - Fork 11
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
Create a config file to allow changing default styling. #42
Comments
Hi @zecuse thank you for the input. You’re right that with an update of the add-on you’re changes are most likely to be overwritten. As for the changes you made. Can you not make those by adjusting your card style CSS? Here are some examples from the add-on page on Ankiweb:
If any of the changes you want to make can not be done with CSS, please let me know what they are. I that case adding a config would be a viable option and something I could implement. |
Using CSS is one way to make some changes, but because the small hiragana are still just a Also, as I mentioned, I had to very slightly adjust the horizontal spacing of the circles to get the hiragana back under the center of each of them. I saw you did that with just a bit of math based on the index of each hiragana. That (I'm fairly certain) definitely can't be adjusted with CSS given they're calculated indirectly in relation to how big the hiragana are. Clearly you meant for the hiragana and circles to line up. Here's the edits I made in particular: From the return in line 41 of draw_pitch.py: return ('<text x="{}" y="67.5" style="font-size:28px;font-family:sans-'
'serif;fill:#000;">{}</text><text x="{}" y="67.5" style="font-'
'size:19px;font-family:sans-serif;font-weight:bold;fill:#000;">{}</text>'
).format(x-5, mora[0], x+20, mora[1]) Font sizes were increased and the small hiragana were made bold to appear as thick as the normal hiragana. Same size update in line 38 btw. I realize I could move these tag edits into the CSS of the card if I instead just gave each From line 73 in the same file: This obviously increased the horizontal distance between the circles due to the font being larger. Unless there's some advanced wizardry one can do with CSS that I'm not familiar with (I've seen videos of people making animations with just CSS!), I don't think you can do this type of math operation with CSS alone. Along with |
I see this add-on doesn't use a config file. I've applied my own edits directly to draw_pitch.py to slightly increase the font size and weight and the width of the graph so everything fits this new size better. Seeing how you're already handling the x position of each mora in the text function, could a config file be created that exposes these styling options to the user without needing to manually edit the script? If the add-on is updated in the future, won't my current edits be lost because they aren't part of a config? Default config values can come from the current hard coded values.
The text was updated successfully, but these errors were encountered: