13

It doesn't even recognise it as a Monospaced font. Then it only shows anti-aliasing when the font size is set to 20 or over. But for other fonts it does it at 16.

The result is ugly looking fonts and eye-strain when set to 16, which is still large.

I am using these settings in studio64.vmoptions file

-Dawt.useSystemAAFontSettings=lcd
-Dswing.aatext=true
-Dsun.java2d.xrender=true

I have tried various settings for Dawt.useSystemAAFontSettings and still the same issue.

Ubuntu Monospace font looks fine in Eclipse and other text editors.Where in Eclipse it's size 12 and it renders fine.

Here are some screenshots Ubuntu Mono 16 :Ubuntu Mono 16

Ubuntu Mono 20 Ubuntu Mono 16

Source Pro 16 (I think comes with Studio) Source Pro 16

Ubuntu Mono 12 in Eclipse (ideal for me) Ubuntu Mono 12 in Eclipse

I have uploaded the images to imgur as this site is compressing the images, and the quality is affected.

Is there another setting that is controlling what size to turn on anti-aliasing on a font. Is there a way to control the dpi setting used in the Android Studio.

Anyone else have other font recommendations. I have tried droid mono, and other default ones that come with Ubuntu.

I am using Android Studio 0.86, Oracle's Java 7 on Ubuntu 12.04 with Nvidia drivers.

pt123
  • 652

3 Answers3

2

The problem is not anti-aliasing - all of your examples show the text is anti-aliased fine.

The difference is in an aspect of font rendering called "hinting" - the top Ubuntu Mono example shows a strong hinting, whereas the bottom Ubuntu Mono example shows a smoother hinting. Hinting deforms the letter shapes to better align to the pixel grid and give a more crisp appearance.

Whether you like one or the other is a matter of personal preference. The top one is certainly very clear to read but at the expense of deforming the letter shapes.

The Java environment will be using its own font renderer rather than your global settings, hence the difference.

There are various fixes for this described in this link at stackoverflow.com:

https://stackoverflow.com/questions/17510099/ugly-fonts-in-java-applications-on-ubuntu

This one looks pretty simple (I have not tested this):

Try adding

export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=gasp'

to your ~/.bashrc

But the chosen solution is more complex.

thomasrutter
  • 36,774
  • Tried it still the same issue, Android Studio will not apply Anti-Aliasing to the Ubuntu Mono at smaller sizes. While other IDEs have no problem applying it. – pt123 Jul 25 '15 at 03:17
  • As I said, it is applying anti-aliasing, the difference is in the hinting. – thomasrutter Jul 25 '15 at 11:24
  • I think it has more to do with a hidden setting which prevents it from applying anti-aliasing/hinting for font sizes below a certain size. – pt123 Jul 25 '15 at 14:15
0

Found very easy and very tricky solution link to video The dude just made a link to a jre from Intellij Idea folder and put it to android studio folder and vuala!

maks1m
  • 11
  • 1
0

to resolve JAVA Picked up Option:

just follow the simple step:

open a terminal:

sudo -i
[sudo] password for amit: ******* <------ Your system password
gedit /etc/profile

{now one editor will be open don't delete any thing, in the last part where you set your JAVA PATH after fi just write

unset _JAVA_OPTIONS

and save it and close

after that type again into your terminal

exit
. /etc/profile

all get set now check

java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
Zanna
  • 70,465
Amit
  • 1
  • Just one point: It is not a good idea to run gedit with sudo as it will edit the file as root. If you need to edit the content of a file, it is better to open gedit from terminal, use gksudo. – Mostafa Ahangarha Feb 18 '17 at 09:14