Skip to content

Commit

Permalink
Merge tag 'v0.14.17' into develop
Browse files Browse the repository at this point in the history
chore(release): 0.14.17
  • Loading branch information
alerque committed Feb 7, 2024
2 parents 1109e76 + 4276c71 commit 4293318
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 35 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,18 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.14.17](https://github.com/sile-typesetter/sile/compare/v0.14.16...v0.14.17) (2024-02-07)


### Features

* **languages:** Enable explicit hyphen repetition handling in Croatian ([c29545d](https://github.com/sile-typesetter/sile/commit/c29545dd6f60bc01dc71de82f88274feff3b0fdf))
* **languages:** Enable explicit hyphen repetition handling in Czech ([b05d621](https://github.com/sile-typesetter/sile/commit/b05d6211b2c3daf9d8a69d7c4db75f430a86eea6))
* **languages:** Enable explicit hyphen repetition handling in Portuguese ([2a58d96](https://github.com/sile-typesetter/sile/commit/2a58d9684848ad7475e879191058d0c59de8e3c5))
* **languages:** Enable explicit hyphen repetition handling in Slovak ([82640b0](https://github.com/sile-typesetter/sile/commit/82640b03cdc82356a1ea9bbffbb4f5fd2471e3a2))
* **languages:** Enable explicit hyphen repetition handling in Spanish ([8db7f23](https://github.com/sile-typesetter/sile/commit/8db7f238fb63c86ee0d49bd34afd6a35a03f8eb8))
* **packages:** Add balancing option to makecolums command ([#1950](https://github.com/sile-typesetter/sile/issues/1950)) ([b5ce8e6](https://github.com/sile-typesetter/sile/commit/b5ce8e615c5e22c087ea8c8c6f7e30266e0f8634))

### [0.14.16](https://github.com/sile-typesetter/sile/compare/v0.14.15...v0.14.16) (2024-01-27)


Expand Down
2 changes: 1 addition & 1 deletion action.yml
Expand Up @@ -7,7 +7,7 @@ inputs:
default: ""
runs:
using: docker
image: docker://ghcr.io/sile-typesetter/sile:v0.14.16
image: docker://ghcr.io/sile-typesetter/sile:v0.14.17
entrypoint: sh
args:
- -c
Expand Down
28 changes: 26 additions & 2 deletions documentation/c08-language.sil
Expand Up @@ -163,6 +163,19 @@ The default is \code{left}.
\set[parameter=languages.am.justification,value=centered]
\font[family=Noto Sans Ethiopic,language=am]{ሰላም፡ልዑል}

\begin[command=document-repeated-hyphen]{define}
According to \process typography conventions, when a break occurs at an explicit hyphen, the hyphen gets repeated at the beginning of the new line.
SILE automatically handles this.
\end{define}

\subsection{Croatian}

\document-repeated-hyphen{Croatian}

\subsection{Czech}

\document-repeated-hyphen{Czech}

\subsection{Esperanto}

\define[command=eo]{\font[language=eo]{\process}}
Expand All @@ -188,8 +201,19 @@ The size of these spaces is determined by

\subsection{Polish}

According to Polish typography conventions, when a break occurs at an explicit hyphen, the hyphen gets repeated at the beginning of the new line.
SILE automatically handles this.
\document-repeated-hyphen{Polish}

\subsection{Portuguese}

\document-repeated-hyphen{Portuguese}

\subsection{Slovak}

\document-repeated-hyphen{Slovak}

\subsection{Spanish}

\document-repeated-hyphen{Spanish}

\subsection{Turkish}

Expand Down
6 changes: 6 additions & 0 deletions languages/cs.lua
@@ -1,3 +1,9 @@
SILE.nodeMakers.cs = pl.class(SILE.nodeMakers.unicode)

-- According to Czech rules, when a break occurs at an explicit hyphen, the hyphen gets repeated on the next line...
SILE.nodeMakers.cs.handleWordBreak = SILE.nodeMakers.unicode._handleWordBreakRepeatHyphen
SILE.nodeMakers.cs.handlelineBreak = SILE.nodeMakers.unicode._handlelineBreakRepeatHyphen

SILE.hyphenator.languages["cs"] = {}
SILE.hyphenator.languages["cs"].patterns =
{
Expand Down
6 changes: 6 additions & 0 deletions languages/es.lua
@@ -1,3 +1,9 @@
SILE.nodeMakers.es = pl.class(SILE.nodeMakers.unicode)

-- According to Spanish rules, when a break occurs at an explicit hyphen, the hyphen gets repeated on the next line...
SILE.nodeMakers.es.handleWordBreak = SILE.nodeMakers.unicode._handleWordBreakRepeatHyphen
SILE.nodeMakers.es.handlelineBreak = SILE.nodeMakers.unicode._handlelineBreakRepeatHyphen

SILE.hyphenator.languages["es"] = {}
SILE.hyphenator.languages["es"].patterns =
{
Expand Down
6 changes: 6 additions & 0 deletions languages/hr.lua
@@ -1,3 +1,9 @@
SILE.nodeMakers.hr = pl.class(SILE.nodeMakers.unicode)

-- According to Croation rules, when a break occurs at an explicit hyphen, the hyphen gets repeated on the next line...
SILE.nodeMakers.hr.handleWordBreak = SILE.nodeMakers.unicode._handleWordBreakRepeatHyphen
SILE.nodeMakers.hr.handlelineBreak = SILE.nodeMakers.unicode._handlelineBreakRepeatHyphen

SILE.hyphenator.languages["hr"] = {}
SILE.hyphenator.languages["hr"].patterns =
{
Expand Down
29 changes: 3 additions & 26 deletions languages/pl.lua
@@ -1,31 +1,8 @@
SILE.nodeMakers.pl = pl.class(SILE.nodeMakers.unicode)

function SILE.nodeMakers.pl:handleWordBreak (item)
-- According to Polish rules, when a break occurs at an explicit hyphen,
-- the hyphen gets repeated at the beginning of the new line
if item.text == "-" then
self:addToken(item.text, item)
self:makeToken()
if self.lastnode ~= "discretionary" then
coroutine.yield(SILE.types.node.discretionary({
postbreak = SILE.shaper:createNnodes("-", self.options)
}))
self.lastnode = "discretionary"
end
else
self._base.handleWordBreak(self, item)
end
end

function SILE.nodeMakers.pl:handleLineBreak (item, subtype)
if self.lastnode == "discretionary" then
-- Initial word boundary after a discretionary:
-- Bypass it and just deal with the token.
self:dealWith(item)
else
self._base.handleLineBreak(self, item, subtype)
end
end
-- According to Polish rules, when a break occurs at an explicit hyphen, the hyphen gets repeated on the next line...
SILE.nodeMakers.pl.handleWordBreak = SILE.nodeMakers.unicode._handleWordBreakRepeatHyphen
SILE.nodeMakers.pl.handlelineBreak = SILE.nodeMakers.unicode._handlelineBreakRepeatHyphen

SILE.hyphenator.languages["pl"] = {}
SILE.hyphenator.languages["pl"].patterns =
Expand Down
6 changes: 6 additions & 0 deletions languages/pt.lua
@@ -1,3 +1,9 @@
SILE.nodeMakers.pt = pl.class(SILE.nodeMakers.unicode)

-- According to Portuguese rules, when a break occurs at an explicit hyphen, the hyphen gets repeated on the next line...
SILE.nodeMakers.pt.handleWordBreak = SILE.nodeMakers.unicode._handleWordBreakRepeatHyphen
SILE.nodeMakers.pt.handlelineBreak = SILE.nodeMakers.unicode._handlelineBreakRepeatHyphen

SILE.hyphenator.languages["pt"] = {}
SILE.hyphenator.languages["pt"].patterns =
{
Expand Down
6 changes: 6 additions & 0 deletions languages/sk.lua
@@ -1,3 +1,9 @@
SILE.nodeMakers.sk = pl.class(SILE.nodeMakers.unicode)

-- According to Slovak rules, when a break occurs at an explicit hyphen, the hyphen gets repeated on the next line...
SILE.nodeMakers.sk.handleWordBreak = SILE.nodeMakers.unicode._handleWordBreakRepeatHyphen
SILE.nodeMakers.sk.handlelineBreak = SILE.nodeMakers.unicode._handlelineBreakRepeatHyphen

SILE.hyphenator.languages["sk"] = {}
SILE.hyphenator.languages["sk"].patterns =
{
Expand Down
27 changes: 27 additions & 0 deletions languages/unicode.lua
Expand Up @@ -193,6 +193,23 @@ function SILE.nodeMakers.unicode:handleWordBreak (item)
end
end

function SILE.nodeMakers.unicode:_handleWordBreakRepeatHyphen (item)
-- According to some language rules, when a break occurs at an explicit hyphen,
-- the hyphen gets repeated at the beginning of the new line
if item.text == "-" then
self:addToken(item.text, item)
self:makeToken()
if self.lastnode ~= "discretionary" then
coroutine.yield(SILE.nodefactory.discretionary({
postbreak = SILE.shaper:createNnodes("-", self.options)
}))
self.lastnode = "discretionary"
end
else
SILE.nodeMakers.unicode.handleWordBreak(self, item)
end
end

function SILE.nodeMakers.unicode:handleLineBreak (item, subtype)
-- Because we are in charge of paragraphing, we
-- will override space-type line breaks, and treat
Expand All @@ -211,6 +228,16 @@ function SILE.nodeMakers.unicode:handleLineBreak (item, subtype)
self.lasttype = chardata[cp] and chardata[cp].linebreak
end

function SILE.nodeMakers.unicode:_handleLineBreakRepeatHyphen (item, subtype)
if self.lastnode == "discretionary" then
-- Initial word boundary after a discretionary:
-- Bypass it and just deal with the token.
self:dealWith(item)
else
SILE.nodeMakers.unicode.handleLineBreak(self, item, subtype)
end
end

function SILE.nodeMakers.unicode:iterator (items)
local fulltext = ""
for i = 1, #items do
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "sile",
"version": "0.14.16",
"version": "0.14.17",
"description": "The SILE Typesetter",
"main": "sile",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions packages/frametricks/init.lua
Expand Up @@ -42,6 +42,7 @@ end
local makecolumns = function (options)
local cFrame = SILE.typesetter.frame
local cols = options.columns
local balanced = SU.boolean(options.balanced, true)
local gutterWidth = options.gutter or "3%pw"
local right = cFrame:right()
local origId = cFrame.id
Expand All @@ -58,8 +59,8 @@ local makecolumns = function (options)
bottom = cFrame:bottom(),
id = origId .. "_col"..i
})
newFrame.balanced = true
cFrame.balanced = true
newFrame.balanced = balanced
cFrame.balanced = balanced
gutter:constrain("right", "left("..newFrame.id..")")
newFrame:constrain("left", "right("..gutter.id..")")
-- In the future we may way to allow for unequal columns
Expand Down
3 changes: 0 additions & 3 deletions packages/raiselower/init.lua
Expand Up @@ -12,9 +12,6 @@ local function raise (height, content)
SILE.process(content)
SILE.typesetter:pushHbox({
outputYourself = function (_, typesetter, _)
if (type(typesetter.state.cursorY)) == "table" then
typesetter.state.cursorY = typesetter.state.cursorY.length
end
typesetter.frame:advancePageDirection(height)
end
})
Expand Down

0 comments on commit 4293318

Please sign in to comment.