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

feature request - LoadFontEx / LoadFont #231

Closed
guillaC opened this issue Feb 22, 2024 · 1 comment
Closed

feature request - LoadFontEx / LoadFont #231

guillaC opened this issue Feb 22, 2024 · 1 comment

Comments

@guillaC
Copy link

guillaC commented Feb 22, 2024

image

Unfortunately, the signature doesn't make it straightforward to use the LoadFontEx method, unlike the LoadFont method which accepts a string for the file path.

in the meantime, I'm doing:

    public static Raylib_cs.Font LoadFontEx(string fileName, int fontSize)
    {
        byte[] cheminBytes = System.Text.Encoding.ASCII.GetBytes(fileName);

        unsafe
        {
            fixed (byte* pChemin = cheminBytes)
            {
                return Raylib.LoadFontEx((sbyte*)pChemin, fontSize, null, 0);
            }
        }
    }
@chrisdill
Copy link
Owner

There is an existing utility method for LoadFontEx here. Look at the FontLoading example to see how it is used.

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