CartoDB / mobile-carto-libs

Internal dependencies for CARTO Mobile SDK
BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

font face as nuti parameter not working #31

Open farfromrefug opened 2 years ago

farfromrefug commented 2 years ago

I tried to do something like this:

@font_face:[nuti::font_face];
@mont: @font_face + ' Regular';
@mont_md: @font_face + ' Medium';
@mont_bd: @font_face + ' Bold';
@mont_it: @font_face + ' Medium Italic';

And it is not working. I am sure [nuti::font_face] is correct. If i switch to:

@font_face:'DIN Pro';
@mont: @font_face + ' Regular';
@mont_md: @font_face + ' Medium';
@mont_bd: @font_face + ' Bold';
@mont_it: @font_face + ' Medium Italic';

then it works

farfromrefug commented 2 years ago

That makes me think of a crazy idea. Could we support for system fonts?

mtehver commented 1 year ago

Indeed, font handling assumed static font names, for mostly historical reasons. This should be fixed now in 'develop' branch. Good find.

mtehver commented 1 year ago

Regarding about system fonts, I believe this is really platform-dependent and not possible on Android, which is the main target.

farfromrefug commented 1 year ago

@mtehver what about this https://developer.android.com/ndk/reference/group/font ? (though starting at api 29 :s)

mtehver commented 1 year ago

@farfromrefug Interesting, did not know about this. But API 29 is way too restricting for minimum requirement, we need to support Android 4.x.

farfromrefug commented 1 year ago

@mtehver 100% agree with you! was worth mentioning as we discovered this for Nativescript runtime