Aspose.Slides FOSS за Python

API референция за: Aspose.Font FOSS for Python v1.0.0. 139 public types organized by module.

Основен API

КласътОписание на състоянието
ActiveTupleSummaryActiveTupleSummary.to_dict() връща речник, съдържащ индекса на туплето, скаларната стойност, координатите за върховете, началните и крайните координати.
AnimationAssetAnimationAsset.write_to(path) записва генерираните анимационни данни на дадено местоположение в файловата система, създава липсващи родителски директории и връща Пътя на записания файл.
AnimationFramePackageAnimationFramePackage.write_to(path) записва изображението на сценария, всяко изложение на рамка и манифест JSON, описващ fps и етикети за кадри в посочения директорий.
AnimationPresetAnimationPreset.name stores the identifier of the animation preset.
AnimationPreviewBuilderAnimationPreviewBuilder.available_presets returns a tuple of preset names for animation generation.
AnimationReviewPackageAnimationReviewPackage.write_to saves the review package to the given filesystem path and returns the Path.
AnimationShowcasePackageAnimationShowcasePackage.write_to writes the package to the given path and returns the resulting Path.
AnimationStepAnimationStep.coordinates stores a mapping of axis names to float values defining the font instance.
BinaryReaderОблича байт източник в търсими BytesIO за big-endian font бинарно анализиране.
BinaryWriterСъбира байтове за сериализация на двоичен шрифт.
CffSerializerCffSerializer може да сериализира напълно запълнен CffFont в байт масив, подходящ за писане като CFF или OpenType файл на шрифтове.
ClosePathКласът се разширява PathCommand.
CompatibilityCheckerCompatibilityChecker.compare_fonts(преди, след, преди_label, after_ label , кодове, текст) произвежда CompatibilityReport , който може да бъде експортиран в JSON чрез report.to_json ((indent=2, sort_keys=True).
CompatibilityReportCompatibilityReport.to_json(indent, sort_keys) връща JSON нишка на доклада и write_ json ((target, indent , sort _ keys)) пише този JCON директно във файл.
CompletedTaskRecordCompletedTaskRecord.task_id uniquely identifies the completed task.
CompositeComponentMovementCompositeComponentMovement.to_dict returns a dict of the object’s numeric and boolean fields.
CompositeGlyphComponentCompositeGlyphComponent.to_dict() връща дикта на числовите атрибути на компонента.
CoverageGroupДиагностика на покритие за един източник на заявки, като например предварително зададен текст или диапазон.
CurveAdapterCurveAdapter.quad_to_cubic converts a quadratic Bézier (p0, q, p3) to an equivalent cubic Bézier, returning four points.
CurveToCurveTo.x1 is the x‑coordinate of the first Bézier control point.
DeltaInspectorDeltaInspector позволява подробен анализ на дельта от шрифтове на променливи, генерирайки обектите GlyphDeltaReport и { PLACHAULDER _2 ], които показват промени в координатите между инстанциите.
DeltaPointDeltaPoint.to_dict returns a dictionary of the point’s numeric components.
DeltaTupleReportDeltaTupleReport.tuple_index is the zero‑based index of the delta tuple.
EotSerializerEotSerializer.serialize(font) връща пълното двоично представяне на EOT шрифт, готов за изход от файл.
FamilyReviewExportPackageFamilyReviewExportPackage.write_to(directory) създава набор от HTML, CSS и манифест файлове за семейство шрифтове, връщайки списъка с генерираните пътеки към файловете.
FontАбстрактна база за всички формати на шрифтовете.
FontCleanerМетаданни за шрифтове и технически чистилки.
FontConversionExceptionПодигнат, когато преобразуването на формат на шрифт не се осъществява или не е поддържано.
FontConverterFontConverter.convert(font, target) произвежда нов обект за шрифт в целевия формат, като повишава значението на FontConversionException ако не може да се извърши преобразуването.
FontEncodingКарти на Unicode кодовете към идентификационните знаци.
FontExceptionБазов клас за всички изключения от библиотеката на шрифтовете.
FontLoaderFontLoader.open ((source, font_type, collection_index) връща обект Font, представляващ поискания тип шрифт без напълно да се зарежда целия файл в паметта.
FontMetricsFontMetrics излага ключови типографски стойности като units_per_em, ascender, descender и line_gap за изчисления на оформлението.
FontNotSupportedExceptionПостроени за валидни, но неподдържани характеристики на шрифта (напр.
FontParseExceptionПовишен, когато данните от двоичен шрифт не могат да бъдат анализирани.
FontPreviewBuilderFontPreviewBuilder.build(font, text, size, color, background, padding, antialias, file_stem, instance_coordinates, instance_name, output_format) генерира PreviewImage (PNG или SVG) от предоставения текст, изобразен с даден шрифт.
FontSourceInfoОпишете произхода на заредените байтове.
FontSubsetterFontSubsetter.available_presets() връща група от предварително зададени имена, които могат да бъдат използвани за уеб-ориентирани поднастройки.
GlyphGlyph.glyph_id identifies the glyph using its numeric GlyphId.
GlyphAccessorИзвлича глифи по ID или Unicode кодовата точка.
GlyphCompatibilityIssueGlyphCompatibilityIssue.to_dict returns a dictionary representation of the issue.
GlyphDeltaComparisonReportGlyphDeltaComparisonReport.moved_point_count is the count of points that moved between before and after.
GlyphDeltaReportGlyphDeltaReport.to_dict returns a dictionary representation of the report’s data.
GlyphIdGlyphId.value holds the integer identifier of a glyph.
GlyphInterpolationIssueGlyphInterpolationIssue.codepoint is the integer Unicode codepoint of the affected glyph.
GlyphLayoutЕдинствен глиф, разположен в координатите на световното пространство.
GlyphNotFoundExceptionПовишаване, когато поисканият идентификатор на глифа или кодова точка няма мапиране във шрифта.
GlyphOutlineStatsGlyphOutlineStats.to_dict returns a dictionary representation of the outline statistics.
GlyphPathПоръчана последователност от PathCommand обекти, представляващи очертанието на един глиф.
KernPairKernPair.left is the GlyphId of the left glyph in the kerning pair.
LanguageProfileLanguageProfile.to_dict returns a dictionary representation of the language profile.
LineToLineTo.x represents the horizontal coordinate of the line endpoint.
LoadedFontДобър резултат за зареждане, който обгръща шрифт плюс източни метаданни.
LocalizationCoverageLocalizationCoverage.to_dict returns a dictionary representation of the coverage data.
LocalizationResolutionLocalizationResolution.to_dict returns a dictionary representation of the resolution state.
MoveToMoveTo.x stores the horizontal coordinate for the move operation.
PathCommandАбстрактен маркер за всички типове команди по пътеки.
PreviewImagePreviewImage.write_to(path) записва генерирания PNG или SVG предварителен изглед на посоченото местоположение в файловата система и връща обекта Path.
QuadraticToQuadraticTo.x1 represents the x‑coordinate of the quadratic Bézier control point.
RasterizerСканиращ растеризатор за GlyphPath очертания с чист Python PNG експорт.
RequestedLanguageHintRequestedLanguageHint.to_dict returns a dictionary representation of the hint object.
ResolvedInstanceResolvedInstance.label is the human‑readable name of the resolved instance.
SmartInstancerSmartInstancer.instantiate(координати, instance_name, naming_strategy, family_suffix, legacy_family_names, typographic_familiename, legity_style_nama, typo_type_ name, stat_policy) връща обект TtfFont, който представлява статичен пример на променливия шрифт.
SubsetCoverageСъвкупна диагностика на обхвата на Unicode за заявление за подпостановки.
SubsetResultИзходът от субсетиране, съчетан с доклада за покритие, използван за неговото изготвяне.
TaskCompletionReceiptTaskCompletionReceipt.task_id identifies the task uniquely.
TaskTokenEstimateTaskTokenEstimate.task_id is the unique identifier of the task.
TextDeltaComparisonReportTextDeltaComparisonReport.to_dict() връща речник, съдържащ всички полета на доклада.
TextDeltaReportTextDeltaReport обобщава информация за глифа на ниво делта, като разкрива график_брой, активен_график _броя и колекция от отчети за графики_за проверка по КА.
TextLayoutРезултат от обаждане TextRenderer.layout.
TextRendererОпределя текст, използвайки графичните метрики на шрифта и опционални двойки ядра.
TtfSerializerTtfSerializer.serialize serializes the given font object to a byte array, optionally using the provided sfnt version.
TupleScalarDeltaTupleScalarDelta.to_dict() връща дикт с стойности за tuple_index, before_scalar и after_Scaler.
Type1SerializerType1Serializer.serialize_pfb converts a font object to PFB binary data.
UnsupportedFontFormatExceptionПодигнат от FontLoader, когато файлът не е разпознат.
VariableAxisVariableAxis.normalize(value) връща нормализираното (0-1) положение на оригиналната координата на оста в съответствие с определения обхват на осите.
VariableAxisPresetVariableAxisPreset.to_presentation(axis) връща речник от метаданни за представяне на предварително зададените елементи, подходящи за изобразяване в потребителския интерфейс на предизборните контролни елементи.
VariableInstanceVariableInstance.css_variation_settings(axes) произвежда един тупол от CSS font-variation-settings струнки за даден набор от оси.
WebFontAssetWebFontAsset.filename stores the original font file name as a string.
WebFontBuilderWebFontBuilder може да генерира пълни семейства от уеб шрифтове с CSS, HTML страници за предварително изглеждане и манифестови файлове готови за разгръщане.
WebFontBundleWebFontBundle.write_to writes the bundle to a directory and returns the list of written file paths.
WebFontFamilyPackageWebFontFamilyPackage.write_to(directory) създава пълен пакет от семейство, съдържащ CSS, HTML, манифест и всички обвързани фонтови активи за множество варианти на стилове.

Изброявания

Изброяване на данниОписание на състоянието
FontTypeFontType.TTF represents the TrueType font format.

Свързване с шрифтовете CFF

КласътОписание на състоянието
CffCharsetCffCharset.standard(num_glyphs) създава стандартен CFF символ за дадения брой глифи, а name_for ((gid) връща името на глифа за идентификатор наглиф.
CffDictCffDict.from_bytes creates a CffDict instance from the given binary data.
CffEncodingCffEncoding.unicode_to_gid(codepoint) връща GlyphId за Unicode код по текущото кодиране CFF.
CffFontCffFont.get_kern_pairs() връща списък с обектите KernPair, които представляват корекциите на кърнънгта, определени във шрифта.
CffIndexCffIndex.from_reader(r) създава инстанция на CffIndex чрез анализиране на данни от двоичен читател r.
PrivateDictPrivateDict.from_dict(d) създава инстанция на PrivateDict от речник, съдържащ частни диктовки като default_width_x и nominal_ width _x.
PrivateDictOpPrivateDictOp.BLUE_VALUES represents the BlueValues entry defining alignment zones for horizontal stems.
TopDictTopDict.from_dict(d, string_index) създава инстанция на TopDict от речник и таблица с индекс на строки, което позволява програмирана реконструкция в метаданните за шрифт на най-високо ниво.
TopDictOpTopDictOp.VERSION represents the font’s version number.
Type2InterpreterТълкува чифтчета от тип 2 в GlyphPath команди.

Осигуряване на EOT шрифт

КласътОписание на състоянието
EotFontВграден OpenType (EOT) обертък върху вътрешния шрифт TrueType/OpenType.
EotHeaderEotHeader.eot_size is the total size of the EOT file in bytes.

TrueType Свързване с шрифта

КласътОписание на състоянието
AvarAxisMapAvarAxisMap.mapping stores a list of (float, float) tuples that define input‑output value mappings for a variable font axis.
AvarTableAvarTable.from_reader(r, length) конструира AvarTable от двоичен читател и map_normalized ((axis_index, value) връща картографирания плаващ за нормализирана координата на ос.
AxisRecordAxisRecord.tag stores the four‑character axis tag identifier (e.g., ‘wght’).
CmapSubtableCmapSubtable.get_gid returns the glyph ID for a Unicode codepoint or None if unmapped.
CmapTableCmapTable.from_reader(r, table_length) анализира таблица с cmap от поток от шрифтове и best_subtable (()) избира най-подходящата CmapSubtable за търсене в Unicode.
DeltaSetIndexDeltaSetIndex.outer represents the outer index component of a delta set location.
DeltaSetIndexMapDeltaSetIndexMap.from_reader(r) изгражда DeltaSetIndexMap от двоичен читател и get ((gid) извлича съответния DeltaSetIndex .
FvarTableFvarTable.from_reader creates a new FvarTable by reading length bytes from a BinaryReader.
GlyfTableGlyfTable.from_reader reads a GlyfTable from a BinaryReader using the specified length and returns a GlyfTable instance.
GvarTableGvarTable.from_reader reads a GvarTable from a BinaryReader using the given length and axis tags.
HMetricКласа с 2 свойства.
HeadTableHeadTable.from_reader reads a BinaryReader and returns a populated HeadTable instance.
HheaTableHheaTable.from_reader reads a BinaryReader and constructs a HheaTable object.
HmtxTableHmtxTable.from_reader reads hmtx data from a BinaryReader and creates an HmtxTable instance.
HvarTableHvarTable.advance_width_delta(gid, normalized_coordinates) връща корекцията на ширината за идентификатор на глифа в посочените координати на нормализираната ос.
ItemVariationDataItemVariationData.from_reader creates an ItemVariationData instance by reading binary data from a BinaryReader.
ItemVariationStoreItemVariationStore.evaluate(delta_set_index, координати) изчислява дельта коригирането за променлива-чернописна ос въз основа на предоставените нормализирани координати.
KernTableKernTable.build_lookup() създава словарно картографиране (left_gid, right_did) на кубици от стойности за бързо търсене.
LocaTableLocaTable.glyph_offset(gid) връща наклона с байтове на данните от глифа за даден идентификатор на глиф в таблицата с глифи.
MaxpTableMaxpTable.to_bytes returns the binary encoding of the MaxpTable.
NameRecordNameRecord.platform_id identifies the platform for which the name record applies.
NameTableNameTable.language_key returns a language tag string for the given platform_id and language_id.
NamedInstanceNamedInstance.name_id is the integer identifier for the instance’s name record.
NamingPolicyPreviewРезултат на изпитване за генерирани записи с имена на статични инстанции.
Os2TableOs2Table.from_reader(r, table_length) анализира таблица OS/2 от двоичен читател и връща инстанция на { PLACHEHOLE}.
PlatformNamingDiagnosticsPlatformNamingDiagnostics предоставя булеви знамена и проверки на дължината (напр. postscript_name_safe, postscriptscript-name-length), за да се гарантира, че генерираните имена отговарят на ограниченията на платформата.
PostTablePostTable.version holds the version number of the post table.
StatNamingDiagnosticsStatNamingDiagnostics съобщава дали източният шрифт съдържа STAT таблици и препоръчва подходящи настройки за stat_policy за експорт.
TtcFaceRecordTtcFaceRecord.offset represents the byte offset of this face record within the TTC file.
TtfFontTtfFont.save(path) записва текущия шрифт в доставения файлов път във неговия естествен формат.
TtfGlyphParserTtfGlyphParser.parse parses the glyph identified by the given GlyphId and returns a Glyph object.
TtfInstancerTtfInstancer.preview_naming_policy returns a naming preview for a variable font instance based on given coordinates and naming options.
TtfTableSetTtfTableSet.get_raw returns the raw bytes of the table identified by the given tag, or None if absent.
TupleVariationTupleVariation.peak_coords holds the axis coordinate values that define the variation peak.
VariationRegionVariationRegion.scalar returns a scalar value for the region based on given coordinate mapping and axis tag order.
VariationRegionAxisVariationRegionAxis.scalar(coordinate) връща скаларната стойност на плавател за дадена координата по оси, като използва началото, върха и краят на свойствата на ос.

Тип 1 обработка на шрифт

КласътОписание на състоянието
AfmDataAfmData.font_name is the PostScript name of the font extracted from the AFM file.
AfmGlyphMetricAfmGlyphMetric свойства излагат името на глифа, кодова точка, предварителна широчина и гранична кутия за глиф, определен в AFM файл.
PfbSegmentPfbSegment.seg_type represents the integer identifier of the segment type in a PFB file.
Type1FontType1Font.load_afm loads an AFM file from the given path into the Type1Font instance.
Type1FontDataType1FontData.full_name is the full human‑readable name of the font.
Type1InterpreterType1Interpreter.interpret interprets a Type 1 charstring and returns a GlyphPath with the bytes consumed.

WOFF / WOff2 Управление на оборудване

КласътОписание на състоянието
Woff2FontWoff2Font.to_bytes(font_type) сериализира шрифта WOFF2 в обект с байтове за посочения тип шрифт.
WoffFontWoffFont.font_type returns the FontType enumeration value of this WOFF font.

Вижте също:

 Български