View Issue Details

IDProjectCategoryView StatusLast Update
0004840NoesisGUIUnitypublic2026-07-23 13:01
Reporterstonstad Assigned Tosfernandez  
PrioritynormalSeverityminor 
Status resolvedResolutionno change required 
Product Version3.2.11 
Target Version3.2.14Fixed in Version4.0 
Summary0004840: RichText.SetText Font Family Assignment Fails
Description

If a font family stored in a resource dictionary is specified using a key which contains the font's name, RichText.SetText fails.

Reproduction Steps

  1. Create the following fonts in a resource dictionary. Note that all four fonts are intentionally the same. They demonstrate the loading failure.

    <FontFamily x:Key="aaaaaaaaaaaa">Fonts/#Rajdhani Bold</FontFamily>
    <FontFamily x:Key="RajdhaniBold">Fonts/#Rajdhani Bold</FontFamily>
    <FontFamily x:Key="RajdhaniHold">Fonts/#Rajdhani Bold</FontFamily>
    <FontFamily x:Key="bbbbbbbbbbbb">Fonts/#Rajdhani Bold</FontFamily>
  2. Now assign these text which uses these four fonts via RichText.SetText(_TextBlock, text);

    string a = string.Empty;
    a += "[font='#aaaaaaaaaaaa'][b]Taco[/b][/font]" + Environment.NewLine; // this works
    a += "[font='#RajdhaniBold'][b]Taco[/b][/font]" + Environment.NewLine; // this fails
    a += "[font='#RajdhaniHold'][b]Taco[/b][/font]" + Environment.NewLine; // this fails
    a += "[font='#bbbbbbbbbbbb'][b]Taco[/b][/font]" + Environment.NewLine; // this works
    RichText.SetText(_MyTextBlock, a);
  3. All four spans should show the same text. See enclosed image.png. Only the first and fourth example works. The working examples do not reference the name of the font in the family name.
    See image.png

Attached Files
image.png (103,297 bytes)   
image.png (103,297 bytes)   
PlatformAny

Activities

stonstad

stonstad

2026-02-25 22:55

reporter   ~0011946

Last edited: 2026-02-26 10:37

I believe this behavior has existed in Noesis across several versions. It is not new to 3.2.11.

sfernandez

sfernandez

2026-02-26 10:43

manager   ~0011949

RichText [font] bbcode does not use resources but family names, so in fact the only ones that work are the two in the middle:

[font='#Rajdhani'][b]Taco[/b][/font]"

You should probably be getting an error of font not found for the other two (#aaaaaaaaaaaa & #bbbbbbbbbbbb).

stonstad

stonstad

2026-02-26 12:36

reporter   ~0011955

Last edited: 2026-02-26 12:38

Hi Sergio! Great to chat with you.

If it uses font family name I would expect none of the above to work. Is there some kind of fuzzy match on name? Separate question -- what is the intended behavior if two Noesis Fonts have the same family (i.e. Rajdhani-Bold.tts has family 'Rajdhani' and Rajdhani-Medium.tts has family 'Rajdhani')?

sfernandez

sfernandez

2026-02-27 10:28

manager   ~0011967

Last edited: 2026-02-27 10:34

Yeah, the WPF font differentitation algorithm, that we followed, is a bit relaxed with the family names, and tries to match parts of the name if possible.
The algorithm is explained here: https://assets.pdfsharp.net/docs/WPF%20Font%20Selection%20Model.pdf

In this case the family name can include weight and styles and those will override explicit attributes, so for example:

<TextBlock Text="Hello World" FontFamily="#Libre Franklin Bold Italic" FontWeight="Normal" FontStyle="Normal" FontSize="40"/>

Is rendered using the Bold and Italic styles instead of the ones specified in the properties.

stonstad

stonstad

2026-03-01 23:18

reporter   ~0011977

This is surprising to learn but also very helpful. Thank you, Sergio!

stonstad

stonstad

2026-07-22 18:51

reporter   ~0012459

OK to close this issue. Thank you for the helpful feedback!

Issue History

Date Modified Username Field Change
2026-02-25 22:52 stonstad New Issue
2026-02-25 22:52 stonstad File Added: image.png
2026-02-25 22:53 stonstad Description Updated
2026-02-25 22:53 stonstad Description Updated
2026-02-25 22:54 stonstad Description Updated
2026-02-25 22:54 stonstad Description Updated
2026-02-25 22:55 stonstad Description Updated
2026-02-25 22:55 stonstad Note Added: 0011946
2026-02-25 22:55 stonstad Description Updated
2026-02-25 22:55 stonstad Description Updated
2026-02-25 22:58 stonstad Description Updated
2026-02-25 23:00 stonstad Summary RichText.SetText(TextBlock, string) Font Family Error => RichText.SetText Font Family Assignment Fails
2026-02-25 23:00 stonstad Description Updated
2026-02-25 23:00 stonstad Description Updated
2026-02-26 10:36 sfernandez Product Version 3.2.12 => 3.2.11
2026-02-26 10:37 sfernandez Note Edited: 0011946
2026-02-26 10:37 sfernandez Assigned To => sfernandez
2026-02-26 10:37 sfernandez Status new => assigned
2026-02-26 10:37 sfernandez Target Version => 3.2.12
2026-02-26 10:43 sfernandez Status assigned => feedback
2026-02-26 10:43 sfernandez Note Added: 0011949
2026-02-26 12:36 stonstad Note Added: 0011955
2026-02-26 12:36 stonstad Status feedback => assigned
2026-02-26 12:38 stonstad Note Edited: 0011955
2026-02-27 10:28 sfernandez Status assigned => feedback
2026-02-27 10:28 sfernandez Note Added: 0011967
2026-02-27 10:28 sfernandez Note Edited: 0011967
2026-02-27 10:33 sfernandez Note Edited: 0011967
2026-02-27 10:34 sfernandez Note Edited: 0011967
2026-02-27 10:34 sfernandez Note Edited: 0011967
2026-03-01 23:18 stonstad Note Added: 0011977
2026-03-01 23:18 stonstad Status feedback => assigned
2026-03-04 00:39 jsantos Target Version 3.2.12 => 3.2.13
2026-04-27 12:17 jsantos Target Version 3.2.13 => 3.2.14
2026-07-22 18:51 stonstad Note Added: 0012459
2026-07-23 13:01 sfernandez Status assigned => resolved
2026-07-23 13:01 sfernandez Resolution open => no change required
2026-07-23 13:01 sfernandez Fixed in Version => 4.0