sandflow / imscJS

JavaScript library for rendering IMSC Text and Image Profile documents to HTML5
BSD 2-Clause "Simplified" License
84 stars 31 forks source link

change of scheme for rubyReserve. #235

Open btsimonh opened 2 years ago

btsimonh commented 2 years ago

Create a real ruby with real characters, but ensure it has no width and is not visible. Add it before other content on the line. For 'both' add two, one for above, and one for below. This works for Chrome and Firefox. Note: the browser detection has been disabled but not removed. -webkit should no longer be required, and firefox and chrome seem to have similar behaviour now.

I spent a lot of time examining position of text with and without rubies. The addition of 'fake' rubies may not be the best way to go - using margin/padding may be better? I think the browser implementations are still young...

btsimonh commented 2 years ago

please compare existing tests in Chrome and Firefox. You can compare here: https://imsc-rosetta.github.io/imsc-rosetta-qualify/ with 'legacy' and 'patched' renderer. I'm not saying it's perfect, but it does need to work.

btsimonh commented 2 years ago

also addresses https://github.com/sandflow/imscJS/issues/236

palemieux commented 1 year ago

@btsimonh I think this is a Chrome bug

btsimonh commented 1 year ago

irrespective, the proposed scheme works in both Chrome and Firefox. I'm not sure if the browsers even considered such things as reserving space for rubies.... :). It may be more efficient to pre-create rubyover and rubyunder ahead of time, and clone them for the lines.