From 36694cd21d62e61d5b6e9b6ecaaa65d264ceb3bd Mon Sep 17 00:00:00 2001 From: airmang <38392618+airmang@users.noreply.github.com> Date: Thu, 1 Oct 2026 22:39:03 +0900 Subject: [PATCH] docs(tests): say how the Hancom-saved fixtures were saved and cleaned tests/fixtures/hancom_saved/README.md says which program saved the files (Hangul's engine for Windows, the equation files Hangul for macOS), what was removed before they were committed (author, program version and dates in version.xml, content.hpf and the .hwp summary information; the zip or compound file repacked) and that everything else is as Hangul wrote it, so a file saved from the desktop program can be added the same way. Co-Authored-By: Claude Opus 5.5 --- tests/fixtures/hancom_saved/README.md | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tests/fixtures/hancom_saved/README.md diff --git a/tests/fixtures/hancom_saved/README.md b/tests/fixtures/hancom_saved/README.md new file mode 100644 index 00000000..e3859665 --- /dev/null +++ b/tests/fixtures/hancom_saved/README.md @@ -0,0 +1,42 @@ +# Hancom-saved fixtures + +Documents laid out and saved by Hancom's Hangul. Tests compare what python-hwpx writes, reads or estimates +with what Hangul stored in them: line layout caches (`hp:linesegarray`), table and object sizes, field and +style values. + +## Saved automatically on Windows + +Every file but `equation_*.hwpx` was saved automatically by Hangul's engine for Windows, not from the +Hangul window on a desktop. Such a save writes `os="2"` in `version.xml` and no `Preview/PrvImage.png` +(files saved from the desktop program carry `os="1"` and usually a preview image). `memos_in_fields.hwp` +was saved the same way. + +Before a file was committed, only what names its author, the program version and the dates was removed; +every other part keeps the bytes Hangul wrote. + +- `.hwpx` + - `version.xml`: `appVersion` emptied. + - `Contents/content.hpf`: the `creator`, `lastsaveby`, `CreatedDate`, `ModifiedDate` and `date` metas + emptied. + - An embedded OLE object (`BinData/*.ole`, a chart): the times of its compound file's root entry zeroed. + - The zip repacked with its entries in the same order and compression, dated 1980-01-01 as Hangul + dates them. +- `.hwp` + - The summary information stream (`\x05HwpSummaryInformation`): the author, the last saver, the program + version, the created and last saved times and the date text emptied. The last printed time is zero as + Hangul writes it. + - The compound file rebuilt; every other stream is as Hangul saved it. + +Their document information therefore differs from that of a file saved from the desktop program, while +their content and layout caches do not. + +## Equations saved on macOS + +`equation_*.hwpx` were cut from documents opened and saved by Hangul for macOS (`os="10"` in +`version.xml`). Each keeps the section's first paragraph and one equation paragraph byte for byte; the +preview image was left out and the author and dates emptied (#351). + +## Adding a file + +A file saved from the desktop program works the same: remove the information listed above before +committing it, and say in the test what behaviour of Hangul the file shows.