Home to implement a FontFamily

6
I need to implement a font family into a Mobile Native app. I went over the Mendix documentation on how to add and use Custom fonts. I want to overwrite the fontfamily of my application. I tried the following just to make use of the new font family I added. Built a local apk file from the Build Native Mobile App tool in Studie Pro. I added the .ttf files of my font. Added the following java script code to my styles module that I use for custom styling. export const latoFontFamily = { black: "Lato-Black", blackItalic: "Lato-BlackItalic", bold: "Lato-Bold", boldItalic: "Lato-BoldItalic", italic: "Lato-Italic", light: "Lato-Light", lightItalic: "Lato-LightItalic", regular: "Lato-Regular", hairline: "Lato-Hairline", hairlineItalic: "Lato-HairlineItalic", }; I then implement the following code to change the font. When I use this on text, the font does not change. export const regText = { fontFamily: custom.latoFontFamily.bold };   I am testing on android device.
asked
2 answers
0

Hello Thomas

 

See these git repo with my code and compare with your code:

* Template: https://github.com/vstram/mx_custom_font_template

* Mx 10.4 Custom Font App: https://github.com/vstram/mx_custom_font

 

I've got the following result using the Lato font:

image.png

 

image.png

 

Inspecting with the DevTools confirms that the Lato Font was used

image.png

answered
0

Hello Thomas,

 

Please, check this article:

https://vstram.medium.com/how-to-configure-custom-fonts-in-a-mendix-native-mobile-android-application-97d049ec40f4

 

It can be useful.

answered