rsyntaxtree 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +27 -0
- data/CITATION.cff +1 -1
- data/Dockerfile +20 -2
- data/README.md +7 -0
- data/lib/rsyntaxtree/utils.rb +22 -4
- data/lib/rsyntaxtree/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9b9513e8d667af90de0a12e427eae11d0089f6a969ed1a47714ca30401001821
|
|
4
|
+
data.tar.gz: '0458b65b7f9ad1f495d344963b41b801b7c26562b0256abe48885756a1481bef'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d1738b00df2a2dbe5cafba5d52b19c44149472912c2859c8183384582770be0b54c0c4e96688fe4c0a808969c96096504956b7ce7dffc76bd3c682ee28124cf6
|
|
7
|
+
data.tar.gz: a8363b3b3e6b11f345603f020e36766275f740ab0f80af4ecb4be3f9160dd7860d4a26c4cdd2788a8b02e27d4c99d1147bd9843200cdd41cf48f87b6ce373e34
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.8.1] - 2026-08
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- Arabic rendered as isolated, unjoined letterforms in some environments.
|
|
7
|
+
Scripts outside Latin and CJK were left to the system's generic font
|
|
8
|
+
fallback, which is not the same font on every machine: on Alpine the Arabic
|
|
9
|
+
block was claimed by Noto Sans Math, which has the glyphs but no joining
|
|
10
|
+
rules, while on Debian the same text fell to DejaVu Sans. The family chains
|
|
11
|
+
now name the scripts the gallery covers — Arabic (`Noto Sans Arabic`, with
|
|
12
|
+
`Noto Naskh Arabic` for the serif style), Hebrew, Devanagari, Thai and
|
|
13
|
+
Khmer — so the same input renders the same way everywhere. Gallery example
|
|
14
|
+
067 (Arabic) was affected and has been regenerated.
|
|
15
|
+
- Emoji were measured with one font and drawn with another where a colour
|
|
16
|
+
emoji font was installed: Pango selects `Noto Color Emoji`, but the
|
|
17
|
+
librsvg/Cairo pipeline does not rasterise its bitmap glyphs, so the drawing
|
|
18
|
+
fell back to whatever outline font happened to cover the codepoint. The
|
|
19
|
+
project's Docker images now install the monochrome Noto Emoji and leave the
|
|
20
|
+
colour build out.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- The Docker images install the Noto packages for Arabic (including Naskh),
|
|
24
|
+
Hebrew, Devanagari, Thai and Khmer, and carry a fontconfig rule that removes
|
|
25
|
+
the Arabic ranges from Noto Sans Math while keeping its mathematical
|
|
26
|
+
alphanumerics (used for the little *v* of *v*P).
|
|
27
|
+
- Documentation records how to override any of the named families with a
|
|
28
|
+
fontconfig alias, for users who prefer their own script fonts.
|
|
29
|
+
|
|
3
30
|
## [1.8.0] - 2026-08
|
|
4
31
|
|
|
5
32
|
### Added
|
data/CITATION.cff
CHANGED
|
@@ -11,7 +11,7 @@ repository-code: "https://github.com/yohasebe/rsyntaxtree"
|
|
|
11
11
|
# Concept DOI: always resolves to the latest archived version on Zenodo
|
|
12
12
|
doi: "10.5281/zenodo.21916150"
|
|
13
13
|
license: MIT
|
|
14
|
-
version: 1.8.
|
|
14
|
+
version: 1.8.1
|
|
15
15
|
date-released: 2026-08-15
|
|
16
16
|
keywords:
|
|
17
17
|
- linguistics
|
data/Dockerfile
CHANGED
|
@@ -8,8 +8,26 @@ RUN apk update && \
|
|
|
8
8
|
apk add --no-cache librsvg librsvg-dev pango-dev imagemagick imagemagick-dev xz-dev libbz2 && \
|
|
9
9
|
apk add --no-cache gobject-introspection gobject-introspection-dev && \
|
|
10
10
|
apk add --no-cache -t .build-packages --no-cache build-base curl-dev wget gcompat && \
|
|
11
|
-
apk add --no-cache font-noto font-noto-cjk font-noto-cjk-extra
|
|
12
|
-
font-noto-arabic font-noto-
|
|
11
|
+
apk add --no-cache font-noto font-noto-cjk font-noto-cjk-extra \
|
|
12
|
+
font-noto-arabic font-noto-naskh-arabic font-noto-hebrew \
|
|
13
|
+
font-noto-devanagari font-noto-thai font-noto-khmer
|
|
14
|
+
|
|
15
|
+
# Noto Sans Math (pulled in by font-noto) claims the Arabic block but carries no
|
|
16
|
+
# joining rules, and fontconfig ranks it above Noto Sans Arabic — Arabic then
|
|
17
|
+
# renders as isolated letterforms. Keep the font, since trees use its
|
|
18
|
+
# mathematical alphanumerics (the little v of vP), but drop Arabic from it.
|
|
19
|
+
COPY dev/fontconfig/99-noto-math-no-arabic.conf /etc/fonts/conf.d/99-noto-math-no-arabic.conf
|
|
20
|
+
|
|
21
|
+
# Emoji: the monochrome Noto Emoji, not Alpine's font-noto-emoji (which is the
|
|
22
|
+
# colour NotoColorEmoji). Cairo does not rasterise its bitmap glyphs in this
|
|
23
|
+
# pipeline, so emoji would silently fall back to whatever outline font happens
|
|
24
|
+
# to cover them. Pinned to a google/fonts commit so the gallery stays stable.
|
|
25
|
+
ARG NOTO_EMOJI_SHA=b979dba422e445492b0eb9951ac52ee0b4d648c3
|
|
26
|
+
ARG NOTO_EMOJI_SHA256=de6c18832938afc99caf132b39d6a30a19bac7f2e812e28db2535b4608d27551
|
|
27
|
+
RUN mkdir -p /usr/share/fonts/noto-emoji && \
|
|
28
|
+
wget -q -O /usr/share/fonts/noto-emoji/NotoEmoji-Regular.ttf \
|
|
29
|
+
"https://raw.githubusercontent.com/google/fonts/${NOTO_EMOJI_SHA}/ofl/notoemoji/NotoEmoji%5Bwght%5D.ttf" && \
|
|
30
|
+
echo "${NOTO_EMOJI_SHA256} /usr/share/fonts/noto-emoji/NotoEmoji-Regular.ttf" | sha256sum -c -
|
|
13
31
|
|
|
14
32
|
|
|
15
33
|
ADD Gemfile $WORKSPACE
|
data/README.md
CHANGED
|
@@ -120,6 +120,13 @@ RSyntaxTree resolves fonts by family name through fontconfig (measurement via Pa
|
|
|
120
120
|
|
|
121
121
|
Any script supported by an installed font renders correctly — the family chains fall back from Noto Sans/Serif to the JP and CJK variants, so Japanese, Chinese (simplified and traditional) and Korean are covered by the Noto CJK package. As of v1.8.0 the gem no longer bundles font files (they were not used at runtime).
|
|
122
122
|
|
|
123
|
+
Scripts outside Latin and CJK need their own Noto package, or they render as tofu boxes. Since v1.8.0 the gem names these families explicitly (`Noto Sans Arabic`, `Noto Naskh Arabic`, `Noto Sans/Serif Hebrew`, `Devanagari`, `Thai`, `Khmer`) instead of leaving them to the system fallback, so install them to get the intended shapes:
|
|
124
|
+
|
|
125
|
+
- Debian/Ubuntu: `apt install fonts-noto-core` already covers them; on minimal images add `fonts-noto` for the full set
|
|
126
|
+
- Alpine: `apk add font-noto-arabic font-noto-naskh-arabic font-noto-hebrew font-noto-devanagari font-noto-thai font-noto-khmer`
|
|
127
|
+
|
|
128
|
+
Emoji need the **monochrome** [Noto Emoji](https://fonts.google.com/noto/specimen/Noto+Emoji); colour emoji fonts (`NotoColorEmoji`, shipped by Alpine's `font-noto-emoji` and Debian's `fonts-noto-color-emoji`) are measured but not drawn by the librsvg/Cairo pipeline, so emoji then fall back to whatever outline font happens to cover them.
|
|
129
|
+
|
|
123
130
|
## Installation
|
|
124
131
|
|
|
125
132
|
```bash
|
data/lib/rsyntaxtree/utils.rb
CHANGED
|
@@ -15,14 +15,32 @@ require 'pango'
|
|
|
15
15
|
# helpers format it for SVG (quoted) or for Pango::FontDescription#family
|
|
16
16
|
# (unquoted). Keeping a single source guarantees that measurement and
|
|
17
17
|
# rendering resolve through the same fallback chain.
|
|
18
|
+
#
|
|
19
|
+
# Scripts beyond Latin and CJK are named explicitly rather than left to the
|
|
20
|
+
# generic fallback, because the generic fallback is not the same font on every
|
|
21
|
+
# machine: on Alpine the Arabic block was picked up by Noto Sans Math, which
|
|
22
|
+
# has the glyphs but no joining rules and so rendered Arabic as isolated
|
|
23
|
+
# letters, while on Debian the same text fell to DejaVu Sans. A family is
|
|
24
|
+
# listed here when (i) the gallery has an example in that script, or (ii) a
|
|
25
|
+
# concrete environment-dependent failure has been reported for it. Anything
|
|
26
|
+
# else stays with the generic fallback — an unbounded list is unmaintainable.
|
|
27
|
+
SCRIPT_FAMILIES_SANS = ["Noto Sans Arabic", "Noto Sans Hebrew", "Noto Sans Devanagari", "Noto Sans Thai", "Noto Sans Khmer"].freeze
|
|
28
|
+
# Noto has no serif Arabic; Naskh is its serif-like counterpart, with Noto Sans
|
|
29
|
+
# Arabic behind it for systems that ship one but not the other.
|
|
30
|
+
SCRIPT_FAMILIES_SERIF = ["Noto Naskh Arabic", "Noto Sans Arabic", "Noto Serif Hebrew", "Noto Serif Devanagari", "Noto Serif Thai", "Noto Serif Khmer"].freeze
|
|
31
|
+
|
|
32
|
+
EMOJI_FAMILIES = ["OpenMoji", "OpenMoji Color", "OpenMoji Black", "Noto Emoji"].freeze
|
|
33
|
+
|
|
18
34
|
FONT_FAMILIES = {
|
|
19
|
-
sans: ["Noto Sans", "Noto Sans JP", "Noto Sans CJK JP"
|
|
20
|
-
serif: ["Noto Serif", "Noto Serif JP", "Noto Serif CJK JP"
|
|
21
|
-
|
|
35
|
+
sans: (["Noto Sans", "Noto Sans JP", "Noto Sans CJK JP"] + SCRIPT_FAMILIES_SANS + EMOJI_FAMILIES + ["sans-serif"]).freeze,
|
|
36
|
+
serif: (["Noto Serif", "Noto Serif JP", "Noto Serif CJK JP"] + SCRIPT_FAMILIES_SERIF + EMOJI_FAMILIES + ["serif"]).freeze,
|
|
37
|
+
# Noto ships no monospaced faces for these scripts, so the mono style borrows
|
|
38
|
+
# the proportional ones rather than dropping to the generic fallback.
|
|
39
|
+
mono: (["Noto Sans Mono SemiCondensed", "Noto Sans Mono", "Noto Sans JP", "Noto Sans Mono CJK JP"] + SCRIPT_FAMILIES_SANS + EMOJI_FAMILIES + ["monospace"]).freeze,
|
|
22
40
|
# The cjk style puts a full-coverage CJK family first, for text that mixes
|
|
23
41
|
# Han, Hangul and kana. Latin falls back to the same Noto faces the sans
|
|
24
42
|
# style uses. (Before 1.8.0 this was WQY Zen Hei.)
|
|
25
|
-
cjk: ["Noto Sans CJK JP", "Noto Sans", "Noto Sans JP"
|
|
43
|
+
cjk: (["Noto Sans CJK JP", "Noto Sans", "Noto Sans JP"] + SCRIPT_FAMILIES_SANS + EMOJI_FAMILIES + ["sans-serif"]).freeze
|
|
26
44
|
}.freeze
|
|
27
45
|
|
|
28
46
|
module FontFamily
|
data/lib/rsyntaxtree/version.rb
CHANGED