Page 1 of 1
Different LineHeight in Blend and Unity
Posted: 15 May 2020, 11:24
by Wugenois
Hello,
Trying to harmonize the layout in Unity and Blend, the LineHeight seems to be interpreted differently in Blend and Unity and its a problem when the height of a control (a button for example) depends of the LineHeight.
(The property LineHeight doesn't change a thing)
Is there a solution to avoid these different interpretation ?
Thanks !
Re: Different LineHeight in Blend and Unity
Posted: 15 May 2020, 11:25
by jsantos
What version of Noesis are you using?
Could you please attach images with corresponding XAML showing the differences?
Re: Different LineHeight in Blend and Unity
Posted: 15 May 2020, 11:47
by Wugenois
I use the NoesisGUI v3.0.0rc7
Here the result in Unity and Blend :

- LineHeightUnityBlend.PNG (17.6 KiB) Viewed 2810 times
Here the template (whitout triggers) :
<ControlTemplate x:Key="RoundButtonTemplate" TargetType="{x:Type ButtonBase}">
<Border x:Name="Bg"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
Padding="12,0,12,0"
CornerRadius="4">
<TextBlock Text="{TemplateBinding Content}" Margin="0,0,0,2" x:Name="TextButton">
<TextBlock.Effect>
<DropShadowEffect Color="#01020a3C" Direction="330" ShadowDepth="2" BlurRadius="4"/>
</TextBlock.Effect>
</TextBlock>
</Border>
</ControlTemplate>
Here the style which apply the template :
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource DefaultControlStyle}">
<Setter Property="BorderBrush" Value="{StaticResource DarkCyanBrush}"/>
<Setter Property="Background" Value="{StaticResource GdBlue}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="{StaticResource WhiteBrush}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Template" Value="{StaticResource RoundButtonTemplate}"/>
</Style>
Re: Different LineHeight in Blend and Unity
Posted: 15 May 2020, 11:58
by jsantos
It seems to me, you are using different fonts for Blend and Unity? Fast way to fix this is applying our theme to blend. That way the default font is the same.
Re: Different LineHeight in Blend and Unity
Posted: 15 May 2020, 15:00
by Wugenois
Ok You're right, Unity applied its default font which overides the fonts I defined in code.
Thank for bring to light this !
Re: Different LineHeight in Blend and Unity
Posted: 15 May 2020, 15:24
by jsantos
Great! Glad to help