Fix tang coverage cua SetText: chi ap dung cho font NHUNG - voi font khong nhung, PDFium moi tra bytes cua font he thong thay the (phu du glyph Viet) lam engine tuong set_text an toan, nhung font object WinAnsi trong PDF khong ma hoa duoc -> ra ky tu rac. Bug tiem an tu iteration 2, lo ra khi CI dung DLL bblanchon moi (may dev cu DLL cu khong tra data cho font khong nhung).
Build Windows portable / build (push) Canceled after 0s
Build Windows portable / build (push) Canceled after 0s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -754,12 +754,18 @@ pub fn apply_edits(
|
||||
SetTextMode::InPlace
|
||||
} else if non_embedded && ascii_only {
|
||||
SetTextMode::InPlace
|
||||
} else if t
|
||||
} else if !non_embedded
|
||||
&& t
|
||||
.font()
|
||||
.data()
|
||||
.ok()
|
||||
.map_or(false, |bytes| fontmatch::coverage_ok(&bytes, text))
|
||||
{
|
||||
// Tầng coverage CHỈ cho font NHÚNG: với font không
|
||||
// nhúng, PDFium (bản mới) trả bytes của font HỆ THỐNG
|
||||
// thay thế — phủ đủ glyph không có nghĩa font object
|
||||
// trong PDF (simple font WinAnsi) mã hoá được text
|
||||
// mới; set_text khi đó ra charcode rác (ÿ).
|
||||
SetTextMode::InPlace
|
||||
} else {
|
||||
let (key, bytes) = resolve_substitute_font(
|
||||
|
||||
Reference in New Issue
Block a user