obynio / anki-japanese-furigana

Anki add-on providing support for adding furigana on Japanese text
https://ankiweb.net/shared/info/678316993
GNU General Public License v3.0
21 stars 7 forks source link

Perceived Extra Spacing Between Furigana Characters #40

Open NJJ96 opened 1 month ago

NJJ96 commented 1 month ago

It would seem to be the case that there is occasionally some extra space between furigana characters, especially at larger font sizes, and with different fonts. This is kind of a nitpick, but it can become something of a nuisance at times, visually-and-aesthetically-speaking. It's entirely possible that I'm not styling something properly or failing to properly account for font customizations; hopefully the images below serve to illustrate the issue that I'm trying to convey:

Anticipated spacing and seemingly appropriate character width, as seen from Browse window (with default Arial font applied to the relevant field):

AnticipatedSpacing

Anticipated spacing and seemingly appropriate character width, as seen from the Browse window (with Yu Gothic UI Semibold font applied to the relevant field):

AnticipatedSpacing1

Actual spacing and actual character width, with highlights on the individual furigana characters, as seen on the card preview on desktop (with Yu Gothic UI Semibold font applied; perceived extra spacing seems to transfer to mobile as well)

SpaceBetweenFurigana SpaceBetweenFuriganaHighlight1 SpaceBetweenFuriganaHighlight2

Are there any particular methods for addressing this, or is this a valid issue?

NJJ96 commented 1 month ago

I failed to specify: the images are from a Windows desktop, but the behavior does appear to replicate on iOS, at least.

obynio commented 1 month ago

Hey, well we can try to trim spaces this but it might break other people formatting that uses spaces. The space are inserted by Mecab, not by the plugin, and we don't have control over Mecab development (which stopped long time ago...). We are just hacking our way through Mecab outputs 😢

I'll try to give it a try next time I'm working on the plugin!

NJJ96 commented 1 month ago

Much appreciated! If it helps at all, I think that I’ve managed to apply some styling that at least somewhat addresses the horizontal and vertical spacing on desktop, and seems to address only the horizontal spacing on mobile (at least for iOS).

Also hoping that this is helpful without adding complexity, I’ve noticed a few more things while tinkering around:

  1. Adjusting the text-size styling property on the fields with kanji after the add-on has applied the furigana will reintroduce spacing issues, regardless of additional styling.
  2. On iOS, when adjusting the text display size for cards, it appears that (and this is just a guess) any vertical space between furigana and kanji characters scales with the size of the text (see images below, ranging from 1.0x scale to 1.3x scale)

IMG_3113 IMG_3114 IMG_3115 IMG_3116