Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could some way be available to prevent reseting styles when initiate a PhpWord instance ? #2747

Open
2 tasks
warmbook opened this issue Feb 11, 2025 · 1 comment

Comments

@warmbook
Copy link

warmbook commented Feb 11, 2025

Describe the problem

Style settings are cached in static property Style::$styles, in 'Resident Process Mode' such as Swoole, that may cause to some unexpected problems. For example, set different style values with same name in two concurrent coroutines, the latter would overwrite or use the former's value.
In my programs, I can set each different value to a unique name. But now that every style name is unique, why not set them after the Resident Process be started and use them in each coroutine latter? Set and reset same values is a waste of computer resources.
So I need some way to prevent reseting styles in PhpWord's __construct method, for example, provide a boolean static property Style::$notReset to control whether to clear Style::$styles.

Describe the expected behavior

Provide some way to prevent reseting styles when initiate a PhpWord instance. Another thorough suggestion is cache style settings in Style's instance property rather than it's static property.

Priority

  • I want to crowdfund the feature (with @algora-io) and fund a community developer.
  • I want to pay the feature and fund a maintainer for that. (Contact @Progi1984)
@MyMa777
Copy link

MyMa777 commented Feb 19, 2025

It's not a problem linked to phpword. It's caused by the font-family.

With Segoe UI Emoji it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants