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

[Bug]: juce::Typeface::createSystemTypefaceFor returns no Font with OTF Font Type #1475

Open
1 task done
francescopellegrni opened this issue Nov 18, 2024 · 5 comments
Open
1 task done

Comments

@francescopellegrni
Copy link

Detailed steps on how to reproduce the bug

` auto reloadRegular = juce::Typeface::createSystemTypefaceFor(BinaryData::ReloadRegular_otf, BinaryData::ReloadRegular_otfSize);

auto ff = juce::Font(reloadLight);

            auto fontRescaleSize = juce::jmap<float>(pluginWidth, 763, 1970, 12.f, 30.f);
            
            ff.setSizeAndStyle(fontRescaleSize, "Light", 1.f, -0.01f);
            //ff.setSizeAndStyle(18.f, "Light", 1.f, -0.01f);
            g.setFont(ff);
            g.drawText(juce::String(rswl->getValue(), rswl->getName() == "Gain" ? 1 : rswl->getName() == "Spread" ? 2 : rswl->getName() == "Width" ? 0 : rswl->getName() == "Limiter" && rswl->getValue()<=99.9f ? 1 : 0), 0 + (x * 0.13f), 0 + (y * 0.056f), rw, rw, juce::Justification::centred);`

Working in both JUCE 6 and 7, but stopped working in juce 8.

version 8.0.4 - Xcode 16 - Sequoia

What is the expected behaviour?

Have the text with the off font.

Operating systems

macOS

What versions of the operating systems?

16

Architectures

x86_64, Arm64/aarch64

Stacktrace

No response

Plug-in formats (if applicable)

No response

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

I have not tested against the develop branch

Code of Conduct

  • I agree to follow the Code of Conduct
@reuk
Copy link
Member

reuk commented Nov 19, 2024

Is the code snippet copied directly from your project?

auto reloadRegular = ...
auto ff = juce::Font (reloadLight);

Where are you initialising reloadLight?

@francescopellegrni
Copy link
Author

sorry reloadLight was my TTF font that made me realize the bug.. you should put the otf font in that constructor.

@reuk
Copy link
Member

reuk commented Nov 19, 2024

Are you saying that you're still seeing the problem if you pass an otf font there? If the issue is resolved, please let me know and I'll close this issue.

@francescopellegrni
Copy link
Author

francescopellegrni commented Nov 19, 2024 via email

@reuk
Copy link
Member

reuk commented Nov 20, 2024

I haven't been able to reproduce this issue so far. OTF fonts loaded from binarydata display as I'd expect in a new GUI app project running on macOS 15.

Working in both JUCE 6 and 7, but stopped working in juce 8.

Is the JUCE version definitely the only thing that changed, or did you make any source code or configuration changes to your project during the upgrade?

It would be helpful to see the entire source code of a minimal program that demonstrates the issue, so that we can rule out bugs in the program code.

It would also be a good idea to test with a different .otf font and check whether you get the same results. If the issue is triggered by a specific property of the font, then we may need a copy of the font file in order to investigate further.

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

No branches or pull requests

2 participants