-
Notifications
You must be signed in to change notification settings - Fork 43
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
Reach the translation glyph node by traverse_id() #1201
Conversation
LuaTeX-ja prepends custom whatsit nodes to store e.g. text direction, breaking hard-coded paths like startnode.head.next.head.next.head in the center_translation() function. This patch uses node.travese_id() to find our desired nodes instead. Fixes gregorio-project#1180
Looks good to me apart from two things:
|
Oh, also an entry should be added in the CHANGELOG.md file |
Actually, I think this is a valid candidate for a bug-fix to 4.1. It fixes a broken feature and only affects the files which are uploaded to CTAN, meaning we can push the update to TeXLive 2016 users who update via It still does need a CHANGELOG.md entry. |
@eroux Thank you for your review. I am sorry that I had been very busy and still haven't found the time too follow up, especially in providing test cases in the gregorio-tests repository. @rpspringuel Thank you so much for merging this pull request. Unfortunately, I encountered a bug Saturday afternoon when I tried to change the Chinese font used in the translation, using
It crashed here: local trans_width = node.dimensions(glyphnode) because "Good fonts" that work: "Adobe Ming Std", "Adobe Song Std", "AR PL UKai TW", "AR PL UMing TW", where a dump_nodes() would show this:
"Bad fonts" that would crash: STZhongSong, Fandol, cwTeXKai, HanWangMingBold etc.
So, my quick fix is to check for if glyphnode == nil then
glyphnode = get_first_node_by_id(hlist, hlistnode.head)
end Though probably it shouldn't be called a However, with STZhongSong and HanWangMingBold, there are the occasional translation text that are not quite centered but somehow shifted to the right. But that is a relatively minor issue that shouldn't hold up 4.1.5. So, @rpspringuel, would you like me to make a new pull request adding the check for (I will be at the computer this morning standing by. I will also try to upload my test files somewhere if you would like to take a look at them.) Thanks again! |
Oops, I see that I am too late (4.1.5 is out, yay!) No worries. Maybe for 4.1.6 then. I will make another pull request when I make progress (i.e. when the alignment is correct for all fonts.) Thank you all! |
Please do. Just be sure to submit a new PR against the |
@rpspringuel Thank you for the note about the And thank you to you all, all Gregorio authors, for making typesetting Gregorian chant possible on the computer! Here is Salve Regina with Chinese translation (not the official Chinese translation; it has been modified to try to fit the Latin text order while kind of making sense in Chinese, but hopefully can help our choir and parishioners learn it): |
LuaTeX-ja prepends custom whatsit nodes to store e.g. text direction,
breaking hard-coded paths like startnode.head.next.head.next.head
in the center_translation() function.
This patch uses node.travese_id() to find our desired nodes instead.
Fixes #1180