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

[Image Font Importer] Adds support for \uXXXX in the kerning config strings. #93119

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Jun 13, 2024

Partially fixes #93066

Spaces can be now added to kerning pairs with \u0020, not the most elegant solution, but not much can be changed without breaking existing imports.

I'll probably make a separate PR adding the advanced import dialog for bitmap fonts, since entering it via standard property editor is not convenient.

@bruvzg bruvzg added this to the 4.3 milestone Jun 13, 2024
@bruvzg bruvzg requested a review from a team as a code owner June 13, 2024 06:25
@akien-mga akien-mga merged commit e351b89 into godotengine:master Jun 13, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

for (int i = 0; i < kp_tokens[0].length(); i++) {
if (i <= kp_tokens[0].length() - 6 && kp_tokens[0][i] == '\\' && kp_tokens[0][i + 1] == 'u') {
char32_t charcode = kp_tokens[0].substr(i + 2, 4).hex_to_int();
from_tokens += charcode;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bruvzg This bit of code is missing a part to advance past the hex characters and thus includes u and whatever 4 hex characters are included after it. I think it just needs i += 5 here and in the next loop set to fix it. Do I need a demo project for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kerning Pairs property for Monospace Image Font Data does not support spaces
3 participants