ivan_b
Topic Author
Posts: 84
Joined: 22 Jul 2015, 12:57

System fonts in Android

24 Mar 2019, 17:41

I am trying to use the system fonts in Android, specifically the Noto Sans CJK but Noesis was not able to find it.
The fonts is in the folder /system/fonts but the font is a TrueType Collection.
I wanted to know if this could be the reason for not being able to find it?
 
nokola
Posts: 186
Joined: 10 Mar 2015, 05:29

Re: System fonts in Android

24 Mar 2019, 23:32

Just curious - have you tried using just "Noto Sans" and the CJK characters? I assume in that cause it will "just work".
 
User avatar
sfernandez
Site Admin
Posts: 1571
Joined: 22 Dec 2011, 19:20

Re: System fonts in Android

25 Mar 2019, 12:50

We use the family name specified in the ttf tables to perform the FontFamily matching.
I downloaded from here https://www.google.com/get/noto/ the version for JP and the family name used in the file was: "Noto Sans CJK JP", using that works fine in Noesis:
<TextBlock FontFamily="Fonts/#Noto Sans CJK JP" .../>
 
ivan_b
Topic Author
Posts: 84
Joined: 22 Jul 2015, 12:57

Re: System fonts in Android

25 Mar 2019, 20:06

@nokola
I have tried with Noto Sans but it can't find the Noto Sans font at all.
This is the way I am using it
<FontFamily x:Key="DeafultFont">#Arial, #Heiti SC, #Noto Sans</FontFamily>
@sfernandez
I wanted to use the system installed fonts as it would save memory.
When I add the Noto Sans fonts to my project it works as expected.
 
User avatar
jsantos
Site Admin
Posts: 2506
Joined: 20 Jan 2012, 17:18
Contact:

Re: System fonts in Android

25 Mar 2019, 20:40

TrueType Collection (.ttc) are supported and scanned. Are the rest of system fonts working properly? What sfernandez is suggesting is using '#Noto Sans CJK JP' as the family name. I don't have an Android right now to check but probably what's happening is a mismatch in the font family name.
 
ivan_b
Topic Author
Posts: 84
Joined: 22 Jul 2015, 12:57

Re: System fonts in Android

26 Mar 2019, 10:10

I will try this. I have tried with the "regular" Noto sans but it was not able to find it but the font is located in the /system/fonts folder.
For now the only font family that I was able to use on Android is Roboto.
 
ivan_b
Topic Author
Posts: 84
Joined: 22 Jul 2015, 12:57

Re: System fonts in Android

27 Mar 2019, 08:47

Hi
Thank you for your help. I tried the example that @sfernandez suggested before but on an older android device and that is the reason why it didn't work.
On a newer one works great.

If it is not a problem could you explain what is the difference between the system fonts and the fonts included in the project?
The main thing that I am interested in is what is the reason that sytsem fonts occupy less memory.
 
User avatar
jsantos
Site Admin
Posts: 2506
Joined: 20 Jan 2012, 17:18
Contact:

Re: System fonts in Android

27 Mar 2019, 13:54

If it is not a problem could you explain what is the difference between the system fonts and the fonts included in the project?
The main thing that I am interested in is what is the reason that sytsem fonts occupy less memory.
Exactly, System fonts are not included in your application so the size of the redistributable is reduced. But you have the extra problem that depending on the operating system version the used system font may be available or not, so you need to use fallback fonts (as you are doing) to cover all cases.

Please, let me know if this answers your question.
 
ivan_b
Topic Author
Posts: 84
Joined: 22 Jul 2015, 12:57

Re: System fonts in Android

28 Mar 2019, 09:59

My concern was not about the application size but about the runtime memoery usage.
In the changelog you wrote "Support for system fonts. Improved memory usage of fonts." and my assumption was that this is an improvement of the runtime memory usage.
Have I misunderstand this?
 
User avatar
jsantos
Site Admin
Posts: 2506
Joined: 20 Jan 2012, 17:18
Contact:

Re: System fonts in Android

30 Mar 2019, 16:35

Yes, 2.2 brings an improvement in memory usage when using local fonts (also system fonts but less).

Who is online

Users browsing this forum: No registered users and 2 guests