TtfFont
Overview
TtfFont เป็นคลาสใน Aspose.Font FOSS สําหรับ Python. ทายาทจาก: Font.
TtfFont.save(path) เขียนตัวอย่าง font ปัจจุบันไปยังเส้นทางระบบไฟล์ที่ได้รับในรูปแบบพื้นบ้าน.
หมวดนี้ให้ 23 วิธีในการทํางานกับวัตถุ TtfFont ในโปรแกรม Python. วิธีการที่ใช้ได้แก่: __init__, available_naming_strategies, convert, encoding, font_family, font_name, font_style, font_type, get_axis, get_blob, get_kern_pairs, get_named_instance,และ 11 วิธีเพิ่มเติม. สมาชิกสาธารณะทุกคนสามารถเข้าถึงการใช้งาน Python ใดก็ได้หลังจากติดตั้งแพ็คเกจ FOSS for Python. คุณสมบัติ: axes, cff_font, encoding, font_family, font_name, font_style,และอีก 12 คน.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
font_type | FontType | Read | ได้รับตัวอักษร. |
font_name | str | Read | ได้ชื่อตัวอักษร. |
font_family | str | Read | ได้รับครอบครัวตัวอักษร. |
font_style | str | Read | ได้รับรูปแบบของตัวอักษร. |
num_glyphs | int | Read | ได้รับการอักษร num. |
metrics | FontMetrics | Read | ได้มาตรฐานแล้ว. |
encoding | FontEncoding | Read | ได้รับรหัส. |
glyph_accessor | GlyphAccessor | Read | ได้รับเครื่องมือกลิฟ์. |
ttf_tables | TtfTableSet | Read | ได้ตาราง TTF. |
cff_font | `` | Read | ได้รับการอักษร cff. |
fvar | `“FvarTable | None”` | Read |
hvar | `“HvarTable | None”` | Read |
is_variable | bool | Read | ได้ค่าตัวแปร. |
axes | "list[AxisRecord]" | Read | ได้มีด. |
named_instances | "list[NamedInstance]" | Read | ได้ตัวอย่างที่ชื่อไว้. |
variable_axes | list[VariableAxis] | Read | ได้แกนที่เปลี่ยนไป. |
variable_instances | list[VariableInstance] | Read | ได้ตัวแทนที่เปลี่ยนได้. |
smart_instancer | `` | Read | ได้ตัวอย่างที่ฉลาดแล้ว. |
Methods
| Signature | Description |
|---|---|
__init__(sfnt_data: bytes, tables: TtfTableSet, sfnt_version: int) | Calls init การประกอบการ ในตัวอย่างนี้ TtfFont. |
get_blob(tag: str) → `bytes | None` |
get_table_bytes(tag: str) → bytes | การคืนไบต์ของตาราง TrueType ที่กําหนดไว้ |
set_table_bytes(tag: str, data: bytes) | กําหนดค่า bytes ของตาราง. |
get_axis(tag: str) → `VariableAxis | None` |
| `get_named_instance(name: str, preferred_languages: str | tuple[str, …])→VariableInstance |
| `variable_presentation(preferred_languages: str | tuple[str, …], include_suggested_values: bool)→dict[str, object]` |
available_naming_strategies() → tuple[str, ...] | การคืน tuple ของการระบุกลยุทธ์การตั้งชื่อที่สนับสนุน |
| `instantiate(coordinates: dict[str, float], naming_strategy: str, family_suffix: str | None, legacy_family_name: str |
| `preview_naming_policy(coordinates: dict[str, float], naming_strategy: str, family_suffix: str | None, legacy_family_name: str |
get_kern_pairs() → list[KernPair] | กลับคู่เม็ด. |
| `to_bytes(font_type: FontType | None)→bytes` |
font_type() → FontType | ส่งผลการนับจํานวน FontType ของตัวอักษรปัจจุบัน |
font_name() → str | เอกสารที่ถือรหัสชื่อเต็มของตัวอักษร |
font_family() → str | ที่ดินถือชื่อครอบครัว |
font_style() → str | อสังหาริมทรัพย์ถือชื่อสไตล์ |
num_glyphs() → int | อสังหาริมทรัพย์ถือการนับ glyphs |
metrics() → FontMetrics | ส่งกลับวัตถุ FontMetrics พร้อมข้อมูลขนาดและระยะทาง |
encoding() → FontEncoding | การคืนของ FontEncoding อัตถุที่อธิบายการผนับตัวละคร |
glyph_accessor() → GlyphAccessor | การคืน GlyphAccessor สําหรับการปฏิบัติ glyph ระดับต่ํา |
save(path: str) | ` เขียนสภาพปัจจุบันของตัวอักษร TrueType ไปยังระบบไฟล์ที่ตั้งไว้ |
save_to_format(font_type: FontType, path: str) | เรียก save_to_format ในตัวอย่าง TtfFont นี้. |
convert(target: FontType) → Font | การคืนของตัวการแปลง Font เป็นเป้าหมาย FontType |