ssb22 / jianpu-ly

Jianpu in Lilypond
http://ssb22.user.srcf.net/mwrhome/jianpu-ly.html
Apache License 2.0
70 stars 18 forks source link

Hanzi lyrics auto space minor misalignment #18

Closed suntong closed 1 year ago

suntong commented 1 year ago

First time user here and thank you Mr. Silas S. Brown for providing such a wonderful tool to the jianpu world.

So I'm trying out the Hanzi lyrics auto space feature, and notice a minor misalignment in the .png file output:

image

(The previous with space version is above, and without space version is below)

Does it appear a bit misalignment to you as well please?

The test input file is https://github.com/suntong/jianpu/blob/master/Friends-%E6%9C%8B%E5%8F%8B2.jp

Comparing to the previous with space version, here are the differences I found in the generate .ly file:

-\new Lyrics = "IX" { \lyricsto "jianpu" { 這 些 年 一 個 人 風 也 過 雨 也 走 有 過 淚 有 過 錯 還 記 得 堅 持 什 麼 真 愛 過 才 會 懂 會 寂 寞 會 回 首 終 有 夢 終 有 你 在 心 中 } } 
+\new Lyrics = "IX" { \lyricsto "jianpu" { \override LyricText #'self-alignment-X = #LEFT 這 些 年 一 個 人 風 也 過 雨 也 走 有 過 淚 有 過 錯 還 記 得 堅 持 什 麼 真 愛 過 才 會 懂 會 寂 寞 會 回 首 終 有 夢 終 有 你 在 心 中 } } 
 >>

Please double check.
Again, all test files are under https://github.com/suntong/jianpu. thanks.

suntong commented 1 year ago

Pleas also take a look at the version of https://github.com/suntong/jianpu/blob/525578b30497f4c1807c667d483032bc4b358a81/Friends-%E6%9C%8B%E5%8F%8B2.jp

I.e., the Hanzi lyrics was arranged like this:

這些年 一個人 風也過 雨也走 有過淚 有過錯 還記得堅持什麼 ...

I.e., it is a more natural way to group words into sentences in Chinese.
If such format can produce as nice output as the with space version, that'd be wonderful.

suntong commented 1 year ago

If such format can produce as nice output as the with space version, that'd be wonderful.

Hmm, it turns out to be a bit challenging -- please take a look at
https://github.com/suntong/jianpu/blob/master/mmd-木棉道.png

and note the last line 愛 情 就 像, & 蟬 聲 綿 綿 斷, it should line up like this:

image

How to fix my input to get the desired output please?

ssb22 commented 1 year ago

Hi, the exact alignment might depend on which version of Lilypond you're using and which hanzi fonts are available on your system (which will be different on Windows, Mac, GNU/Linux etc) so this won't be easy to check. Also I am legally blind (which is kind-of why I am trusting Lilypond to do the right thing).

The reason why left alignment is used in hanzi auto-spacing is so that any word followed by , or 。 etc will have the , or 。 etc off to the right, without pushing the main character to the left. That's what it did before I put the 'left alignment' in. Obviously if you are not using , or 。 etc then you won't need left alignment.

Existing spaces in the input don't mean much when you use the H: option. This is so you can copy-paste lyrics from websites that put spaces in silly places when you copy-paste.

If you don't use the H: option, then you have a bit more control over the spacing. But the lyrics will still be spaced according to the music: if there's a long note, that will take more space no matter what word it is, because of the musical rule that long notes should always take more space than short notes.

suntong commented 1 year ago

Got it. Thanks!