Cannot set editor font from a resource

SyntaxEditor for WPF Forum

Posted 5 months ago by Krzysztof D.
Version: 22.1.1
Platform: .NET 4.8
Environment: Windows 10 (64-bit)
Avatar

Hello,

Setting the font on a SyntaxEditor FontFamily does not work:

i.e resource:

<FontFamily x:Key="ScriptEditorFont">/MyAssemly;component/Resources/Fonts/#Cascadia Mono</FontFamily>

does not work:

<ap:SyntaxEditor FontFamily="{StaticResource ScriptEditorFont}">

works (if font installed in the system):

<ap:SyntaxEditor FontFamily="Cascadia Mono">

Best Regards,
Krzysztof

Comments (3)

Answer - Posted 5 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Can you try starting your FontFamily text with "./MyAssembly" instead of "/MyAssembly" and see if it works in v22.1.1?  Basically add a dot before the first slash and let us know if that works.


Actipro Software Support

Posted 5 months ago by Krzysztof D.
Avatar

Hello,

hm.. yes, it is working with the .
Is there any reason why it is required for syntaxEditor ?
looks like for other WPF elements with 'dot' it is not working but works for SyntacEditor and vice versa - without dot is working for WPF elements but not for SyntaxEditor ?

Best regard,
Krzysztof

Posted 5 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Some work was done in v22.1.1 to add support for font resources that started with "./" but we didn't realize you could also exclude the dot.  We wanted to check and see if it worked on your side with the dot first.  We will be updating our code for the next maintenance release v22.1.2 to support without the dot too.


Actipro Software Support

The latest build of this product (v22.1.3) was released 20 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.