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

[text] Function request: Draw codepoints array #2275

Closed
wtjcn opened this issue Jan 10, 2022 · 4 comments
Closed

[text] Function request: Draw codepoints array #2275

wtjcn opened this issue Jan 10, 2022 · 4 comments
Labels
new feature This is an addition to the library

Comments

@wtjcn
Copy link

wtjcn commented Jan 10, 2022

I need a function to Draw Array of Codepoint, maybe:

void DrawCodepointArray(Font font, int *codepoint, int len, Vector2 position, float fontSize, Color tint);

@raysan5
Copy link
Owner

raysan5 commented Jan 12, 2022

@wtjcn I see the point of that function and I'm considering adding it.

@raysan5 raysan5 changed the title [core] need a function to Draw Array of Codepoint [text] Function request: Draw codepoints array Jan 12, 2022
@raysan5 raysan5 added the new feature This is an addition to the library label Jan 12, 2022
@raysan5
Copy link
Owner

raysan5 commented Jan 25, 2022

Here a code snippet for convenience:

void DrawTextCodepoints(Font font, int *codepoints, int count, Vector2 position, float fontSize, Color tint)
{
    for (int i = 0; i < count; i++) 
    {
        DrawTextCodepoint(font, codepoints[i], position + offset, fontSize, tint);
        // TODO: Compute next unicode codepoint position offset
    }
}

@siddharthroy12
Copy link
Contributor

I've submitted a pull request adding this function
#2308

@raysan5
Copy link
Owner

raysan5 commented Jan 26, 2022

@siddharthroy12 thanks for the improvement, I'm merging it but keep in mind that it could change the name or parameters, this function is still on design phase.

@raysan5 raysan5 closed this as completed Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This is an addition to the library
Projects
None yet
Development

No branches or pull requests

3 participants