Skip to content

fix(form_fit): widen bold 한양 syllables KS X 1001 does not list as Hancom does - #548

Merged
airmang merged 3 commits into
mainfrom
fix/hanyang-bold-syllables
Oct 23, 2026
Merged

airmang merged 3 commits into
mainfrom
fix/hanyang-bold-syllables

Conversation

@airmang

@airmang airmang commented Oct 23, 2026

Copy link
Copy Markdown
Owner

What

Hancom Office 2024 widens a bold Hangul syllable in 한양중고딕, 한양신명조 and 한양견고딕 by a twentieth of the em. For a syllable that KS X 1001 does not list, it adds one twelve-hundredth of the em on top. That covers 8,822 of the 11,172 syllables, such as 갂, 똠, 햏 and 힣.

  • Bold "힣" at 40 pt is 4204 HWPUNIT.
  • Bold "가" at 40 pt is 4200.
  • Regular syllables are one em in both cases.

FormFit and the page estimate laid every bold syllable out at the em plus its twentieth. That made each unlisted syllable about one layout unit too narrow. The experimental line cache writes bold 한양중고딕 and 한양신명조 paragraphs, so it could write tab widths that Hancom does not lay out.

Changes

  • form_fit/measure.py: a bold syllable that KS X 1001 does not list now takes an extra 1/1200 em, added before its 장평 scales it. The 2,350 listed syllables come from rows 16–40 of the EUC-KR code.
  • layout/line_cache.py: with these advances and those from fix(form_fit): lay 한양 glyphs out at the advances Hancom gives them #546, every bold 한양견고딕 glyph the line cache writes is laid out the way Hancom lays it out. So the line cache writes bold 한양견고딕 paragraphs too. Bold HCI Hollyhock is still left to Hancom.
  • New Hancom-saved fixture formfit_hanyang_bold_syllables.hwpx, scrubbed as the fixture README describes. In each of the three faces it holds three syllables and then a tab: 가, 똘 and 힝 (listed), and 갂, 똠, 햏 and 힣 (unlisted). They are bold at sizes and 장평 where the extra twelve-hundredth decides the rounding, and regular as well. Each tab reaches the next default stop past the syllables.

Commits: test first (it fails on main), then the advance fix, then the line-cache change.

Checks

  • Full test suite: only the 5 failures that are already on main (installed-wheel and symlink tests).
  • The new tests fail on main and pass here.
  • Lint, type and hygiene gates pass.

🤖 Generated with Claude Code

airmang and others added 3 commits October 23, 2026 09:58
…s them

A Hancom Office 2024 save of three Hangul syllables then a tab in 한양견고딕, 한양중고딕 and 한양신명조:
가, 똘 and 힝, which KS X 1001 lists, and 갂, 똠, 햏 and 힣, which it does not, bold at sizes and 장평 where a
twelve-hundredth of the em decides the rounding, and regular. Each tab reaches the next default stop past the
syllables, so its width shows how wide they are. FormFit lays every bold syllable out at the em and its
twentieth, a layout unit narrower than Hancom for the syllables KS X 1001 does not list ("힣" at 40 pt is 4200,
not 4204).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…com does

Hancom Office 2024 lays a bold Hangul syllable of 한양중고딕, 한양신명조 and 한양견고딕 out at the em and its
twentieth when KS X 1001 lists it (2,350 syllables), and a twelve-hundredth of the em wider when it does not
(the other 8,822): bold "힣" at 40 pt is 1,050.83 units, 1,051 (4204), against "가"'s 1,050 (4200). Regular
syllables are an em either way.

FormFit and the page estimate took such bold paragraphs about a layout unit per syllable narrower, and the
experimental line cache, which writes bold 한양중고딕 and 한양신명조 paragraphs, could write tab widths Hancom
does not lay out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FormFit now lays every bold glyph of 한양견고딕 out at the advance Hancom Office 2024 gives it: its Latin glyphs
on the 1200-unit grid, its symbols unwidened, its jamo and its Hangul syllables a twentieth of the em wider (a
twelve-hundredth more for a syllable KS X 1001 does not list). The experimental line cache left bold paragraphs
in that face to Hancom; it writes them as it writes bold 한양중고딕 and 한양신명조 ones. Bold HCI Hollyhock
stays left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@airmang airmang left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

검토한 head 97b8616, main base 0c90f7a. _laid_out의 반올림/장평/자간 순서, char_advance의 실제 face와 굵기·자모 예외, _bold_sure 및 _sure_of 경로를 확인했습니다. 추가 폭은 해당 한양 face의 굵은 미등재 한글 음절에만 적용되고 기존 기본 인자/API 사용은 유지됩니다. EUC-KR 생성 집합을 전체 한글 음절의 2바이트 인코딩 여부와 독립적으로 대조하여 2,350/8,822 분류가 모두 일치함을 확인했습니다. 재현 가능한 미해결 결함은 발견하지 못했습니다.

검증: 해당 head의 CI 13개 성공, Python 3.12 로그에서 7,061 passed / 18 skipped / 1 xfailed, coverage 90.10%, Ruff·mypy·pyright 통과 확인. 별도 정확한 head 체크아웃에서 FormFit 규칙·line-cache·page-estimate 테스트 1,709개 통과. 새 음절 fixture와 기존 한양 glyph-grid fixture에서 캐시/탭을 지우고 재작성해 실제 저장된 Hancom 캐시 및 탭 속성과 대조했으며, 작성된 232+600개 문단이 모두 일치했습니다. HCI Hollyhock 및 기존 보수적 캐시 조건은 유지됩니다.

자기 PR이므로 COMMENT로 검토 결과를 남깁니다. 병합 직전에 head/main/CI/리뷰 상태를 다시 확인하며 패키지 배포는 포함하지 않습니다.

@airmang
airmang merged commit 7ca4582 into main Oct 23, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant