We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I'm comparing various fotns to see which is well readable at very small size. I found several candidates in Tools>CreateFont dialog. But when I plot a text samples using these fonts all looks the same. This is strange especialy when I compare monospaced fonts with non-monospaced. In CreateFont dialog the fonts are OK i.e. does not look the same.
I'm using processing 2.2.1 in Ubuntu 14.04 java version "1.7.0_55" OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1) OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)
this is the code for plotting text smaples by different fonts:
int sz = 14;
String teststring = "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz ~!@#$%^&*(){}[]_+|';<>?/";
//String teststring = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
static String [] fontNames = { "Georgia", "DejaVuSans","DejaVuSansMono", "Dialog.plain",
                               "DroidSansMono", "DroidSerif","DroidSansMono","LiberationMono",
                               "LiberationSans","LucidaSans-Typewriter","Monospaced.plain","SansSerif.plain",
                               "SourceCodePro-Regular","Ubuntu-Light","UbuntuMono-Bold","WenQuanYiMicroHeiMono"
                             };
void setup(){
  print( PFont.list() );
  size(1200,800);
  background(255);
  noSmooth();
  fill(0); 
  for ( int i=0; i<fontNames.length; i++ ){
    String name = fontNames[i];
    PFont myFont = createFont( name, sz, false );
    textFont(myFont);
    text( name      ,10,20+i*(sz+1) );
    text( teststring,200,20+i*(sz+1) );
  }
}
Answers
Your code worked for me for every font that I have properly installed, maybe you don't have them available...
Try this one, it will check to see if the font is available:
thanks, yes, the fonts are "not installed" according to PFont.list(), but what does it mean? These font are accesible by Tools>Create font or eg. in LibreOffice font selection. So how can I install them, or rather make them visible for PFont.list()?