User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: How to make NoesisGUI recognizes system-installed font (C++ SDK 2.0.2f2, Windows platform)

26 Sep 2017, 23:52

I suppose we could do something with the FaceType (because we need that internally)... but what about iOS?
 
monstercho
Posts: 20
Joined: 26 Jan 2016, 19:54

Re: How to make NoesisGUI recognizes system-installed font (C++ SDK 2.0.2f2, Windows platform)

27 Sep 2017, 15:38

Under iOS I tried the code for reconstructing TTF content from tables included in the CGFont object. The generated file can be opened with Windows font preview and looks normal.
I register it in NoesisGUI and see that all chars are shown on top of each other (no horizontal spacing), so I guess it's missing some info. Here it is:
https://drive.google.com/file/d/0B1zHz_ ... sp=sharing
Edit: also tried with Chinese font (PingFangSC-Regular), generated 13MB ttf, but Windows/Google preview don't recognize it:
https://drive.google.com/open?id=0B1zHz ... ms3Q1ljYm8
EDIT2: Never mind about the generated Chinese font not working - Noesis works with it and it is valid font if I open it under macOS .
So there is working iOS solution :)



Clarification:
- the 1st generated font I linked above (problem with chars on top of each other in Noesis) - I got the CGFont object without giving specific font name:
UIFont *font = [UIFont systemFontOfSize:12];
CFStringRef fontName = (__bridge CFStringRef)font.fontName;
CGFontRef cgFont = CGFontCreateWithFontName(fontName);
I thought that this way I'm getting the active system font, but maybe it's not.

- for the 2nd generated font - the working Chinese PingFangSC-Regular - I just used its name:
CGFontRef cgFont = CGFontCreateWithFontName(CFSTR("PingFangSC-Regular"));

Created TTF by calling fontDataForCGFont (https://gist.github.com/Jyczeal/1892760) and saving its NSData result to ttf file in the app's persistent data path.
Last edited by monstercho on 27 Sep 2017, 17:50, edited 1 time in total.
 
nokola
Posts: 188
Joined: 10 Mar 2015, 05:29

Re: How to make NoesisGUI recognizes system-installed font (C++ SDK 2.0.2f2, Windows platform)

27 Sep 2017, 17:48

This is awesome, thanks for sharing monstercho!
JSantos, is it possible to have Native OS font support in the Noesis without any workarounds (same as WPF?) Native OS Font support is a big plus, especially if shipping to huge markets like China, India.
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: How to make NoesisGUI recognizes system-installed font (C++ SDK 2.0.2f2, Windows platform)

03 Oct 2017, 22:00

JSantos, is it possible to have Native OS font support in the Noesis without any workarounds (same as WPF?) Native OS Font support is a big plus, especially if shipping to huge markets like China, India.
Yes, this is something would be nice having by default in our font provider. Meanwhile you can try your own implementation because the API for providers is open in both C++ ad C#.
 

Who is online

Users browsing this forum: No registered users and 0 guests