Inconsolata font on Android Studio - windows

I want to use Inconsolata font on a intelliJ editor (Android Studio) on Windows but it looks messy.
I managed to load inconsolata by adding some antialiasing options on studio.exe.vmoptions. I just added these options
-Dawt.useSystemAAFontSettings=on
-Dswing.aatext=true
-Dsun.java2d.xrender=true
and now the font loads but it looks too much crappy to use. Actually any font on this ide looks crappy. Here's a screenshot of the same font on SublimeText right and on Android Studio left
Anyone knows if you can use this font on intelliJ based editors or if there are some issues associated with this font?

We can simply use google fonts It's very easy to implements. only you have to follow these steps.
step 1) Open layout.xml of your project and the select font family of text view in attributes (for reference screen shot is attached)
step 2) The in font family select More fonts.. option if your font is not there. then you will see a new window will open, there you can type your required font & select the desired font from that list i.e) Regular, Bold, Italic etc.. as shown in below image.
step 3) Then you will observe a font folder will be auto generated in /res folder having your selected fonts xml file
Then you can directly use this font family in xml as
android:fontFamily="#font/inconsolata"

Related

Bundle custom fonts into macOS standalone application using Xcode

I am new to macOS standalone application development and I am working on fixing the issues in it. I am running with an issue where the custom fonts not getting applied to controls present in the application. I am using Xcode 11.3 in macOS Mojave 10.14
There is already a fonts folder added to the project which contains all the font files (.ttf) extension. I have referred the "fonts" folder using the key "Application fonts resource path" in the Info.plist file. Even after applying all these changes the controls are getting referred to system font instead of the embedded font.
Also, the custom fonts which are added to the project is not being shown in the Font dropdown list of Attribute inspector.
Can you please suggest on what needs to be done in order to embed the custom fonts into the project and also show these custom fonts in fonts dropdown list?
Install the font
On your macOS, double click on all the fonts you'd like to use. Following window will appear for each:
Click on the Install Font button.
Attributes inspector
You can now choose your font. Remember, only installed fonts are listed. Fonts bundled with your application are not. Select your custom font.
Bundle fonts
Add a new Copy Files phase
Set subpaths to Fonts
Drop all the font files there
Info.plist
Add a new row Application fonts resource path (ATSApplicationFontsPath)
Set value to Fonts (must match copy files phase subpath)
Test
How to test that fonts are bundled correctly:
Close the storyboard (Xcode)
Launch Font Book
Right click on your custom font and disable it
Launch your application and test that all the custom fonts are bundled properly and work as expected
Launch Font Book
Right click on your custom font and enable it again
WARNING
Do NOT open the storyboard file if you disable/remove your custom font.
You'll get the following warning if you do ...
... and all your custom font settings are gone. You can open the storyboard file again, but you have to enable/install your custom font.

How to use Font Awesome in Xamarin.iOS?

I am trying to use Font Awesome Icons in my Xamarin.iOS project.
In my Xamarin.Android project it was pretty simple:
I downloaded the Font Awesome WebKit from here
I copied the .ttf-Files of the fonts I want to use in my Assets folder
I create a new Typeface for my TextView with the font and use the unicode of the icon
Code:
var myIcon = new TextView(Context);
var regularFont = Typeface.CreateFromAsset(Context.Assets, "fonts/fa-regular-400.ttf");
myIcon.SetTypeface(regularFont, TypefaceStyle.Normal);
myIcon.Text = "\uf007";
I can change TextColor, BackgroundColor, etc. like a normal text.
My problem is, I can't figure out, how to use Font Awesome in my Xamarin.iOS project. Most tutorials and How-Tos are directed to Xamarin.Forms. I tried to merge many of these approaches, but it failed.
The only approach I found is to draw the .svg-Files with SkiaSharp, but that is no option for my use case.
Add .ttf files in your Xamarin iOS project (I have added it in resources)
Now inside info.plist Add a new key “Fonts provided by application”
Expand the array, and in string value add your fontname (eg: fa-solid-900.ttf) which you have added in your project
Setup Done:
Now Just wherever you want to add fontawesome icon just select font awesome as font family in storyboard but make sure to add text programmatically
SushiHangovers comment leads me to the solution for my problem.
FontAwesome Pro and xamarin.ios only one font can be active
It was not possible to use 3 Font Awesome fonts at the same time in the Designer, but it works when they are used during runtime via code.

Why are my TrueType hints ignored?

I have integrated some hints (a prep handler to update the cvt and glyph instructions (simple MIAPs to copy the cvt values to specific points) into a custom TTF font.
I changed the fonts via Python fontTools.ttx
The font and the hints work perfectly when I test the font in TrueTypeViewerQt.
The font (and the hints) work also in PIL.
I can also see the hints in FontForge (for prep and the glyphs), but debugging them just shows "".
I also get this message in the console window:
SplineFontPieceMeal() going unhinted...
When I now use the font from a PDF file (written via reportlab), the font is used, but my hints seem to be ignored by Acrobat Reader, Ghostscript, mudraw, Chrome Web Browser (integrated PDF view), or an own application based on PDFium.
Then font exported from the PDF (via mutool) still contains the hints which work in TrueTypeViewerQt.
PDF: https://www.dropbox.com/s/qn3iooazsq1z2w5/d85.pdf?dl=0
Font: https://www.dropbox.com/s/p6qwug9h6vcgps0/testbar.ttf?dl=0
Any ideas?

Why are fonts looking so different in different themes in intellij?

In IntelliJ the Darcula theme fonts look as follows
and in the default light theme they look as follows
I want to use the lighter default theme, but I find the fonts in darcula theme to be more "clear" then the default lighter theme. Can you let me know how to correct this?
PS : I am using a Linux machine
This is controlled by Settings -> Editor -> Color & Fonts -> Font
However, I do not see a difference between the fonts for Darcula and the default theme :
Darcula :
vs.
Default:
both seem to use the same Consolas, Size 12 font.
Update
Since this is happening on Linux, from here:
Anti-aliasing of fonts is available with Oracle Java 1.6 on Linux. To
do this on a per user basis, add the following line to the user's
~/.bashrc.
export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=[setting]'
Two other useful links :
How to fix font anti-aliasing in IntelliJ IDEA when using high DPI?
Intellij IDEA font smoothing in linux
I had the same question, and finally was able to discover the following:
The issue is not one font smoothing, but of the Default theme and the Darcula theme using different fonts on Linux. On my computer, the Default theme uses DejaVu Sans Mono, 12pt, but the Darcula theme uses Source Code Pro, 14pt.
If you want the Darcula Font, then go to File > Settings > Editor > Colors and Fonts > Font, make a copy of the Default scheme, and then change the font to Source Code Pro, 14pt.
See also the Wikipedia article on Source Code Pro .

WP7 - Not picking up embedded fonts

I have been trying to use some custom fonts within my WP7 app.
I followed the example as per http://www.jeffblankenburg.com/2010/10/24/31-days-of-windows-phone-day-24-embedding-fonts/ but in my project it simply will not pick up the custom font.
I have downloaded the sample project in this example and this one does work okay.
So, I have now used the same font used in there, and included in my project. I have ensured that the properties on the file are identical (Build Action = 'Content' and Copy To Output Directory = "Always")
I have used in my XAML in exactly the same way i.e.
FontFamily="Fonts/DigitalDream.ttf#Digital Dream" FontSize="24"
But to no avail. The custom font is just ignored. Is there something that I am missing, or a setting .. anything that would allow this to work in one project, but not another?
I have discovered that it will work if my XAML page is defined at the root level, i.e. immediately under the project, but in my case I have it in a 'Views' folder.
My understanding was that
FontFamily="/Fonts/DigitalDream.ttf#Digital Dream" FontSize="24"
should start at the root folder of the project?
thanks
Custom fonts can be a little tricky. I spent several hours once trying to embed an .otf font only to find that it just didn't seem to be doable.
You're on the right track, though. A .ttf font should be embedable. It's hard to get the right combination of paths and filenames to make the font work, though.
The easiest way I've found to handle some of these more difficult "magic string" type of situations in XAML is to let Expression Blend do the heavy lifting.
Here's a blog post about using Blend to embed fonts. The nice thing about using Blend is that it gives you some visual indications that things are set up correctly--i.e. you can see the font you want in the font selection menu. This is what finally clued me in on the .otf issue. I couldn't see the font in Blend.
And here's an example of a custom font that I've used in one of my apps:
<TextBlock Name="MyTextblock"
FontFamily="/MyAppName;component/fonts/Fonts.zip#Segoe UI Mono">
That's FontFamily URI is a pain to get right. I'm pretty sure that's your problem.
I was actually having the same problem. I followed everything to the dot and still I wasn't able to embed one particular font. So I created a new project and tried embedding the font there. Still no luck. I then tried embedding some other font. And lo and behold, as soon as I typed the FontFamily attribute, I could see that it had embedded. This was particularly odd since I didn't have to change any properties of the font.
I opened the project in Blend and clicked on the font property box to the right. It took a few seconds and then it embedded the font I was having problems with in the first place.

Resources