Skip to content

Conversation

funatsufumiya
Copy link
Contributor

@funatsufumiya funatsufumiya commented Aug 25, 2025

Some part didn't work on windows oF 0.12.0. This fixes it. (Confirmed also working on macOS.)

In particular, please note that std::optional is not available in the default environment generated by oF 0.12.0 Project Generator on Windows.

Please consider carefully whether to merge.

@NickHardeman
Copy link
Owner

HI @funatsufumiya, thank you for the pull request and using the addon :)
This would be a breaking change in OF 12.1 since boost is not included anymore.

I have been working on updating the ofxSvg to function similar to ofxSvgParser.
openframeworks/openFrameworks#8266
There are more features including saving and better text parsing, but could use some more testing, especially on Windows.

I noticed some issues with std::optional as well and implemented another version here, but need to integrate it throughout the addon
https://github.com/openframeworks/openFrameworks/pull/8266/files#diff-995ac37ba780f941e219eff1b5a0e226c8cc5f56f69db95711135d9b3437f5c7

Thank you for pointing out this issue!

@funatsufumiya
Copy link
Contributor Author

Thank you for your quick response.

Sorry for my misunderstanding of compatible with >= 12.0 in README. This can be always happen just like bevy version table.

@NickHardeman
Copy link
Owner

@funatsufumiya you read the README correctly! 😊 It should be updated to work with 12.0; I don't use Windows often so thank you for pointing it out.

Can you update this PR to use the Optional class in ofxSvgCss::Optional instead of std::optional or boost?

class Optional {

And comment out / remove the optional include here:

#include <optional>

@@ -784,7 +785,7 @@ void Parser::_parsePath( ofXml& tnode, std::shared_ptr<Path> aSvgPath ) {

bool bRelative = false;
std::vector<glm::vec3> npositions= {glm::vec3(0.f, 0.f, 0.f)};
std::optional<ofPath::Command::Type> ctype;
boost::optional<ofPath::Command::Type> ctype;
Copy link
Owner

@NickHardeman NickHardeman Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try updating this to
CssClass::Optional<ofPath::Command::Type> ctype;
Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I think this PR is sill valuable for windows 0.12.0 oF users, so I'll create another PR for this (as for 0.12.1.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #3. I tested it with oF v0.12.1 both macOS / Windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CssClass::Optional<ofPath::Command::Type> ctype;

Sorry for having miss-checked this. I also test this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested on macOS/Windows oF 0.12.0 / 0.12.1.
Now both #2 and #3 is the same one. So I'll close #2.

@funatsufumiya
Copy link
Contributor Author

funatsufumiya commented Aug 25, 2025

3a8d7a3 Now the same content to #3 . I'll close this PR, so please merge #3.

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

Successfully merging this pull request may close these issues.

2 participants