Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - obscurelyme

Pages: [1]
1
I have a branch that leverages freetype 2.10. You can take a look here. There isn't any modification needed just leverage the extensions to handle the heavy lifting.

It's important to remember that you need to have VCPKG_FEATURE_FLAGS set to "versions" as an environment variable in order for vcpkg versions to work.

https://github.com/obscurelyme/Semi-Pro-Cpp/tree/feature/sfml-freetype

Let me know if you have any questions.

2
I just updated my vcpkg.json to use Freetype 2.10 and it works! Many thanks.

3
Yikes, so vcpkg does have some in-development version control over what dependencies are to be installed. The lowest version of freetype that anyone can specify using vcpkg is 2.9.x and SFML uses 2.5.5 So Looks like vcpkg could be a non-starter for SFML type projects.

4
Thanks for the advice. I'll give it a go configuring CMake to pull in freetype from SFML. More to come.

5
Update:

I pulled down my source and compiled on OSX Big Sur v11.5.2 and it seems to work as intended. So right now I'm unsure if this is a platform issue or perhaps Mac is compiling with static libs vs on Windows I'm getting dynamic libs.

Here is the screenshot on OSX attached.

Would still like to get to the bottom on why this code doesn't work on x64 Windows 10.

6
Hello,

I'm looking for some advice on how to use sf::Text object. Specifically what is causing this crash to occur from Freetype library. Right now, any attempts to draw sf::Text results in a crash. I have included a link to my source code below as well as screenshots that showcase my setup after a build/crash. I am running 64-bit Windows with vcpkg as my main source of pulling in dependencies. I'm more than certain I am using debug libraries for a DEBUG build as vs code cmake tools sets by default.

My Source Code
https://github.com/obscurelyme/hello-sfml/blob/ed15963b38b896e414fab1b811ac5c8c7918e92d/main.cpp#L53-L73

Code Snippet:

// Load fonts
    std::string executableDirectory = std::filesystem::weakly_canonical(std::filesystem::path(argv[0])).parent_path().string();
    std::string relativeFontFile = "/assets/fonts/Roboto/Roboto-Regular.ttf";
    std::string fontFilePath = executableDirectory.append(relativeFontFile);
    sf::Font font;
    if (!font.loadFromFile(fontFilePath))
    {
        spdlog::debug("Could not load Roboto-Regular.ttf from directory {}", fontFilePath);
    }
    else
    {
        spdlog::debug("Successfully loaded {} font-family.", font.getInfo().family);
    }

    sf::Text text{"Hello", font, 48};
    text.setFillColor(sf::Color::Red);
    text.setStyle(sf::Text::Regular);
    text.setPosition(200, 200);
    ...
    while(running) {
       sf::Event event;
       while(window.pollEvent(event)) {
           // handle event[s] ...
       }

       window.clear(sf::Color::Blue);

        window.draw(text); // program crashes when this is called.

        window.display();
    }
 



Here is the screenshot of the crash in debugger

Pages: [1]
anything