Skip to content

How to Add Font Styling to Paragraph Style when Creating Word Document #2754

@Theddie

Description

@Theddie

When creating word documents, PHPWord allows for defining custom paragraph styles, which in turn text content can be assigned to. The features that can be defined when creating paragraph styles seem to cover only those features that strictly relate to paragraphs -- see https://phpword.readthedocs.io/en/latest/styles.html.

When creating paragraph styles in Word, however, one can -- in addition to defining strictly-paragraph-related stuff like the paragraph's line-height -- also set properties that relate to the font styling of said paragraph. For example, one can set its (default) font-size to 16pt or its (default) font-weight to bold.

Is there a way to include such font-style-related settings in paragraph styles when creating them in PHPWord? I didn't find any information related to this question in either the docs or the web.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions