Skip to content

v1.4.0

Choose a tag to compare

@github-actions github-actions released this 06 Jan 21:42
· 249 commits to master since this release

OpenccNetLibGui v1.4.0

Changelog:

[1.4.0] – 2026-01-07

Added

  • Advanced Short Heading Settings dialog

    • Configurable maximum heading length (range 3–30, default 8).
    • Fine-grained pattern controls:
      • All CJK characters
      • All ASCII characters
      • ASCII digits only (automatically enabled when ASCII is selected)
      • Mixed CJK + ASCII
    • Clear visual hierarchy with parent/child options, inspired by Visual Studio feature selection.
  • User-configurable short heading detection

    • Introduces an advanced, regex-based override mechanism for heading detection.
    • Custom title patterns are evaluated immediately after built-in title detection
      and before other reflow heuristics.
    • Enables precise identification of structured book headings, including:
      • Front-matter titles (e.g. 序章, 前言, 楔子)
      • Chapter banners (e.g. 第十二章 夜雨初歇)
      • Decorated or stylized headings commonly found in novels and scanned PDFs
    • Supports unlimited pattern combinations via regular expressions
      (e.g. xxx|yyy|zzz), allowing full adaptation to diverse content styles.
  • Design-time preview support

    • Added Design.DataContext for the Short Heading dialog,
      improving layout iteration and visual consistency during development.
  • Ignore untrusted PDF text (Pdfium)

    • Added an option to skip repeated overlay- or annotation-like text during PDF extraction.
    • Uses object-level text extraction to reduce duplicated or non-content text in certain PDFs.
    • Intended as a rescue option for PDFs with visible duplicated headings, watermarks, or overlay noise.
    • Extraction-only filtering; does not modify the original PDF.
    • Available via the PDF context menu and persisted under pdfOptions.ignoreUntrustedPdfText.
  • DOCX (.docx) plain-text import support

    • Extracts human-readable text from Microsoft Word documents into the source editor.
    • Handles paragraphs, numbered and bulleted lists, tables (flattened as TSV),
      headers/footers, footnotes, and comments.
    • Formatting is intentionally stripped to produce clean, editable plain text
      suitable for reflow processing and OpenCC conversion.
  • ODT (.odt) plain-text import support

    • Extracts text from OpenDocument Text files via content.xml.
    • Supports paragraphs, headings, lists, and tables.
    • Designed for lightweight, predictable text editing in the source editor.
  • EPUB (.epub) plain-text import support

    • Extracts human-readable text from EPUB eBooks by parsing the package manifest (OPF) and spine order.
    • Supports both XHTML (.xhtml) and legacy HTML (.html / .htm) chapters, including older Calibre-generated EPUBs.
    • Ignores CSS and presentation-only markup; text is extracted based on semantic structure
      (paragraphs, headings, block elements, and line breaks).
    • Skips non-content sections such as scripts, styles, and navigation documents (ToC) by default.
    • Output is normalized into clean, reflow-friendly plain text suitable for further
      paragraph reflow and OpenCC conversion.
  • About dialog

    • Added a dedicated About dialog displaying application version,
      engine information, and project homepage.

Changed

  • Reflow engine refactored into ReflowModel
    • Moved all CJK paragraph reflow logic out of PDF helpers.
    • Shared by PdfPig and Pdfium extraction pipelines.
    • Greatly improves maintainability, testability, and reuse across formats.
  • Short heading detection upgraded
    • Uses ShortHeadingSettings instead of a single integer value.
    • ASCII-only headings automatically allow a larger effective length
      (maxLen × 2, clamped to 10–30) to better support English headings
      such as Introduction, Chapter One, Black Water, etc.
  • PDF reflow heuristics improved
    • Better handling of dialog continuation, punctuation-based joins,
      metadata lines, and mixed CJK/ASCII content.
    • More robust collapse of layout-level repeated titles and headings.
    • Detect drawing box line pattern as paragraph separator.
  • Main text import pipeline unified
    • Drag-and-drop and Open File now share the same document-loading logic.
    • DOCX, ODT, and plain text files are consistently routed through the same
      source editor update path.
  • Internal architecture cleanup
    • Clear separation between:
      • PDF extraction (PdfPig / Pdfium)
      • Office document parsing (DOCX / ODT)
      • Text reflow logic (ReflowModel)
      • User configuration (LanguageSettings / ShortHeadingSettings)
  • Paragraph end detection and reflow logic significantly improved
    • Main-body paragraph splitting now strictly follows standard CJK sentence rules
      (。!? with proper closer handling), prioritizing correctness over aggressiveness.
    • Ellipsis-based endings (……, OCR "...") are supported as weak paragraph boundaries
      only when the line is predominantly CJK, preventing false splits in English or technical text.
    • Structural lines (e.g. bracket-wrapped titles, book lists, metadata-like lines, dates, signatures)
      are handled separately from sentence punctuation, avoiding interference with normal prose.
    • Robust handling of common OCR artifacts:
      • ASCII . and : may be conditionally interpreted as CJK punctuation
        only in strongly CJK contexts.
    • Dialog continuity is strictly preserved:
      • Paragraph splits are always blocked while quotes or brackets remain unclosed,
        ensuring multi-line dialog stays intact.
    • Overall reflow behavior is now closer to human-edited Chinese text layout,
      especially for novels, essays, and scanned PDFs.
  • Update OpenccNetLib to v1.4.0
  • Update OpenccNetLibGui runtimes to .Net 10

Notes

  • This release focuses on correctness, configurability, and long-term maintainability
    of text reflow and document import.
  • DOCX and ODT are treated as input formats only; all content is converted to
    plain text before editing, reflow, or Opencc conversion.
  • Existing behavior remains compatible; legacy ShortHeadingMaxLen is internally
    synchronized with the new settings model.
  • The reflow engine is now suitable for reuse across
    PDF, Office documents, EPUB, CLI tools, batch processing, and automated testing.

Full Changelog: v1.3.2...v1.4.0


Requires: