Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Linking Noesis into Blend

04 Dec 2013, 01:28

When using Blend is there a way to link the Noesis library? I've noticed Noesis adds some functionality over WPF (stroke on fonts for example). Currently we've been editing files in Blend then adding this Noesis-specific logic after the fact but we'd like to cut out this step as it can get pretty tedius. I'm a little unfamiliar with the Blend project structure. Is there a way to make Blend aware of the Noesis additions?

On a related note, Noesis handles fonts a little differently than Blend. For example when I reference a font in Blend it generates xaml like this:
<TextBlock x:Name="songline" Height="34" Canvas.Left="-46" TextWrapping="Wrap" Canvas.Top="41" Width="565" FontFamily="fonts/mplus-2m-bold.ttf#M+ 2m bold" FontSize="29.333" TextAlignment="Center" Text="SONG LINE" Foreground="White" FontWeight="Bold"/>
though Noesis requires formatting like:
<TextBlock x:Name="songline" Height="34" Canvas.Left="-46" TextWrapping="Wrap" Canvas.Top="41" Width="565" FontFamily="fonts/#M+ 2m" FontSize="29.333" TextAlignment="Center" Text="SONG LINE" Foreground="White" FontWeight="Bold"/>
We have a script to convert from the former to the latter so this really isn't a big deal but does anyone know of a way to have both Blend and Noesis reference a font in the same manner?
 
User avatar
jsantos
Site Admin
Posts: 2900
Joined: 20 Jan 2012, 17:18
Contact:

Re: Linking Noesis into Blend

04 Dec 2013, 14:03

Yes, we have several attached properties for noesisGUI that we use for extending the XAML functionality. Being noesis.dll a native library it cannot be linked in Blend. The way we are doing it is by having this properties declared in c#. This way, XAML using this extensions compile properly (although they display will not be the same in Blend than in noesisGUI). We created a github repository to share across the community this extensions. This project can be contributed by anyone interested in improving noesisGUI.

https://github.com/Noesis/noesisgui-contrib

About font URIs, the following format

FontFamily="fonts/#M+ 2m"

works in noesisGUI and Blend WPF & SL. But you need the family name in the ttf properly set. The expected way is having a .font file with the family name and inside that file a list of .ttf all having the same family name (if this is not respected our buildtool will display a warning). I have observed that in the xaml you passed us, the font M+ 2m.font doesnt respect this, because for example the ttf mplus-2m-bold.ttf has the family name set to "M+ 2m bold" instead of "M+ 2m".

It is important that fonts follow this convention to work both in Blend and noesisGUI.

Besides that, effectively, we are not compatible with the following syntax

FontFamily="fonts/mplus-2m-bold.ttf#M+ 2m"

I have filed a bug for this. Will be fixed in the next release.

Thanks!
 
Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Re: Linking Noesis into Blend

04 Dec 2013, 14:16

Thanks for the information! I'll check out those extensions and we'll make sure our fonts are set properly.

Who is online

Users browsing this forum: No registered users and 1 guest