feat: integrate Tesseract.js with improved language availability and font handling

- Refactored OCR page recognition to utilize a configured Tesseract worker.
- Added functions to manage font URLs and asset filenames based on language.
- Implemented language availability checks and error handling for unsupported languages.
- Enhanced PDF workflow to display available OCR languages and handle user selections.
- Introduced utility functions for resolving Tesseract asset configurations.
- Added tests for OCR functionality, font loading, and Tesseract runtime behavior.
- Updated global types to include environment variables for Tesseract and font configurations.
This commit is contained in:
alam00000 committed 2026-03-14 15:50:30 +05:30
1 parent 58c78b09d2
commit 77da6d7a7d
23 files changed
+1906 -564

No files matched your search

+14
View File
@@ -1 +1,15 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_TESSERACT_WORKER_URL?: string;
readonly VITE_TESSERACT_CORE_URL?: string;
readonly VITE_TESSERACT_LANG_URL?: string;
readonly VITE_TESSERACT_AVAILABLE_LANGUAGES?: string;
readonly VITE_OCR_FONT_BASE_URL?: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
}
declare const __SIMPLE_MODE__: boolean;