Skip to content

fix(form_fit): lay U+0387, 한컴돋움's symbols and 한컴 윤고딕 250 out at the advances Hancom gives them - #556

Merged
airmang merged 6 commits into
mainfrom
fix/form-fit-hancom-2024-glyph-advances
Oct 24, 2026
Merged

airmang merged 6 commits into
mainfrom
fix/form-fit-hancom-2024-glyph-advances

Conversation

@airmang

@airmang airmang commented Oct 23, 2026

Copy link
Copy Markdown
Owner

무엇을 고치나

FormFit과 쪽 수 추정이 몇몇 글자를 한컴오피스 2024와 다른 폭으로 잡던 것을 고친다. 셋 다 글자 폭 표(_glyph_table·measure._DESIGN)만 바꾼다.

  • 그리스 위 점(U+0387): 한글 문서에서 낱말 사이 가운뎃점으로도 쓰는 글자다. 글자 표가 그리스 문자 영역을 읽지 않아 문장 부호 평균 폭(0.42 em)으로 쟀다. 한/글은 글꼴에 그 글자가 있으면 글꼴 폭(바탕 321/1024, 굴림·궁서·돋움·새굴림 320/1024, 바탕체·굴림체·궁서체·돋움체 반 em, 한양신명조·한양중고딕 313/1000)으로, 없으면 약 1/6 em(1000 단위 글꼴 161, 1024 단위 글꼴 165, 휴먼 글꼴 164)으로 놓는다. 한양 글꼴에서 굵게여도 넓어지지 않는다.
  • 한컴돋움의 기호: 한/글 2024는 한컴돋움의 영문(ASCII·라틴-1·라틴 확장-A·곡선 따옴표)과 몇 글자만 글꼴 폭으로 놓고, 기호·그리스·키릴·전각 문자는 글자가 없는 글꼴처럼 함초롬돋움 폭으로 놓는다. 10pt에서 "※"는 1,000이 아니라 768, "「"는 1,000이 아니라 500, "∘"은 500이 아니라 968이다. 한컴돋움의 대체 글꼴을 함초롬돋움으로 두고, 글자 표에는 한/글이 자기 폭으로 놓는 글자만 남긴다. 한글 음절·자모는 이미 맞았다.
  • 한컴 윤고딕 250: 한컴오피스 2024에 들어 있는 글꼴인데 표에 없어서, 한/글이 대체할 글꼴로 보고 한컴바탕 폭(한글 1 em)으로 쟀다. 한/글은 이 글꼴의 폭으로 놓는다. 표에 한 줄을 더한다(1000 단위: 한글 음절 모두 900, 빈칸 350, 영문·숫자·문장 부호·기호는 한/글이 놓는 폭, 없는 글자는 함초롬돋움 폭, 굵게 넓힘 없음). 키릴 문자는 한 폭으로 맞지 않아 넣지 않았다(함초롬돋움으로 대체).

(실험) 줄 배치 정보 쓰기는 이 글자 폭을 그대로 쓰므로 같은 문단의 줄 나눔·탭 폭도 한/글과 같아진다.

시험

한컴오피스 2024가 저장한 문서 셋. 문단마다 글자 셋 + 탭 + 끝이고, 탭이 다음 기본 탭 정지까지 가므로 탭 폭이 글자 셋의 폭을 보여 준다(7·11·20pt × 장평 80~120 % × 보통·굵게).

  • formfit_ano_teleia_grid.hwpx: U+0387, 글자가 없는 글꼴·있는 글꼴·한양 글꼴 13종.
  • formfit_hancom_dotum_symbol_grid.hwpx: 한컴돋움의 영문·따옴표와 기호·그리스·키릴·전각 문자.
  • formfit_hancom_yun_gothic_250_grid.hwpx: 한컴 윤고딕 250의 한글 음절·영문·숫자·문장 부호·기호·없는 글자.

주제마다 시험 커밋에서 새 시험 2개가 실패하고, 이어지는 고침 커밋에서 통과한다.

🤖 Generated with Claude Code

@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 fc1778f / base 5c345e5. U+0387의 문자 표 경로 및 한양 굵기 예외, 한컴돋움 _DESIGN/ADVANCES에서 빠진 글자의 함초롬돋움 fallback, 새 한컴 윤고딕250의 em/문자 표 및 기존 캐시의 보수적 face/glyph 검사와 주변 코드를 확인했습니다. 새 저장본 3개의 탭 폭 비교가 실제 측정 경로를 검증하며, 재현 가능한 미해결 결함은 발견하지 못했습니다.

해당 head의 CI13개 성공, Python3.12 로그의 7,076 passed / 18 skipped / 1 xfailed, coverage90.10%, Ruff·mypy·pyright 통과를 확인했습니다. 별도 체크아웃에서 test_form_fit_hancom_rules.py + test_layout_line_cache.py + test_layout_page_estimate.py 1,720개가 통과했습니다.

현재 최신 main b44f88409dcc861e4d8957f71db134fe8aabc237과 GitHub CONFLICTING/DIRTY 상태이므로 병합은 보류합니다. 충돌을 해결한 head는 변경분 및 CI를 다시 검증해야 합니다. 자기 PR이므로 COMMENT로 결과를 남깁니다.

airmang and others added 6 commits October 24, 2026 09:07
…s it

A Hancom Office 2024 save of three U+0387 then a tab at 7, 11 and 20 pt under 장평 80 to 120 %, regular and bold, in
faces that lack the glyph (함초롬바탕, 함초롬돋움, 맑은 고딕, 휴먼명조, HY헤드라인M, 한컴바탕), faces that have
it (바탕, 굴림, 바탕체, 돋움체) and the 한양 faces. Each tab reaches the next default stop past the glyphs, so its width
shows how wide they are. FormFit lays the glyph out at the punctuation average of 0.42 em instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Korean documents use U+0387 as a middle dot between words. Hancom Office 2024 lays it out at the face's own advance
where the face has the glyph (바탕 321 of 1024, 굴림, 궁서, 돋움 and 새굴림 320, the fixed-pitch faces a half em, 한양신명조
and 한양중고딕 313 of 1000) and at about a sixth of the em where it does not (161 of 1000, 165 of 1024, 164 in the
휴먼 faces); bold does not widen it in the 한양 faces. The glyph table read from the fonts leaves the Greek block
out, so FormFit and the page estimate took the punctuation average of 0.42 em, more than twice as wide, and broke a
line early.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Hancom Office 2024 save of three 한컴돋움 glyphs then a tab at 7, 11 and 20 pt under 장평 80 to 120 %, regular and
bold: Latin letters and quotation marks, and symbols, Greek, Cyrillic and full-width forms. Each tab reaches the next
default stop past the glyphs, so its width shows how wide they are. FormFit takes every glyph's advance from the
한컴돋움 font file, so "※" and "「" come out an em wide and "∘" half an em.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hancom Office 2024 lays 한컴돋움's Latin letters (ASCII, Latin-1, Latin Extended-A and the curly quotes) and a few
other glyphs out at the font's advances, and its symbols, Greek, Cyrillic and full-width forms at 함초롬돋움's, as it
does for a face that lacks them: at 10 pt "※" is 768, "「" 500 and "∘" 968, where the font file gives 1,000, 1,000 and
500. 한컴돋움 now falls back to 함초롬돋움 and its glyph table keeps only the glyphs Hancom lays out at an advance of
their own. Its Hangul syllables and jamo already matched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Hancom Office 2024 save of three 한컴 윤고딕 250 glyphs then a tab at 7, 11 and 20 pt under 장평 80 to 120 %, regular
and bold: Hangul syllables, Latin letters, digits and punctuation, symbols the font has and glyphs it lacks. Each tab
reaches the next default stop past the glyphs, so its width shows how wide they are. FormFit takes the face for one
missing from its table and lays it out at 한컴바탕's advances, a Hangul syllable an em instead of 0.9 em.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hancom Office 2024 ships 한컴 윤고딕 250 and lays it out at its own advances, which FormFit and the page estimate did
not know: they took 한컴바탕's, as for a face Hancom would replace. The face now has a row of its own, in 1000 units:
every Hangul syllable 900, its space 350, its Latin letters, digits, punctuation and symbols at the advances Hancom
lays them out at (three glyphs then a tab, 7 to 40 pt, 장평 80 to 120 %), and the glyphs it lacks at 함초롬돋움's. Bold
does not widen it. Its Cyrillic letters, which no single advance fits, are left to 함초롬돋움.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airmang
airmang force-pushed the fix/form-fit-hancom-2024-glyph-advances branch from fc1778f to c12e2d2 Compare October 24, 2026 00:10
@airmang
airmang merged commit 798cfdd into main Oct 24, 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