Skip to content

Commit

Permalink
Merge branch 'master' into release-4.2
Browse files Browse the repository at this point in the history
* master:
  Cherry pick fc54014
  Bump Copyright year.
  Change package loading order to account for TeXLive 2016
  Cherry pick 54bc8b8
  Load PlainTeX version of xstring
  Cherry pick ca8b226
  Update Version number
  CHANGELOG entries
  Fix issue with custom spaces
  Reach the translation glyph node by traverse_id()
rpspringuel committed Aug 22, 2016
2 parents ba1fb79 + 0573531 commit c656371
Showing 2 changed files with 28 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/).
[Unreleased][unreleased]
### Fixed
- When the note after an oriscus is at the same pitch, the oriscus will now point downwards by default (see [#1177](https://github.com/gregorio-project/gregorio/issues/1177)).
- With thanks to Claudio Beccari (@OldClaudio), adding a commentary no longer generates a bad `\hbox` during TeX processing (see [#1202](https://github.com/gregorio-project/gregorio/issues/1202)).
- When the last note in a score is not in the last syllable, it no longer merges into the (no-note) syllable(s) that follow (see [#1205](https://github.com/gregorio-project/gregorio/issues/1205)).

### Changed
@@ -97,6 +96,12 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/).
- `\greemergencystretch`


## [4.1.5] - 2016-08-18
### Fixed
- Use node.travese_id() to find our desired nodes when doing translation centering across syllables, thereby preventing a conflict with other packages which insert nodes (such as luatex-ja). See [#1180](https://github.com/gregorio-project/gregorio/issues/1180).
- Explicitly communicate the rescaling of `\gre@skip@temp@four` back to TeX, thereby fixing the problem with custom spacings. See [#1199](https://github.com/gregorio-project/gregorio/issues/1199).
- With thanks to Claudio Beccari (@OldClaudio), adding a commentary no longer generates a bad `\hbox` during TeX processing (see [#1202](https://github.com/gregorio-project/gregorio/issues/1202)).

## [4.1.4] - 2016-05-29
### Fixed
- Package conflict with luatex-ja also affected the custos. Have now fixed that problem too. See [this thread](http://www.mail-archive.com/[email protected]/msg03520.html).
25 changes: 22 additions & 3 deletions tex/gregoriotex.lua
Original file line number Diff line number Diff line change
@@ -392,6 +392,13 @@ local function dump_nodes(head)
log('--end dump--')
end

-- helper function for center_translation()
local function get_first_node_by_id(id, head)
for n in traverse_id(id, head) do
return n
end
end

local function center_translation(startnode, endnode, ratio, sign, order)
-- total width between beginning the two centering points
local total_width = node.dimensions(ratio, sign, order, startnode, endnode)
@@ -406,12 +413,23 @@ local function center_translation(startnode, endnode, ratio, sign, order)
-- \kern 0pt
-- }
--
-- While normally we could use startnode.head.next.head.next.head
-- to reach the translation (glyph node), packages such as LuaTeX-ja
-- may have, for example, prepended a whatsit node to each list
-- to store e.g. text direction, moving our translation glyph node to
-- startnode.head.next.next.head.next.next.head.next instead.
--
-- To avoid unpleasant surprises, let's search for each desired node
-- by its type:
local vlistnode = get_first_node_by_id(vlist, startnode.head)
local hlistnode = get_first_node_by_id(hlist, vlistnode.head)
local glyphnode = get_first_node_by_id(glyph, hlistnode.head)
-- hence translation width is:
local trans_width = node.dimensions(startnode.head.next.head.next.head)
local trans_width = node.dimensions(glyphnode)
-- now we must transform the kern 0pt into kern Xpt and kern -Xpt where X is:
local X = (total_width - trans_width) / 2
startnode.head.kern = X
startnode.head.next.next.kern = -X
vlistnode.prev.kern = X
vlistnode.next.kern = -X
end

local debug_types_activated = {['linesglues'] = false}
@@ -1204,6 +1222,7 @@ end
local function scale_space(factor)
local skip = tex.getskip('gre@skip@temp@four')
skip.width = skip.width * factor
tex.setskip('gre@skip@temp@four',skip)
-- should skip.stretch and skip.shink also be scaled?
end

0 comments on commit c656371

Please sign in to comment.