Font issue in Corona SDK - android

I am working on an Android Application on Corona Sdk.
and I am using chinacat font for it.
The Problem is the font is being displayed correctly in simulator,
but when i deploy on device it is displayed in normal font.
I am on Windows 8.1.
Here is my code:
local fontname="chinacat"
texts = display.newText(word, 0, 0, fontname, fontsize)
~Thanks

Using Custom Fonts can be tricky at first, specially regarding what name to use as the font filename as well as inside the code.
Just follow the guide below and you will be fine.
http://www.coronalabs.com/blog/2013/01/16/faq-wednesday-custom-fonts/

Just put it in the root folder of your project. And make sure that the font supports from a-z,A-z,0-9 if the font doesn't support it, your app will use the native font

Related

How to use new Google's Sans font in my Android App?

How can I use the font seen in fresh Google's apps like Phone, Contact and Google Fit in my Android App? Is there some new textAppearance value for this? Here's the preview of desired font (titles):
As I could find out, this font is called something like "Google Sans".
Thanks.
I too wondered here and there to know how to use that font. I came to know that you cannot use it legally and for official use but if you have personal use then you can use this answer.
I am adding this answer only to answer your question but not to allow everyone to use that font!!
Here are the steps:
Download the font zip file by checking out my blog post
Make directory named font under res folder and add the TTF files under it.
Now add the font to the TextView using this attribute:
android:fontFamily="#font/google_sans"
I am sure that this will work for all devices.
But again I tell you, don't use it for professional work!!
I've also was wondering how to use it, for personal use though. Oddly enough I used this and it works perfectly fine, though I own a pixel device and am pretty sure this won't work on other devices. Here's what I used for the TextView:
android:textAppearance="#android:style/TextAppearance.DeviceDefault.Widget.Button"

Custom font for EmojiCompat

I have a small problem regarding the EmojiCompat library which was introduced some weeks ago.
There is a group of people (including me) who don't quite like the new Emoji style, Google has introduced with Oreo.
As I like the good old blob emojis, I recently started updating this emoji font.
Now my problem:
The Android developer page shows that there are two ways of using EmojiCompat.
The first one is using downloadable fonts and the second one is using this bundled emoji font which is based on loading font assets.
I already have a working implementation of EmojiCompatConfig which allows me to load any font I have in my assets-folder and it works with the font provided in the bundled configuration but not with my own font.
The section "Library-Components" [I don't have enough/any reputation, so I can't provide a link to this section...] says the original Noto-Emoji font (which my font is actually based on) is modified in some way (i.e. moving the emojis into another area and adding some "Extra emoji metadata" which isn't really specified anywhere in the documentation).
I already tried to look for some differences using the ttx tool provided by fonttools.
It looks like these modifications are the only ones made.
The modified version differs in both the meta-table not present in the default noto font and in the actual positions the emoji glyphs have - probably because they movede the emojis to the private area.
Does anyone know how to recreate these modifications so I am able to use my own emoji font instead of that new one?
I already tried to search for this issue but I didn't find anything that could help me.
There has already been another post regarding whether or not it would be possible to use the iOS emojis using the downloadable font approach but I don't think these questions are the same...
The script to modify an existing CBDT/CBLC emoji font can be found here: https://android.googlesource.com/platform/external/noto-fonts/+/android-8.0.0_r17/emoji-compat/createfont.py
The "unicode path" that needs to be passed to the script should point to this data: https://android.googlesource.com/platform/external/unicode/+/android-8.0.0_r17

Arabic fonts for Android

I am new in android world. I have issue with arabic font on android device they overlap each other . And some of them are unreadable please help where i am wrong or provide some solution for it.
I used Cavorting.otf downloaded from google and worked fine for me. I also increased font size to 25sp so it can be readable easily. I recommend you to increase the font size then try changing different fonts.

Support for marathi font

In my application i want to use marathi font.I know how to use custom fonts in android.The problem is that when i use "Kruti Dev" it shows in android studio preview emulator even thought i have not set it.But if i try to use "Subak" font i am not getting the desired output.
So please can you tell me how will i be able to use this font.
Custom Font Code
Typeface face=Typeface.createFromAsset(getAssets(),
"fonts/subak.ttf);
There is an issue in Android 5.0 that causes some custom fonts to not render when loaded via the Typeface.createFromAsset() function.
The workaround is to re-encode the font that is not displaying. Upload the font file to http://www.freefontconverter.com/ and convert it to output as a TTF. Place the outputted file back in your assets folder and it should now display correctly on Android.
This issue was fixed in the Android 5.1 release.
Reference:
https://androidbycode.wordpress.com/2015/06/02/help-my-custom-font-does-not-work-on-android-5-0/

UI from Livecode is not the Same as on Android

I created a livecode project. I designed my UI by changing colors and fonts.
After creating that app, I deploy it to an android installer file (.apk file). When I launch the application to my android device, the UI from android device is not exactly the same as in the livecode. The text from the labels and buttons are getting too close which is annoying.
If you're not including a font in your APK file, chances are that Android chooses a font different from the font chosen by iOS. Either set the textFont of the field to a font that is available on both platforms or include your own font. If you include a font with the standalone and make sure that it is located next to the engine file, the font will be available. You can check that a font is available by using the fontNames:
put ("Font Name" is among the lines of the fontNames) into myFontAvailable
The default textFont of a field is empty, which means that it is inherited from the stack. If the textFont of a stack is empty, the system font is used. On Windows, the system font is Segoe UI, on Mac OS X it is a different font. On Android and iOS, the system font is different again. If you want the font to be the same on all platforms, you have to set the textFont of the stack (or field) to a font name that is available on all platforms or include your own font.

Categories

Resources