Open wenbopeng opened 1 year ago
I am not familiar enough with Chinese to know what the problem is exactly, but I assume the issue is with add_freetext_annot
which is a pymupdf
function. I can't really fix that.
Ok, wish add_text
to be able to automatically wrap
It can (at least for english text), again, it is not something that I imlemented. It is part of add_freetext_annot
.
I upgraded Windows and solved the problem. I suspected it was a font issue. Now everything is perfect. Thank you. I will close this issue.
It can (at least for english text), again, it is not something that I imlemented. It is part of .
add_freetext_annot
PyMuPDF-Utilities/freetext-annot-lang.py at master · pymupdf/PyMuPDF-Utilities, 2023-03-07 11:34
Might be helpful to fix fonts and text wrap in different languages
It can (at least for english text), again, it is not something that I imlemented. It is part of
add_freetext_annot
.
Here are the commands for the sioyek add-text extension:
new_command _add_red_text python -m sioyek.add_text "%{sioyek_path}" "%{local_database}" "%{shared_database}" "%{file_path}" "%{selected_rect}" "%{command_text}" fontsize=12 text_color=255,0,0
This is the add_freetext_annot
function that sets the font , see Page - PyMuPDF 1.22.3 documentation :
add_freetext_annot(rect, text, fontsize=12, fontname='helv', border_color=None, text_color=0, fill_color=1, rotate=0, align=TEXT_ALIGN_LEFT)
Can you refer to this function and add a fontname command for the add-text extension? It supports Chinese, see Does it support inserting Chinese text? · Issue #329 · pymupdf/PyMuPDF
If you use Simplified Chinese, some characters will be hidden(fig1), but it is normal to use Traditional Chinese(fig2)