Skip to main content

Set east asia font in pptx correctly.

Project description

pptx-ea-font

Fix the problem that the setting of East Asian fonts in python-pptx is invalid or incorrect.

修正 python-pptx 中东亚字体设置无效、不正确的问题。

Installation

pip install pptx-ea-font

Example

from pptx import Presentation
import pptx_ea_font


prs = Presentation('演示文稿.pptx')
for slide in prs.slides:
    for shape in slide.shapes:
        if shape.has_text_frame:
            text_frame = shape.text_frame
            for paragraph in text_frame.paragraphs:
                for run in paragraph.runs:
                    pptx_ea_font.set_font(run, '微软雅黑')  # 传入一个 run 对象以及字体名称
prs.save('字体修改版.pptx')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pptx_ea_font-0.0.4.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

pptx_ea_font-0.0.4-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file pptx_ea_font-0.0.4.tar.gz.

File metadata

  • Download URL: pptx_ea_font-0.0.4.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.19.1 CPython/3.11.6 Windows/10

File hashes

Hashes for pptx_ea_font-0.0.4.tar.gz
Algorithm Hash digest
SHA256 9a1fed96e09ec8c40e9373a3b5ec05321abb4cc77b58e9499946d304101b3d57
MD5 4d8eea9ab628f0985f35580f69050ddf
BLAKE2b-256 91a58aa15334814fcf207b732d536b78e8ddc4037b2b9574af88712d6eb90c00

See more details on using hashes here.

File details

Details for the file pptx_ea_font-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pptx_ea_font-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.19.1 CPython/3.11.6 Windows/10

File hashes

Hashes for pptx_ea_font-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 53016eb69d46bf6e110d772cfd94d67a2c6d61d7fe1bf23baacd8ce8e329c8c2
MD5 477c343967230e268da8c96b0b1f4faa
BLAKE2b-256 e99e3ea67598d70baf4ca137c59d6e153da4afda697e82049648d0a5ebcf7fa9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page