Text Wrapping in Textblock in Korean cutting in middle of words instead of space character
Hello!
I am currently dealing with localization issues related to How the text wrapping cuts words in half in Korean. When using text wrapping in english or other language using latin alphabet. the wrapping happens in between words using space character or ponctuation. But for Korean, the text is cut in between each character, which breaks the meaning of the words.
Is there a way to force this per-word wrapping explicitly when possible or is that a bug that should be dealt with?
Here is an example snippet I made (you will need to replace the FontFamily bit by a font supporting Korean you have available)
If anyone has advise on how to deal with this situation, it will be greatly appreciated!
Thanks!
I am currently dealing with localization issues related to How the text wrapping cuts words in half in Korean. When using text wrapping in english or other language using latin alphabet. the wrapping happens in between words using space character or ponctuation. But for Korean, the text is cut in between each character, which breaks the meaning of the words.
Is there a way to force this per-word wrapping explicitly when possible or is that a bug that should be dealt with?
Here is an example snippet I made (you will need to replace the FontFamily bit by a font supporting Korean you have available)
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid.Resources>
<Style x:Key="Test" TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="FontSize" Value="24"/>
</Style>
</Grid.Resources>
<DockPanel>
<Slider Minimum="100" Maximum="1000" Value="300" x:Name="WidthSlider" DockPanel.Dock="Top" Margin="20" />
<StackPanel VerticalAlignment="Center" Orientation="Vertical" Width="{Binding ElementName=WidthSlider, Path=Value}" >
<Border Background="#55FFAA" Padding="5" Margin="0,30">
<TextBlock Style="{StaticResource Test}" Text="This is a sample sentence that happends to be a bit long but makes sense. Wrapping this should happen either at the beginning of a new phrase or at a space" />
</Border>
<Border Background="#55FFAA" Padding="5" Margin="0,30">
<TextBlock Style="{StaticResource Test}" FontFamily="#Kakao Small Sans" Text="이것은 약간 길지만 의미가 있는 샘플 문장입니다. 이것을 래핑하는 것은 새 구문의 시작 부분이나 공백에서 이루어져야 합니다." />
</Border>
</StackPanel>
</DockPanel>
</Grid>
Thanks!
Re: Text Wrapping in Textblock in Korean cutting in middle of words instead of space character
Hello!
Noesis follows the Unicode Line Breaking Algorithm. While there may be mistakes, we are always open to fixing them as soon as possible. However, in my initial experiments with WPF, I have observed similar behavior.
The mentioned line-breaking algorithm includes some 'optional' behaviors that need to be enabled. Could you please specify exactly what you are expecting, ideally with a screenshot?
Noesis follows the Unicode Line Breaking Algorithm. While there may be mistakes, we are always open to fixing them as soon as possible. However, in my initial experiments with WPF, I have observed similar behavior.
The mentioned line-breaking algorithm includes some 'optional' behaviors that need to be enabled. Could you please specify exactly what you are expecting, ideally with a screenshot?
Re: Text Wrapping in Textblock in Korean cutting in middle of words instead of space character
Hello !
Korean's text wrapping should normally behave similar to English (space character are used for linebreak candidate in order to not split the meaning of words, I am not an expert in Korean unfortunately but for example the deault behavior of Unreal UMG is the correct way to wrap Korean text. I made a gif of it : The rule in question in the unicode page you are mentioning is related to Hangul syllables : https://www.unicode.org/reports/tr14/#H2
Korean's text wrapping should normally behave similar to English (space character are used for linebreak candidate in order to not split the meaning of words, I am not an expert in Korean unfortunately but for example the deault behavior of Unreal UMG is the correct way to wrap Korean text. I made a gif of it : The rule in question in the unicode page you are mentioning is related to Hangul syllables : https://www.unicode.org/reports/tr14/#H2
Re: Text Wrapping in Textblock in Korean cutting in middle of words instead of space character
Honestly, I am not sure if Unreal is right here.
https://forum.literatureandlatte.com/t/ ... age/143137
https://forum.literatureandlatte.com/t/ ... age/143137
Could you please double check with a Korean translator? We are fine to expose what you want in a #define in code.It is fine for the Korean word to be cut off in the middle, but it is NOT fine if the entire word just teleports to the next line and leaving a huge empty space.
Readers hate it. Writers hate it. It is unbearable.
Re: Text Wrapping in Textblock in Korean cutting in middle of words instead of space character
This was flagged to us from our localization teams which have native korean speakers. I would assume this is maybe contextual based on some of the usages. Actually I think this is why Unreal exposes this under the Console variable 'Localization.HangulTextWrappingMethod'. If you could expose that to us so we can select our preferred behavior as well, that would be perfect!
Re: Text Wrapping in Textblock in Korean cutting in middle of words instead of space character
I see, HangulTextWrappingMethod is PerWord, by default.
This makes sense with UAX14 notes: "Depending on the nature of the document, Korean either uses implicit breaking around characters (type 2 as defined in Section 3, Introduction) or uses spaces (type 1). Space-based layout is common in magazines and other informal documents with ragged margins, while books, with both margins justified, use the other type, as it affords more line break opportunities and therefore leads to better justification."
Please, create a ticket for this and I will provide a patch.
This makes sense with UAX14 notes: "Depending on the nature of the document, Korean either uses implicit breaking around characters (type 2 as defined in Section 3, Introduction) or uses spaces (type 1). Space-based layout is common in magazines and other informal documents with ragged margins, while books, with both margins justified, use the other type, as it affords more line break opportunities and therefore leads to better justification."
Please, create a ticket for this and I will provide a patch.
Re: Text Wrapping in Textblock in Korean cutting in middle of words instead of space character
Thank you very much ! here is the ticket I have created : https://www.noesisengine.com/bugs/view.php?id=4007
Re: Text Wrapping in Textblock in Korean cutting in middle of words instead of space character
Patch attached to the ticked. Thanks for your feedback!
Who is online
Users browsing this forum: Ahrefs [Bot] and 21 guests