a bit of btex stuffs

This commit is contained in:
minjaesong
2024-10-11 19:09:48 +09:00
parent 60e54c2bc0
commit 2b4ff12659
2 changed files with 8 additions and 6 deletions

View File

@@ -241,8 +241,8 @@
<p>The argument key <code>%1$s</code> will be replaced into a number, Roman numerals, etc.
depending on the value of <code>type</code> attribute.</p>
<p>These macros can be used to localise the chapter headings for your language. For example,
in Korean text, the following idiomatic definition will be useful:</p>
<p>These macros can be used to localise the chapter headings into your language. For example,
in Korean text, the following idiomatic definition will be desirable:</p>
<callout align="left" class="code">&lt;macrodef&gt;<br/><!--
-->  &lt;pair key="thepart" value="제%1$s부"/&gt;<br/><!--

View File

@@ -1577,35 +1577,37 @@ object BTeXParser {
// add ornamental column on the left
it.first.forEach {
it.extraDrawFun = { batch, x, y ->
val yoff = -2
val oldCol = batch.color.cpy()
batch.color = DEFAULT_ORNAMENTS_COL.cpy().also { it.a *= bodyTextShadowAlpha }
Toolkit.fillArea(batch,
x - (indent - 2),
y + doc.lineHeightInPx,
y + doc.lineHeightInPx + yoff,
7f,
1 + (it.lineCount - 1).coerceAtLeast(1) * doc.lineHeightInPx.toFloat()
)
batch.color = DEFAULT_ORNAMENTS_COL
Toolkit.fillArea(batch,
x - (indent - 2),
y + doc.lineHeightInPx,
y + doc.lineHeightInPx + yoff,
6f,
(it.lineCount - 1).coerceAtLeast(1) * doc.lineHeightInPx.toFloat()
)
batch.color = oldCol
}
it.extraPixmapDrawFun = { pixmap, x, y ->
val yoff = -2
pixmap.setColor(DEFAULT_ORNAMENTS_COL.cpy().also { it.a *= bodyTextShadowAlpha })
pixmap.fillRectangle(
x - (indent - 2),
y + doc.lineHeightInPx,
y + doc.lineHeightInPx + yoff,
7,
1 + (it.lineCount - 1).coerceAtLeast(1) * doc.lineHeightInPx
)
pixmap.setColor(DEFAULT_ORNAMENTS_COL)
pixmap.fillRectangle(
x - (indent - 2),
y + doc.lineHeightInPx,
y + doc.lineHeightInPx + yoff,
6,
(it.lineCount - 1).coerceAtLeast(1) * doc.lineHeightInPx
)