User avatar
krupitskas
Topic Author
Posts: 23
Joined: 16 Apr 2021, 17:42

Multiple problems with text fonts

15 Sep 2021, 22:38

Hey there, we have multiple problems with fonts:

1) Fonts that do not support cyrillic (I suppose) can't be found:
I have two fonts: Montserrat and AlexBrush. In my macos Montserrat shows Russian letters as preview and AlexBrush default latin.
I've tried also more fonts, all, which supports cyrrilic - works.
Works means that in the function of FontProvider::FamilyExists(...) it returns true.

2) Dynamically created text doesn't change font-family:
Example:
text_block.SetFontFamily(Noesis::MakePtr<Noesis::FontFamily>("Forum"));
Also I've tried
text_block.SetFontFamily(Noesis::MakePtr<Noesis::FontFamily>("bundles/font_bundle","Forum"));
text_block.SetFontFamily(Noesis::MakePtr<Noesis::FontFamily>("bundles/font_bundle", "#Forum"));
No success. It's not even jumping into the
FontProvider::FamilyExists(...)
I've debugged place where RegisterFont is happening and used same uri and font family name.

Tags:
 
User avatar
sfernandez
Site Admin
Posts: 2387
Joined: 22 Dec 2011, 19:20

Re: Multiple problems with text fonts

20 Sep 2021, 16:57

Hi,

1) Could you please open a ticket and attach a font file that doesn't work for you? How are you referencing the font in XAML? As explained in our Text tutorial, if you don't specify a folder before the '#' sign it will try to find the font in the operating system. Are you testing this in macOS?

2) All the code examples create a FontFamily that searches for that font in the operating system. If Forum is not installed it won't work.
To load a font from your FontProvider you have to specify a local path before the # sign:
text_block.SetFontFamily(Noesis::MakePtr<Noesis::FontFamily>("bundles/font_bundle","./#Forum"));
Please let me know if that works for you.
 
User avatar
krupitskas
Topic Author
Posts: 23
Joined: 16 Apr 2021, 17:42

Re: Multiple problems with text fonts

21 Sep 2021, 17:54

Hi

1) Done: https://www.noesisengine.com/bugs/view.php?id=2127
2) Thanks, that did the job!

Who is online

Users browsing this forum: Bing [Bot], simonb and 4 guests