diff options
| author | eunhhu <[email protected]> | 2026-09-28 16:27:28 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-28 16:27:28 +0100 |
| commit | 96c35e7919e5e25187bd5adedda516a32cfc8639 (patch) | |
| tree | 73419274bd29afe2ef552825ba94e1c083953008 /docs | |
| parent | fb8e49a31a7ba7f333965c93b08bd0c58120494e (diff) | |
| download | vega-96c35e7919e5e25187bd5adedda516a32cfc8639.tar.gz vega-96c35e7919e5e25187bd5adedda516a32cfc8639.zip | |
Follow HarfBuzz and Unicode with one command
text/upstream.py brings in a HarfBuzz release (default: the one the
build links) and the UCD of the Unicode version its tables came from,
builds that HarfBuzz as one static library from its amalgamated source
(no system package, any version), regenerates the Unicode tables and the
syllabic ones, holds the syllable machines to HarfBuzz's compiled ones,
and runs the text checks built against it: Unicode's conformance tests on
that UCD, random shaping against that HarfBuzz, the layout's promises,
the kern class tests, HarfBuzz's own suite. --corpus adds every installed
font (text/fonts.py, the corpus runner, now in the tree). What a new
version breaks shows as failing checks with the font and the input to
port a fix from; the generated files are left changed for review.
make check-text is those checks alone; UCD and HARFBUZZ_SRC default to
build/upstream's when the tool fetched them. Its first run found that
text/shape-build.c used clock_gettime without asking for POSIX, building
only because the system HarfBuzz's headers did. Against HarfBuzz 10.2.0
built from source and the 16.0.0 UCD, every check passes in about a
minute.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/design/004-text.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/design/004-text.md b/docs/design/004-text.md index b9727ae..502eeb2 100644 --- a/docs/design/004-text.md +++ b/docs/design/004-text.md @@ -267,6 +267,34 @@ GSUB가 끝없이 늘리는 글꼴(text-rendering-tests의 GSUB-3)에서 Vega는 마지막으로 끝난 패스의 글리프로 계속한다. 그 뒤의 패스는 아무것도 하지 않고, 위치는 기본 advance가 된다. Vega도 그렇게 한다. 깨진 글꼴에서도 글이 사라지지 않고 HarfBuzz와 같은 모습으로 남는다(5,018건이 같다). +## 윗물을 따라가기: HarfBuzz와 유니코드가 올라갈 때 + +Vega의 셰이핑은 HarfBuzz와 경우마다 같아야 하고, 유니코드 성질 표는 UCD에서 만든다. 둘 다 해마다 움직인다. 유니코드는 +새 문자와 문자 체계, 바뀐 규칙을 들이고, HarfBuzz는 새 문자 체계를 셰이퍼에 넣고 글꼴마다의 버릇을 고친다. 따라가는 일은 +손으로 옮기는 것과 기계로 다시 만드는 것으로 나뉜다. 기계로 할 수 있는 것은 모두 기계가 한다. + +- 다시 만드는 것(데이터): 성질 표는 UCD에서([text/unicode.py](../../text/unicode.py)), 음절 기계와 인도계·USE·아랍 표는 + HarfBuzz의 원본에서([text/syllabic.py](../../text/syllabic.py)) 만든다. 기계는 HarfBuzz가 컴파일한 것과 대 본다. +- 옮기는 것(논리): 셰이퍼와 규칙의 코드. 무엇을 옮길지는 검사가 가리킨다. 실패마다 글꼴과 입력(시험 모음의 경우, + 무작위 실행)이 붙어 나온다. +- 검사: 유니코드의 적합성 시험, 무작위 실행으로 HarfBuzz와 대기, HarfBuzz의 시험 모음(글꼴 버릇의 목록), 설치된 + 글꼴 전부. 빌드 도구는 HarfBuzz와 다르게 셰이핑하는 심볼 파일을 만들지 않는다. 그래서 옮기지 못한 버릇은 틀린 글이 아니라 + 거부된 글꼴로 드러난다. + +[text/upstream.py](../../text/upstream.py)가 이 일을 한 명령으로 한다. `python3 text/upstream.py --harfbuzz 버전`은 +그 릴리스의 원본과, 그 HarfBuzz의 표가 기준으로 삼은 유니코드 판의 UCD를 `build/upstream`에 받는다. 그 HarfBuzz를 +하나로 묶인 원본(`harfbuzz.cc`)에서 정적 라이브러리로 빌드한다. 시스템 꾸러미가 필요 없고 어느 판이든 된다. 두 생성 파일을 +다시 만들고 기계를 대 본다. 그 HarfBuzz에 링크한 도구로 `make check-text`(적합성 시험, 무작위 셰이핑, 글줄의 약속, kern 등급 +시험, HarfBuzz 시험 모음)를 돌린다. `--corpus`면 설치된 글꼴 전부를 대 본다([text/fonts.py](../../text/fonts.py)). +생성 파일은 바뀐 채로 두어 검토하게 하고, 판과 바뀐 것과 검사마다의 결과를 JSON 한 줄로 낸다. HarfBuzz 10.2.0과 유니코드 +16.0.0에서 받기를 빼고 1분 남짓 걸린다(원본에서 빌드한 HarfBuzz로 모든 검사가 통과한다). 처음 돌렸을 때 하나를 찾았다. +`shape-build.c`가 `clock_gettime`을 쓰면서 POSIX를 스스로 선언하지 않아, 시스템 HarfBuzz의 머리 파일을 거칠 때만 빌드되고 +있었다. + +한계도 있다. 무작위 대기와 시험 모음은 증명이 아니다. 드문 입력의 차이는 남을 수 있다. 셰이퍼 논리는 여전히 판마다 손으로 +옮겨야 한다. 도구가 줄여 주는 것은 무엇을 옮길지 찾는 일이다. AAT와 사용자 기능, 가변 글꼴은 아직 받지 않는다(시험 모음에서 +빼고 센다). + ## 비례폭 글줄 [text/layout.c](../../text/layout.c)는 검증한 부품을 UAX #9 3.4절과 UAX #14가 말하는 순서로 잇는다. |
