BallonsTranslator icon indicating copy to clipboard operation
BallonsTranslator copied to clipboard

有关于paddle ocr和字体问题

Open madpeach2323 opened this issue 9 months ago • 1 comments

第一个问题是会显示警告,deepseek分析是可能因多次初始化 OCR 实例导致或日志配置重复输出 第二个问题是,将我所用的字体放入fonts文件夹内,开启“只显示 fonts 文件夹下的字体”功能后,部分字体在选择框里没有预览效果,并且不会被应用,输出DirectWrite: CreateFontFaceFromHDC() failed (指示输入文件 (例如字体文件) 中的错误。) for QFontDef(Family="Small Fonts", pointsize=16, pixelsize=13, styleHint=5, weight=400, stretch=100, hintingPreference=1) LOGFONT("Small Fonts", lfWidth=0, lfHeight=-13) dpi=96的警告

E:\A气球翻译器\BallonsTranslator_dev_src_with_gitpython>cd E:\A气球翻译器\BallonsTranslator_dev_src_with_gitpython\
E:\A气球翻译器\BallonsTranslator_dev_src_with_gitpython\launch.py:8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Python version:  3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Python executable:  E:\A气球翻译器\BallonsTranslator_dev_src_with_gitpython\ballontrans_pylibs_win\python.exe
Version: 1.4.0
Branch: dev
Commit hash: 23dede5f7a9081ac9fbc23c4b2b176131f5ef8b3
Device name:  NVIDIA GeForce RTX 3050 Ti Laptop GPU
Cuda is available:  True
Cuda version:  11.8
ZLUDA is available:  False
Checking for updates...
Fetching updates from git...
Update check failed: Failed to fetch updates..
Command: git fetch origin dev
Error code: 128
stdout: <empty>
stderr: fatal: unable to access 'https://github.com/dmMaze/BallonsTranslator.git/': Failed to connect to github.com port 443 after 21117 ms: Couldn't connect to server


Continuing with the current version.
[INFO   ] launch:main:193 - QT_API: pyqt6, QT Version: 6.6.1
[INFO   ] launch:main:235 - set display language to zh_CN
[INFO   ] module_manager:merge_config_module_params:569 - Reorder param dict in config
[WARNING] utility:get_infer_gpuid:409 - The first GPU is used for inference by default, GPU ID: 0
[2025/04/17 23:22:42] ppocr WARNING: The first GPU is used for inference by default, GPU ID: 0
[WARNING] utility:get_infer_gpuid:409 - The first GPU is used for inference by default, GPU ID: 0
[2025/04/17 23:22:44] ppocr WARNING: The first GPU is used for inference by default, GPU ID: 0
[WARNING] utility:get_infer_gpuid:409 - The first GPU is used for inference by default, GPU ID: 0
[2025/04/17 23:22:47] ppocr WARNING: The first GPU is used for inference by default, GPU ID: 0
[WARNING] utility:get_infer_gpuid:409 - The first GPU is used for inference by default, GPU ID: 0
[2025/04/17 23:22:48] ppocr WARNING: The first GPU is used for inference by default, GPU ID: 0
[INFO   ] mainwindow:on_finish_settranslator:296 - Translator set to ChatGPT
[INFO   ] mainwindow:on_finish_setocr:277 - OCR set to paddle_ocr
[INFO   ] mainwindow:on_finish_setdetector:268 - Text detector set to ctd
[INFO   ] mainwindow:on_finish_setinpainter:286 - Inpainter set to lama_large_512px
[INFO   ] config:save_config:257 - Config saved
DirectWrite: CreateFontFaceFromHDC() failed (指示输入文件 (例如字体文件) 中的错误。) for QFontDef(Family="System", pointsize=16, pixelsize=16, styleHint=5, weight=400, stretch=100, hintingPreference=1) LOGFONT("System", lfWidth=0, lfHeight=-16) dpi=96
DirectWrite: CreateFontFaceFromHDC() failed (指示输入文件 (例如字体文件) 中的错误。) for QFontDef(Family="MS Sans Serif", pointsize=16, pixelsize=20, styleHint=5, weight=400, stretch=100, hintingPreference=1) LOGFONT("MS Sans Serif", lfWidth=0, lfHeight=-20) dpi=96
DirectWrite: CreateFontFaceFromHDC() failed (指示输入文件 (例如字体文件) 中的错误。) for QFontDef(Family="Small Fonts", pointsize=16, pixelsize=13, styleHint=5, weight=400, stretch=100, hintingPreference=1) LOGFONT("Small Fonts", lfWidth=0, lfHeight=-13) dpi=96
DirectWrite: CreateFontFaceFromHDC() failed (指示输入文件 (例如字体文件) 中的错误。) for QFontDef(Family="MS Serif", pointsize=16, pixelsize=21, styleHint=5, weight=400, stretch=100, hintingPreference=1) LOGFONT("MS Serif", lfWidth=0, lfHeight=-21) dpi=96

madpeach2323 avatar Apr 17 '25 15:04 madpeach2323

PADDLE OCR is a bit buggy. I used its simplest integration, which is why it will constantly add a log. I can catch it and block it if necessary. In fact, at the time of writing, I was just learning how to embed something serious into BT.

And second, this QT fonts can't read normally

bropines avatar Apr 17 '25 18:04 bropines