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

Custom font family doesn't work? #21

Open
cloverpi opened this issue Mar 6, 2021 · 5 comments
Open

Custom font family doesn't work? #21

cloverpi opened this issue Mar 6, 2021 · 5 comments

Comments

@cloverpi
Copy link

cloverpi commented Mar 6, 2021

Hey there,
I can't seem to get the font family to change when using a custom config per your example in the docs.

StdUi.config = {
	font        = {
		family    = "Fonts\\MORPHEUS.ttf",
		size      = 10,
		titleSize = 16,
		effect    = 'NONE',
		strata    = 'OVERLAY',
		color     = {
			normal   = { r = 1, g = 1, b = 1, a = 1 },
			disabled = { r = 0.55, g = 0.55, b = 0.55, a = 1 },
			header   = { r = 1, g = 0.9, b = 0, a = 1 },
		}
	},
...
}

Color seems to change just fine, however font family and size do not change when creating a checkbox (edit: or label). Am I doing something wrong here?

@Zaazu
Copy link

Zaazu commented May 13, 2021

Having the same problem, I can't find anywhere in the code where anything except color is referenced.

@Ofrex
Copy link

Ofrex commented Jul 6, 2021

I know its 4 months down the line but I can't seem to get this working either - did anyone get it to work?

@cloverpi
Copy link
Author

cloverpi commented Jul 6, 2021

So as Zaazu above determined the font is never actually being changed in the library. So you need to:

    local b = StdUi:Button(frame, width, height, text)
    b.text:SetFont(StdUi.config.font.family,StdUi.config.font.size)

There are a few little bugs that need workarounds in StdUI, so I wrote a helper to resolve these issues for my project. Even with all these minor inconveniences, StdUI is still a fantastic library.

@pwilkowski
Copy link
Contributor

I have remembered that changing font by default was causing some issues and it was removed.

@Ofrex
Copy link

Ofrex commented Jul 7, 2021

Excellent - thank you for the info! The easiest library I've found!

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

4 participants