M5: name line endings in the comment properties combo (#582)

* M5: name line endings in the comment properties combo

The menu showed PDF tokens such as ROpenArrow. It now uses translated labels, and the stored /LE name is unchanged.

* Fix main CI: move the rotated-field render test out of pdfcraft-forms (#591)

#516 added pdfcraft-render as a dev-dependency of pdfcraft-forms for one
rendering test. Both crates are layer 3, so `cargo xtask layers` (run in
CI) rejects the sideways edge and main went red. The test now lives in
crates/engine/tests/form_rotation.rs, where both crates are already
dependencies, and forms drops the dev-dependency. The parity evidence
points at the new location.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* ja: 平ら for the Butt line ending

---------

Co-authored-by: Brandon Thomas <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
authored and GitHub committed 2026-10-09 18:45:54 -04:00
1 parent 22cbf65628
commit 96854d8d92
17 files changed
+125 -18

No files matched your search

+13 -13
View File
@@ -19,7 +19,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Simplified Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "4c4a3955e2f687d8b0483bd01986bf652a6a84cd5c8fadac01bc30dc74466aa8"
sha256 = "df55a2ab783a02419d86c244cd793d4f42616ff842860b9ee8740960526f713d"
[[asset]]
path = "crates/ui-egui/src/i18n/zh-hant.tsv"
@@ -30,7 +30,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Traditional Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "64cb89b98806cceee1900c840a167a181fb8d6fe43ad8f361c4d56e25b504b30"
sha256 = "4aee7a68592c36cc2bb828a51e71fdf6ed12e660bd80b2f214a6d3aef554d1d5"
[[asset]]
path = "crates/ui-egui/src/i18n/cs.tsv"
@@ -41,7 +41,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Czech UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "8aaf1667040f5fb982a31c680674cf1c51e98092e5ccc38dc5a7e916238c2d1c"
sha256 = "af2e8234147dbcc8da6414e213fe560312d44e816f0bde6271577c4d8041748b"
[[asset]]
path = "crates/ui-egui/src/i18n/pt-br.tsv"
@@ -52,7 +52,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Brazilian Portuguese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "81a1320a5769dce52c90d35953d82c0eccbb18deb05421883d6ef0680ce4c6b3"
sha256 = "7abd689f910f5b28f48dc9c0b2d3859965ad27c962d919a011efb959247edfee"
[[asset]]
path = "crates/ui-egui/src/i18n/es.tsv"
@@ -63,7 +63,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Spanish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "d9eb5199e627ada01c404232ae500bff145654a61ae4379b037dbdc2afd13efa"
sha256 = "9ebeb8cd5168cffaa027f7d4bc08b7987c09661027f64e4067b0975f456737bd"
[[asset]]
path = "crates/ui-egui/src/i18n/fr.tsv"
@@ -74,7 +74,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "French UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "e6f51aa5d11225920e971f43420dfde96e5ab209b3fa7cffd572a2959bf09d82"
sha256 = "9b160ff2781512e07eb9f5a6be39681eec0fd413c61e0becc11913ef9baac5e3"
[[asset]]
path = "crates/ui-egui/src/i18n/de.tsv"
@@ -85,7 +85,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "German UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "d1250a2d29e447b86b4b9f9515f9d9b7c74ff8fe7a1ac0d6207355a02d895f8b"
sha256 = "e7007083de3633c85fdf98b249e201f50100c3adfa2cf889acd03449a700b1e7"
[[asset]]
path = "crates/ui-egui/src/i18n/te.tsv"
@@ -96,7 +96,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Telugu UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "2d42c2fbb62771bad33dab83926adc34c553b7d0b6cf666322076b9820f641de"
sha256 = "7315ad9ec7e672c9654a399f0142e8f78b9331c654048085f3b4b573edd51fa1"
[[asset]]
path = "crates/ui-egui/src/i18n/ru.tsv"
@@ -107,7 +107,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Russian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "bb5e94d419faf579e9cd0ef9e1f26da6aa342567004a8ff53cb0a2037a8981bb"
sha256 = "54ae61ed7eb2c93cf739200a6ec4b198ce40991eccebfca0bdc1eb40847d64cf"
[[asset]]
path = "crates/ui-egui/src/i18n/hu.tsv"
@@ -118,7 +118,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Hungarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "292fb26efe13ae85f4343b4dffd541ba36d4963cb309f7cbad5074b940aaf5e5"
sha256 = "46f5a79f8264f3ca3aba4fa5a95877e55f7a55dcee68834854fcc7ee24390c2c"
[[asset]]
path = "crates/ui-egui/src/i18n/bg.tsv"
@@ -129,7 +129,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Bulgarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "df90a3c504c18f606a94fb6aa1fb4f8cd2aa26112aa09c29add5e37db02495af"
sha256 = "12d77d9d83b20cea4486f91628655bbd49440d550c6d4516412b448a289e284d"
[[asset]]
path = "crates/ui-egui/src/i18n/ja.tsv"
@@ -140,7 +140,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Japanese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "1333d121349c531e3297d9ac304de76434bb7248dbbe0732ec7d842bac5c9eb2"
sha256 = "62e9d95a3dbf94024c059f3a3f7646e99119bffb1da0d60580933bfed6f03985"
[[asset]]
path = "crates/ui-egui/src/i18n/uk.tsv"
@@ -151,7 +151,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Ukrainian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "a09703008f9ef9e3c96bf6fc6853288ae733ab3b069ed5d02fd9e78fa9acda62"
sha256 = "9a2259eb0a18fae4290f4f5e03b147f689315d02a86a0b1bb9bf4541bc2f984c"
[[asset]]
path = "assets/icons/accessibility.svg"
+1
View File
@@ -128,6 +128,7 @@ M0 → M1 → M2 → M3 → M4 must happen in order. After M4, M5–M12 can run
## Log
- **2026-10-09 (M5, line-ending labels):** Comment properties names each line ending in words ("Reverse open arrow", "Butt", …) and those labels are translated. The PDF `/LE` token is unchanged. Overall estimate unchanged (about 30–35%).
- **2026-10-09 (M5, line endings):** Lines, connected lines and callouts draw all ten standard line-ending styles. `comment_add` accepts `endings`, and Comment properties can change them in one undo step. An unknown name is left undrawn, and a non-finite direction is rejected. Cloudy borders remain polygon-only, so `comment.line-endings` stays partial. Overall estimate unchanged (about 30–35%).
- **2026-10-09 (M6, field rotation):** Regenerated form appearances honour `/MK /R` (0, 90, 180, 270). Filling or restyling a rotated field keeps the text, check mark and button caption turned, and Field Properties ▸ Position and `form_set_props` `rotation` set it, swapping width and height around the field's center when the axis changes. `form.appearance-regeneration` stays partial (Helvetica metrics are still approximate). Overall estimate unchanged (about 30–35%).
- **2026-10-09 (M2, JPX sample normalization):** JPEG 2000 rescaling uses bounded integer arithmetic for supported 1–32-bit samples, including the 32-bit boundary that previously shifted past the integer width. Zero-sized rows are refused before scaling. Small contributor-original codestreams exercise decoding and rendering; endpoint and standard-depth regressions cover the same helper. Overall estimate unchanged (about 30–35%).
+24 -5
View File
@@ -28,6 +28,22 @@ pub struct PropsDraft {
const ICONS: [NoteIcon; 7] =
[NoteIcon::Comment, NoteIcon::Note, NoteIcon::Help, NoteIcon::Insert, NoteIcon::Key, NoteIcon::NewParagraph, NoteIcon::Paragraph];
/// The name shown in the line-ending combo. [`LineEnding::name`] stays the PDF `/LE` token.
fn ending_label(ending: LineEnding) -> &'static str {
match ending {
LineEnding::None => tl!("None"),
LineEnding::Square => tl!("Square"),
LineEnding::Circle => tl!("Circle"),
LineEnding::Diamond => tl!("Diamond"),
LineEnding::OpenArrow => tl!("Open arrow"),
LineEnding::ClosedArrow => tl!("Closed arrow"),
LineEnding::Butt => tl!("Butt"),
LineEnding::ROpenArrow => tl!("Reverse open arrow"),
LineEnding::RClosedArrow => tl!("Reverse closed arrow"),
LineEnding::Slash => tl!("Slash"),
}
}
impl PdfCraftApp {
/// Attach file: ask for a file (or take `attach_override`) and attach it at `at`.
pub fn attach_file_comment(&mut self, page: usize, at: [f64; 2]) {
@@ -193,11 +209,14 @@ pub(crate) fn body(ui: &mut egui::Ui, app: &mut PdfCraftApp, t: &Tokens) -> (boo
ui.label(tl!("Line ending"));
ui.horizontal(|ui| {
for (i, ending) in ends.iter_mut().enumerate() {
egui::ComboBox::from_id_salt(("line-ending", i)).selected_text(ending.name()).width(130.0).show_ui(ui, |ui| {
for style in LineEnding::ALL {
ui.selectable_value(ending, style, style.name());
}
});
egui::ComboBox::from_id_salt(("line-ending", i)).selected_text(ending_label(*ending)).width(188.0).show_ui(
ui,
|ui| {
for style in LineEnding::ALL {
ui.selectable_value(ending, style, ending_label(style));
}
},
);
}
});
ui.end_row();
+6
View File
@@ -611,6 +611,12 @@
Icon Икона
Thickness Дебелина
Line ending Край на линията
Open arrow Отворена стрелка
Closed arrow Затворена стрелка
Butt Тъп край
Reverse open arrow Обърната отворена стрелка
Reverse closed arrow Обърната затворена стрелка
Slash Наклонена черта
Modified Променено
No status has been set. Не е зададено състояние.
Compare Files Сравняване на файлове
Can't render this file because it contains an unexpected character in line 8 and column 16.
+6
View File
@@ -119,3 +119,9 @@
Portable mode is off: {folder} can't be written ({error}). Settings are kept in your user folder instead. Přenosný režim je vypnutý: do složky {folder} nelze zapisovat ({error}). Nastavení se místo toho ukládá do vaší uživatelské složky.
PdfCraft is drawing without a graphics processor, so it may be slow. Updating the graphics driver may help. PdfCraft vykresluje bez grafického procesoru, takže může být pomalý. Pomoci může aktualizace grafického ovladače.
Go to page… Přejít na stránku…
Open arrow Otevřená šipka
Closed arrow Zavřená šipka
Butt Tupý konec
Reverse open arrow Otevřená šipka obráceně
Reverse closed arrow Zavřená šipka obráceně
Slash Lomítko
Can't render this file because it contains an unexpected character in line 7 and column 81.
+6
View File
@@ -899,6 +899,12 @@
Icon Symbol
Thickness Stärke
Line ending Linienende
Open arrow Offener Pfeil
Closed arrow Geschlossener Pfeil
Butt Stumpf
Reverse open arrow Offener Pfeil umgekehrt
Reverse closed arrow Geschlossener Pfeil umgekehrt
Slash Schrägstrich
Modified Geändert
No status has been set. Es wurde kein Status festgelegt.
Compare Files Dateien vergleichen
Can't render this file because it contains an unexpected character in line 6 and column 51.
+6
View File
@@ -2005,6 +2005,12 @@
Couldn't import the signature image: {e} No se pudo importar la imagen de la firma: {e}
Go to page… Ir a la página…
The standard fonts can't draw “{c}” ({code}). Only Western European characters can be added as text for now. Las fuentes estándar no pueden mostrar «{c}» ({code}). Por ahora solo se pueden añadir como texto caracteres de Europa occidental.
Open arrow Flecha abierta
Closed arrow Flecha cerrada
Butt Extremo recto
Reverse open arrow Flecha abierta invertida
Reverse closed arrow Flecha cerrada invertida
Slash Barra
Larger pages Páginas más grandes
Smaller pages Páginas más pequeñas
Reset page size Restablecer el tamaño de las páginas
Can't render this file because it contains an unexpected character in line 6 and column 60.
+6
View File
@@ -898,6 +898,12 @@
Icon Icône
Thickness Épaisseur
Line ending Extrémité de ligne
Open arrow Flèche ouverte
Closed arrow Flèche fermée
Butt Extrémité plate
Reverse open arrow Flèche ouverte inversée
Reverse closed arrow Flèche fermée inversée
Slash Barre oblique
Modified Modifié
No status has been set. Aucun état n'a été défini.
Compare Files Comparer des fichiers
Can't render this file because it contains an unexpected character in line 6 and column 39.
+6
View File
@@ -2084,6 +2084,12 @@ action wizard Start Indítás
H / Space (hold) H / szóköz (nyomva tartva)
Rotation: Elforgatás:
Line ending Vonalvég
Open arrow Nyitott nyíl
Closed arrow Zárt nyíl
Butt Tompa
Reverse open arrow Fordított nyitott nyíl
Reverse closed arrow Fordított zárt nyíl
Slash Perjel
The standard fonts can't draw “{c}” ({code}). Only Western European characters can be added as text for now. A szabványos betűtípusok nem tudják megjeleníteni ezt: „{c}” ({code}). Egyelőre csak nyugat-európai karakterek adhatók hozzá szövegként.
Larger pages Nagyobb oldalak
Smaller pages Kisebb oldalak
Can't render this file because it contains an unexpected character in line 7 and column 44.
+6
View File
@@ -1982,6 +1982,12 @@
Go to page… ページへ移動…
Reopen the files that were open when PdfCraft last closed 前回 PdfCraft を閉じたときに開いていたファイルを再度開く
The standard fonts can't draw “{c}” ({code}). Only Western European characters can be added as text for now. 標準フォントでは「{c}」({code})を表示できません。現在、テキストとして追加できるのは西ヨーロッパの文字のみです。
Open arrow 開いた矢印
Closed arrow 閉じた矢印
Butt 平ら
Reverse open arrow 逆向きの開いた矢印
Reverse closed arrow 逆向きの閉じた矢印
Slash 斜線
Larger pages ページを大きく表示
Smaller pages ページを小さく表示
Reset page size ページサイズをリセット
Can't render this file because it contains an unexpected character in line 6 and column 47.
+6
View File
@@ -73,3 +73,9 @@
PdfCraft is drawing without a graphics processor, so it may be slow. Updating the graphics driver may help. O PdfCraft está desenhando sem processador gráfico, por isso pode ficar lento. Atualizar o driver de vídeo pode ajudar.
Go to page… Ir para a página…
Reopen the files that were open when PdfCraft last closed Reabrir os arquivos que estavam abertos quando o PdfCraft foi fechado pela última vez
Open arrow Seta aberta
Closed arrow Seta fechada
Butt Topo reto
Reverse open arrow Seta aberta invertida
Reverse closed arrow Seta fechada invertida
Slash Barra
Can't render this file because it contains an unexpected character in line 9 and column 16.
+6
View File
@@ -919,6 +919,12 @@
Icon Значок
Thickness Толщина
Line ending Окончание линии
Open arrow Открытая стрелка
Closed arrow Закрытая стрелка
Butt Торец
Reverse open arrow Обратная открытая стрелка
Reverse closed arrow Обратная закрытая стрелка
Slash Косая черта
Modified Изменено
No status has been set. Статус не установлен.
Compare Files Сравнить файлы
Can't render this file because it contains an unexpected character in line 9 and column 16.
+6
View File
@@ -2023,6 +2023,12 @@ action wizard Start ప్రారంభించు
Pin folder to Home… ఫోల్డర్‌ను హోమ్‌కు పిన్ చేయి…
No recent files ఇటీవలి ఫైళ్లు లేవు
Go to page… పేజీకి వెళ్లు…
Open arrow తెరిచిన బాణం
Closed arrow మూసిన బాణం
Butt మొండి చివర
Reverse open arrow తిరగబెట్టిన తెరిచిన బాణం
Reverse closed arrow తిరగబెట్టిన మూసిన బాణం
Slash వాలు గీత
Date format తేదీ ఫార్మాట్
Fill & Sign dates నింపడం & సంతకం తేదీలు
Pattern నమూనా
Can't render this file because it contains an unexpected character in line 13 and column 16.
+6
View File
@@ -2108,6 +2108,12 @@ calendar date December грудня
H / Space (hold) H / Пробіл (утримувати)
Rotation: Поворот:
Line ending Закінчення лінії
Open arrow Відкрита стрілка
Closed arrow Закрита стрілка
Butt Торець
Reverse open arrow Зворотна відкрита стрілка
Reverse closed arrow Зворотна закрита стрілка
Slash Коса риска
The standard fonts can't draw “{c}” ({code}). Only Western European characters can be added as text for now. Стандартні шрифти не можуть відобразити «{c}» ({code}). Поки що як текст можна додавати лише західноєвропейські символи.
Larger pages Більші сторінки
Smaller pages Менші сторінки
Can't render this file because it contains an unexpected character in line 6 and column 47.
+6
View File
@@ -618,6 +618,12 @@
Icon 图标
Thickness 粗细
Line ending 线条端点
Open arrow 开口箭头
Closed arrow 闭合箭头
Butt 平头
Reverse open arrow 反向开口箭头
Reverse closed arrow 反向闭合箭头
Slash 斜线
Modified 修改时间
No status has been set. 尚未设置状态。
Compare Files 比较文件
Can't render this file because it contains an unexpected character in line 9 and column 16.
+6
View File
@@ -1974,6 +1974,12 @@
Go to page… 轉到頁面…
Reopen the files that were open when PdfCraft last closed 重新開啟上次關閉 PdfCraft 時開啟的檔案
The standard fonts can't draw “{c}” ({code}). Only Western European characters can be added as text for now. 標準字型無法顯示「{c}」({code})。目前只能新增西歐字元作為文字。
Open arrow 開口箭頭
Closed arrow 閉合箭頭
Butt 平頭
Reverse open arrow 反向開口箭頭
Reverse closed arrow 反向閉合箭頭
Slash 斜線
Larger pages 放大頁面
Smaller pages 縮小頁面
Reset page size 重設頁面大小
Can't render this file because it contains an unexpected character in line 9 and column 16.
+9
View File
@@ -271,6 +271,15 @@ fn line_ending_properties_change_and_undo() {
h.state_mut().open_comment_props(0, 0);
h.run_steps(2);
h.get_by_label("Line ending");
h.query_all_by_value("None").next().expect("start ending").click();
h.run_steps(2);
for label in ["Open arrow", "Closed arrow", "Butt", "Reverse open arrow", "Reverse closed arrow", "Slash", "Square", "Circle", "Diamond"] {
h.get_by_label(label);
}
assert_eq!(h.query_all_by_label("ROpenArrow").count(), 0);
assert_eq!(h.query_all_by_label("OpenArrow").count(), 0);
h.get_by_label("None").click();
h.run_steps(1);
{
let d = h.state_mut().comment_props.as_mut().expect("open");
assert_eq!(d.edited.endings.as_deref(), Some(&[pdfcraft_engine::LineEnding::None, pdfcraft_engine::LineEnding::None][..]));