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

[RDY] Chinese and memory leak fixes #1478

Merged
merged 2 commits into from Oct 2, 2018

Conversation

Projects
None yet
2 participants
@TheCycoONE
Member

TheCycoONE commented Sep 27, 2018

Adds line breaking after Chinese punctuation characters, and fixes a couple memory leaks relating to freetype rendering.

@TheCycoONE

This comment has been minimized.

Show comment
Hide comment
@TheCycoONE

TheCycoONE Sep 27, 2018

Member

@Icenowy could you confirm that this displays the text correctly. It looks right to me, but since I can't read it I want to make sure I'm not corrupting characters or something.

Member

TheCycoONE commented Sep 27, 2018

@Icenowy could you confirm that this displays the text correctly. It looks right to me, but since I can't read it I want to make sure I'm not corrupting characters or something.

@@ -702,7 +710,7 @@ text_layout freetype_font::draw_text_wrapped(render_target* pCanvas, const char*
// Calculate the line height and baseline position.
FT_Pos iLineHeight = 0;
FT_Pos iBaselinePos = 0;
for(const char* s = itr->first; s != itr->second; )
for(const char* s = itr->first; s < itr->second; )

This comment has been minimized.

@TheCycoONE

TheCycoONE Sep 27, 2018

Member

These changes aren't actually necessary - but I feel more comfortable with them. I got a buffer overflow when I messed up the number of skipped bytes above originally.

@TheCycoONE

TheCycoONE Sep 27, 2018

Member

These changes aren't actually necessary - but I feel more comfortable with them. I got a buffer overflow when I messed up the number of skipped bytes above originally.

Break after chinese punctuation characters.
Punctuation is not followed by a space in Chinese so we have to break
after the character itself instead of on space.

@TheCycoONE TheCycoONE changed the title from [RFC] Chinese and memory leak fixes to [RDY] Chinese and memory leak fixes Oct 2, 2018

@TheCycoONE

This comment has been minimized.

Show comment
Hide comment
@TheCycoONE

TheCycoONE Oct 2, 2018

Member

Improved readability. @Icenowy verified the fix on irc.

Member

TheCycoONE commented Oct 2, 2018

Improved readability. @Icenowy verified the fix on irc.

@TheCycoONE

This comment has been minimized.

Show comment
Hide comment
@TheCycoONE

TheCycoONE Oct 2, 2018

Member

Oh, I also added ideographic space (0x3000) to the list of characters, since it seemed like it fit in.

Member

TheCycoONE commented Oct 2, 2018

Oh, I also added ideographic space (0x3000) to the list of characters, since it seemed like it fit in.

@Alberth289346 Alberth289346 merged commit f16a510 into CorsixTH:master Oct 2, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment