Page 1 of 1

NoesisGUI Font Selecting "algorithm"

Posted: 11 Sep 2020, 09:58
by frochet38
Hi,

I'm working on the final look of my interface, and my UI designer picked up some specific fonts to achieve a nice look.
I discovered NoesisGUI uses the FontFamily and other fonts attributes like FontWeight, FontStyle and FontStrech to select the font file used to display texts elements.

My problem is being able to select a defined font file among a family, NoesisGUI seems to follow some rules I don't understand.

For example, if I want to select the "Gotham-Light.otf" font among all the Gotham font files I have, I tried to use:
FontFamily="./#Gotham" FontWeight="Light" FontStyle="Normal" FontStretch="Normal" 
This works nicely, selects and loads the "Gotham-Light.otf" file to draw the TextBlock.

Now, if I want to select the "Gotham-Medium.otf" font, I try:
FontFamily="./#Gotham" FontWeight="Medium" FontStyle="Normal" FontStretch="Normal" 
I doesn't works, and selects the "Gotham Black" font.

Now, if I want to select the "Gotham-Bold.otf" font, I would try to use:
FontFamily="./#Gotham" FontWeight="Bold" FontStyle="Normal" FontStretch="Normal" 
it doesn't works and also selects the "Gotham Black" font !

I don't even know what FontWeight to use to select "Gotham-Book.otf" font.

How can I select my fonts ? How Noesis does exactly match the fonts files and their attributes ? I wasn't abel to find the answer anywhere.

Thanks a lot,

Frank

Re: NoesisGUI Font Selecting "algorithm"

Posted: 11 Sep 2020, 13:14
by jsantos
We follow the WPF font selection model. Could you try in Blend to check we are doing the same? If not, please report a ticket. Thanks!

Re: NoesisGUI Font Selecting "algorithm"

Posted: 11 Sep 2020, 14:04
by frochet38
Thanks for the quick answer, WPF font selection seems amazingly complex...
It's hard to say exactly what font Blend selects at the end, but changing FontWeigth from "Medium" to "Bold" in Blend selects different fonts whereas NoesisGUI selects the same one, so I guess there's a difference here.

Re: NoesisGUI Font Selecting "algorithm"

Posted: 11 Sep 2020, 14:16
by frochet38
Ticket #1789

Re: NoesisGUI Font Selecting "algorithm"

Posted: 11 Sep 2020, 14:22
by jsantos
Thank you! could you please also attach a xaml reproducing the problem? (showing differences between noesis and blend)

Re: NoesisGUI Font Selecting "algorithm"

Posted: 11 Sep 2020, 14:26
by frochet38
Yes, file added

Re: NoesisGUI Font Selecting "algorithm"

Posted: 15 Sep 2020, 17:56
by jsantos
Thanks again!