Text Wrapping in Textblock in Korean cutting in middle of words instead of space character
Posted: 20 Mar 2025, 19:42
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!