FooSoft / yomichan

Japanese pop-up dictionary extension for Chrome and Firefox.
https://foosoft.net/projects/yomichan
Other
1.06k stars 213 forks source link

Add new structured content styling options #2203

Closed stephenmk closed 2 years ago

stephenmk commented 2 years ago

Allow for arbitrary string assignment to the font-size property.

Currently, only absolute font-size properties are allowed in styles specified by dictionaries. These font sizes do not scale when the popup scaling factor setting is adjusted in the "Popup Position & Size" section of the Yomichan settings. It would be useful if we could allow relative sizes (smaller, larger, 80%, etc.). I don't think there's any harm in allowing arbitrary strings in this field.

Test dictionary in popup at 100% scale ![scale100](https://user-images.githubusercontent.com/8003332/179905981-536b8477-682a-4646-a43d-2a17de819853.png)
Test dictionary in popup at 200% scale. The texts with absolute sizes remain the same. ![scale200](https://user-images.githubusercontent.com/8003332/179906108-cf9c6f81-a17c-4195-ad47-e2baa3d50120.png)
Cross-reference summaries in my JMdict dictionary which use this property ![summaries](https://user-images.githubusercontent.com/8003332/179906210-1c77ee41-4d0e-41fa-8962-237df4ac1b4d.png)

Add support for the text-align property.

The text-align property is needed to center content in table cells. I'd like to use this functionality in my new orthography dictionary.

Test dictionary demonstrating the text-align property ![align](https://user-images.githubusercontent.com/8003332/179906684-2a86de2a-d364-45ea-94a8-e3dbbddd5542.png)
Example from the orthography dictionary ![aligned](https://user-images.githubusercontent.com/8003332/179869261-bbbab7e4-7b39-4048-89ae-81db0856bf79.png)