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"
Related
I should study some apps of different kinds for homework, also want to determine what kind of font are in use.
I try to open the different apk but don't know where to find the setting about the font (or font-family).
Can't use online imagine font detector, because are imprecise.
You could reverse engineer it, which sounds harder than it is for this purpose.
Get a tool like Apktool (https://ibotpeaches.github.io/Apktool/) and decompile the APK.
If all goes well, you find a folder called res/font, which should have the folders for each font used inside of it.
From the app itself it is not possible to find the font used (unless it is a text processing app where you can select the font yourself..)
Is there any fontconfig-like way to search system font files on Android?
My game UI library provides a ttf font rendering. Someone just specify at least "human-readable" name, italic flag and font weight. The only way I found is just hardcode paths to system fonts in code, but it does not reliable and can't consider weight and italic parameters.
Maybe there is a file, which I can parse and get system font names from it?
On Linux I use fontconfig, I can use it on Android too, but I don't want to have completely useless megabytes in APK.
You can now query Google Fonts API, with the latest Support Library. It's not exactly what you're looking for, but maybe you'd like to consider this approach.
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
I have developed an application which contains a WebView for loading additional URL contents, but I have an issue.
The issue is that when I load a local language URL, some devices don't support local languages special characters, so some empty squares are shown.
How can I load an additional font in my application or device?
Custom fonts are not that easy in android. You will need some .ttf files, which You must load at runtime as typeface.
This link has nice information, also about best practices, on how to deal with custom fonts properly.
Check out:
Android - Using Custom Font
If your webview is showing an online page (as opposed to a html file which is compiled into the assets somewhere, like Cordova/phonegap does), you perhaps should look at using a web font in the css. The easiest thing to do is uses google have a few hosted, see:
https://developers.google.com/fonts/docs/getting_started#Quick_Start
http://www.google.com/fonts (is the full list of fonts)
Hope that helps. (other webfont options are available).
i want to make to make an PreferenceActivity with the same style that can be found on the image below.
Image of Preference Screen Android 3.2 http://img600.imageshack.us/img600/5120/device20120320173903.png
http://imageshack.us/photo/my-images/600/device20120320173903.png
There any way to make a close match of it or do i need to program the behaviour?
I can think of two ways you can do. One is to download the source code, but I think that layout is custom for galaxy tablets.
The other option would be to use the Hierarchy View Perspective in Eclipse to determine the structure and details of the interface and from there replicate the interface.
Good luck!
Udapte:
Ok, if what you want is the drawables you can actually get them from the tablet. With a file manager in the tablet copy the file /System/app/System.apk to the SD card and from there to your computer. There change the extension to .zip and extract the contents. This way you can access only the drawables. The xml files are compiled so you can't see their content.
I think you can use this if you want more data out (like the xml layouts): http://code.google.com/p/android-apktool/
Although as I said in the comments I am not sure about the legality of this given this is Samsung's own IP.