Woff2Font
ภาพรวม
Woff2Font เป็นคลาสใน Aspose.Font FOSS สําหรับ Python. ทายาทจาก: Font.
Woff2Font.to_bytes(font_type) จะเรียงตัวอักษร WOFF2 เป็นวัตถุ bytes สําหรับ font_ type ที่กําหนดไว้.
หมวดนี้ให้ 14 วิธีในการทํางานกับวัตถุ Woff2Font ในโปรแกรม Python. วิธีการที่ใช้ได้แก่: __init__, convert, encoding, font_family, font_name, font_style, font_type, get_kern_pairs, glyph_accessor, metrics, num_glyphs, save,และวิธีการเพิ่มเติม 2 วิธี. สมาชิกสาธารณะทุกคนสามารถเข้าถึงการใช้งาน Python ใดก็ได้หลังจากติดตั้งแพ็คเกจ FOSS for Python. คุณสมบัติ: encoding, font_family, font_name, font_style, font_type, glyph_accessor,และอีก 4 คน.
คุณสมบัติ
| ชื่อ | ประเภท | 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. |
metadata_xml | str | อ่าน | รับ XML ของเมตาดาต้า. |
inner_font | TtfFont | อ่าน | รับแบบอักษรภายใน. |
วิธีการ
| Signature | คําอธิบาย |
|---|---|
__init__(inner: TtfFont, metadata_xml: str) | Calls init การประกอบการ ในตัวอย่างนี้ Woff2Font. |
get_kern_pairs() → list[KernPair] | กลับคู่เม็ด. |
| `to_bytes(font_type: FontType | None)→bytes` |
font_type() → FontType | การคืน FontType ของตัวอย่าง Woff2Font นี้ |
font_name() → str | เรียก font_name ในตัวอย่าง Woff2Font นี้. |
font_family() → str | เอกสารที่ถือรหัสชื่อครอบครัวของตัวอักษร |
font_style() → str | เอกสารที่ถือรหัส style descriptor ของตัวอักษร |
num_glyphs() → int | คุณสมบัติถือการนับ glyph ทั้งหมดเป็นจํานวนเต็ม |
metrics() → FontMetrics | กลับวัตถุ FontMetrics ที่มีเมทริกของตัวอักษร |
encoding() → FontEncoding | เอกสารที่ถือตัวอย่าง FontEncoding ที่อธิบายการโคดของฟอนต์ |
glyph_accessor() → GlyphAccessor | เอกสารที่ถือ GlyphAccessor สําหรับการปฏิบัติ glyph |
save(path: str) | เรียก Save ในตัวอย่าง Woff2Font นี้. |
save_to_format(font_type: FontType, path: str) | เรียก save_to_format ในตัวอย่าง Woff2Font นี้. |
convert(target: FontType) → Font | ส่งวัตถุ Font ในรูปแบบเป้าหมายที่ต้องการ, ทําให้การแปลงจาก WOFF2 font เป็นรูป แบบอื่นๆ ที่รองรับ เช่น TTF หรือ OTF ได้ |