Type1Font
ภาพรวม
Type1Font เป็นคลาสใน Aspose.Font FOSS สําหรับ Python. ทายาทจาก: Font.
Type1Font.load_afm โหลดไฟล์ AFM จากเส้นทางที่ให้ไว้ในตัวอย่าง { PLACHEHOLE}.
หมวดนี้ให้ 15 วิธีในการทํางานกับวัตถุ Type1Font ในโปรแกรม Python. วิธีการที่ใช้ได้แก่: __init__, convert, encoding, font_family, font_name, font_style, font_type, get_kern_pairs, glyph_accessor, load_afm, metrics, num_glyphs,และวิธีการเพิ่มเติมอีก 3 วิธี. สมาชิกสาธารณะทุกคนสามารถเข้าถึงการใช้งาน Python ใดก็ได้หลังจากติดตั้งแพ็คเกจ FOSS for Python. คุณสมบัติ: encoding, font_family, font_name, font_style, font_type, glyph_accessor,และอีก 2 ตัว.
คุณสมบัติ
| ชื่อ | ประเภท | Access | คําอธิบาย |
|---|---|---|---|
font_type | FontType | อ่าน | รับประเภทแบบอักษร. |
font_name | str | อ่าน | รับชื่อแบบอักษร. |
font_family | str | อ่าน | รับตระกูลแบบอักษร. |
font_style | str | อ่าน | รับสไตล์ฟอนต์. |
num_glyphs | int | อ่าน | รับจำนวน glyphs. |
metrics | FontMetrics | อ่าน | รับเมตริก. |
encoding | FontEncoding | อ่าน | รับการเข้ารหัส. |
glyph_accessor | GlyphAccessor | อ่าน | รับตัวเข้าถึง glyph. |
วิธีการ
| Signature | คําอธิบาย |
|---|---|
__init__(raw_data: bytes, font_data: Type1FontData, is_pfa: bool) | Calls init การประกอบการ ในตัวอย่างนี้ Type1Font. |
get_kern_pairs() → list[KernPair] | กลับคู่เม็ด. |
load_afm(path: str) | อัตราการอัดไฟล์ AFM จากเส้นทางที่ให้ไว้ในตัวอย่าง Type1Font |
| `to_bytes(font_type: FontType | None)→bytes` |
font_type() → FontType | ส่งค่า FontType ที่ระบุรูปแบบของตัวอักษร |
font_name() → str | เรียก font_name ในตัวอย่าง Type1Font นี้. |
font_family() → str | อสังหาริมทรัพย์เก็บชื่อครอบครัวของตัวอักษร |
font_style() → str | การคืนสไตล์การอธิบาย (เช่น bold, italic) ของตัวอักษร |
num_glyphs() → int | คุณสมบัติให้จํานวน glyphs ในตัวอักษร |
metrics() → FontMetrics | คุณสมบัติให้การเข้าถึงวัตถุ FontMetrics สําหรับตัวอักษร |
encoding() → FontEncoding | กลับวัตถุ FontEncoding ที่อธิบายการโคดตัวละครของ fonts |
glyph_accessor() → GlyphAccessor | กลับ GlyphAccessor สําหรับการเรียกข้อมูล glyph จากตัวอักษร |
save(path: str) | เขียนตัวอักษรเข้าทางไฟล์ที่ระบุในรูปแบบปัจจุบัน |
save_to_format(font_type: FontType, path: str) | เก็บตัวอักษรที่แปลงเป็น FontType ที่ทางที่ให้ไว้ |
convert(target: FontType) → Font | การเรียกแปลงในตัวอย่าง Type1Font นี้. |