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

Font-less version of GeonBit? #142

Closed
Kubrix opened this issue May 1, 2024 · 5 comments
Closed

Font-less version of GeonBit? #142

Kubrix opened this issue May 1, 2024 · 5 comments

Comments

@Kubrix
Copy link

Kubrix commented May 1, 2024

I want to use my own fonts and use GeonBit UI. Is that possible?
I dont want to force end-user to install fonts - i have them in /Fonts subfolder

@Kubrix Kubrix changed the title Font-less versio of GeonBit? Font-less version of GeonBit? May 1, 2024
@Kubrix Kubrix closed this as completed May 1, 2024
@Kubrix
Copy link
Author

Kubrix commented May 1, 2024

Issue reopened. Can I NOT force user to install additional fonts?

@Kubrix Kubrix reopened this May 1, 2024
@RonenNess
Copy link
Owner

RonenNess commented May 1, 2024

That's a monogame limitation, not specific to geonbit.ui. I think you can pre build the spritefont and provide the xnb files with copy action instead of build, pretty sure that would work.

Ps be sure to use monospace fonts, or some features may not work properly.

@Kubrix
Copy link
Author

Kubrix commented May 1, 2024

not specific to geonbit.ui.

Ok but with https://github.com/rds1983/Myra/wiki i just provide .ttf with my prohgram and load fonts like this: https://github.com/FontStashSharp/FontStashSharp/wiki/Using-FontStashSharp-in-MonoGame-or-FNA#basic-usage

So i dont have to install them

@RonenNess
Copy link
Owner

RonenNess commented May 1, 2024

Looks cool!
You can use that lib to load the font and set the Resources instance fonts:

https://github.com/RonenNess/GeonBit.UI/blob/master/GeonBit.UI/Source/Resources.cs#L269

Didn't try it but I think it should work. That said, it would be a lot more easier to just pre-build your font, since you won't really utilize all the cool features FontStashSharp actually provides.

@BlizzCrafter
Copy link

Please also look at the open PR's #138 and #139.

You can use the font path in your .spritefont.xml like this:

<FontName>../../../../Fonts/Bitstream Vera Sans Mono Bold.ttf</FontName>

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

3 participants