I would like to print some code files with Android Studio.
Before I've changed the font Name in the print file Dialog.
But the different font did not fit my needs.
What is the Default font name for printing?
Or what font name do you prefer for printing code on paper?
There are two fonts I really like for code:
Deja Vu Sans Mono which you can download for free here --> http://dejavu-fonts.org/wiki/Download
Source Code Pro which you can download for free here --> https://www.fontsquirrel.com/fonts/source-code-pro
You may also want to check out this top 10 list of free code fonts: http://hivelogic.com/articles/top-10-programming-fonts/
Now, for the default Android Studio font:
I believe it is 'Monospaced'
Related
I have an HTML script that needs to be displayed inside of a webview in Android and in an UITextView in iOS. This script uses multiple fonts.
When declaring the fonts in Android I used the following script:
#font-face {
font-family: 'myfont';
src:url("file:///android_asset/fonts/myfont.ttf")
}
and it worked perfectly fine.
In ios, however, I was unable to find the correct solution for setting the source path for the fonts.
I tried the following:
src:url("myfont.ttf")
src:url("myfont.ttf")
src:url("file:///fonts/myfont.ttf")
src:url("file:myfont.ttf")
Do you know how it should be set for iOS
You need to mention the correct font family name and that's it. No need to specify the src. Just make sure to add it in your Info.plist file under key <key>UIAppFonts</key> like so:
<key>UIAppFonts</key>
<array>
<string>Lato-Black.ttf</string>
</array>
How to find font family name?
You might think that the font family name is the name of the file itself. But it is not. Have a look at the below screenshot
The file name is different but the font book shows something else. The title in the font book application is your font family name. To denote different weights of the font, use -Regular, -Bold, etc.
Then in your css you can directly use
span {
font-family: "MathJax_Math-Regular"
}
and your font should be applied
I want to use android system font to show Chinese text.
I use
var fonts = Font.GetOSInstalledFontNames();
to log what fonts are in device. I find this Noto Sans CJK TC.
But I called
font = (Font)Resources.GetBuiltinResource(typeof(Font), "NotoSansTC-Black.ttf");
It always shows The resource NotoSansTC-Black.ttf could not be loaded from the resource file!
How can I use this font in android device.
Thanks
I think what you want is Font.CreateDynamicFontFromOSFont
font = Font.CreateDynamicFontFromOSFont("NotoSansTC-Black", 12);
I imported a set of files for Galano Grotesque xxx.otf font (xxx=Alt Black, Alt Black Bold, etc), and it works like a charm on iOS but not on Android. When I run the app on Android the font is not loaded.
I'm using this:
Label {
font-family: "Galano Grotesque";
color: #5b5b5f;
}
I found this post - Android Not Showing Font Icon In NativeScript - and I tried this
Label {
font-family: "Galano Grotesque", galano grotesque;
color: #5b5b5f;
}
but without success :(
Does anybody knows what I can do to solve it?
Thanks
There is one primary consideration when working with fonts in iOS and Android.
For the font to work on iOS it should use the exact font name (notice that this is not the file name!) where in Android the font should be referenced with its particular file name.
Example:
Let's assume you are using the Galano Grotesque DEMO Bold font from here (this one is free for demonstration purposes)
When downloaded you will see that the file name is as follows
Rene Bieder - Galano Grotesque DEMO Bold.otf
But the font name is (in Mac open with FontBook app to see the font-name at the top of the pop-up.. for Windows open the font with Windows Font Viewer and look for font name)
Galano Grotesque DEMO
So to use it in iOS, you should use
font-family: "Galano Grotesque DEMO";
And for Android, you should use
font-family: "Rene Bieder - Galano Grotesque DEMO Bold";
Of course, the best practice is to see what is the actual font name and rename the file with the exact name so you can reuse it in both iOS and Android with no different CSS files.
All that said check your file name under Android and make sure that reference in the CSS file is the same
I want to display certain text in Oriya font in my android app. There is no default support in android for Oriya language. I tried different ttf files for Oriya font but not able to display the content. Can anyone help me in this?
I have tried the following code keeping the oriya.ttf file in my assets folder.
Typeface typeFace=Typeface.createFromAsset(getActivity().getApplicationContext().getAssets(),"fonts/oriya.ttf");
tvSoft.setTypeface(typeFace);
If you want change font in android this is the best solution:
https://github.com/chrisjenx/Calligraphy
Can anyone please tell me where exactly the Default Text Font size is set in the android framework.When I change the font size using Spare Parts package and reboot my android device, the font size sets to Normal style by default.But I want it to be Extremely Large by default.
Thanks,
Riyaz
If you just want to set font size for the whole phone. Try going to
Settings (Phone) > Accessibility.
Choose Large Text there.
NOTE: I am assuming you just want the font for the phone and not via an app.
You can't change a default font size. You can define a theme, and define a font size in your theme. You can read about defining themes and styles in the android developer reference documentation.
You can change font size, style etc in your application, but not for whole device. To do that i guess you need to root your phone and provide custom fonts with specified font size in it.
For andriod 2.3.5 go to SMS click on Menu-> Settings scroll down until you see Font Setting and select Font Size Setting
According to http://recombu.com/mobile/article/changing-font-size_M18292.html there is no native option for that, up to Android 3.0.
You have to install some third party app. "Big Font" appears to be a popular one.