AuthoredFont
AuthoredFont
ภาพรวม
AuthoredFont เป็นคลาสใน Aspose.PDF FOSS สำหรับ Python.
แบบอักษรฝังที่ทำให้เป็นมาตรฐานและการแมป CID ที่เปลี่ยนแปลงได้สำหรับข้อความที่สร้างขึ้น.
คลาสนี้ให้ 8 เมธอดสำหรับทำงานกับวัตถุ AuthoredFont ในโปรแกรม Python วิธีการที่มีให้รวมถึง: __init__, cid_to_gid_bytes, cid_widths, embedded_program, encode, encode_glyph, glyph_id, to_unicode_cmap. สมาชิกสาธารณะทั้งหมดสามารถเข้าถึงได้จากแอปพลิเคชัน Python ใดก็ได้หลังจากติดตั้งแพคเกจ Aspose.PDF FOSS สำหรับ Python. คุณสมบัติ: base_name, cid_font_subtype, descriptor_metrics, fingerprint, font_file_key, font_file_subtype, และอีก 3 รายการ.
คุณสมบัติ
| ชื่อ | ประเภท | การเข้าถึง | คำอธิบาย |
|---|---|---|---|
base_name | str | อ่าน | คืนค่าที่แน่นอนของ PDF BaseFont/FontName ปัจจุบัน. |
pdf_base_name | str | อ่าน | นามแฝงสำหรับ :attr:base_name ที่ใช้โดยโค้ดการรวม COS. |
is_subset | bool | อ่าน | ว่า :meth:embedded_program ปัจจุบันส่งคืนฟอนต์ที่ลดขนาดหรือไม่. |
descriptor_metrics | `dict[str, int | float | tuple[int, int, int, int]]` |
shaping_program | bytes | อ่าน | ส่งคืนโปรแกรม SFNT เต็มรูปแบบที่ใช้โดยเอนจินการจัดรูปแบบ. |
fingerprint | `` | อ่าน | รับลายนิ้วมือ. |
cid_font_subtype | `` | อ่าน | รับค่า cid font subtype. |
font_file_key | `` | อ่าน | รับคีย์ไฟล์แบบอักษร. |
font_file_subtype | `` | อ่าน | รับค่า subtype ของไฟล์ฟอนต์. |
วิธีการ
| ลายเซ็น | คำอธิบาย |
|---|---|
| `init(sfnt_program: bytes, embedded_program: bytes, plain_base_name: str, kind: str, unicode_to_gid: dict[int, int], metrics: _SfntMetrics, gid_to_native_cid: dict[int, int] | None)` |
glyph_id(character: str) → `int | None` |
encode(text: str) → bytes | Encode text เป็น CID สองไบต์และขยายการแมปฟอนต์ปัจจุบัน. |
encode_glyph(gid: int, unicode_text: str) → bytes | กำหนด CID ให้กับ glyph ที่มีรูปร่างหนึ่งและคลัสเตอร์ Unicode เชิงตรรกะของมัน. |
embedded_program() → bytes | คืนค่าโปรแกรมฝังตัวปัจจุบัน, ทำ subset เมื่อลดขนาดลง. |
to_unicode_cmap() → bytes | สร้าง ToUnicode CMap สำหรับการกำหนด CID สองไบต์ปัจจุบัน. |
cid_widths() → dict[int, int] | ส่งคืนความกว้าง CID -> advance ปัจจุบันในพื้นที่ PDF หน่วย 1000. |
cid_to_gid_bytes() → `bytes | None` |