// This macro demonstrates how to use the // getFontList() macro function. // To use true type fonts in ImageJ, place the *.ttf file in // the ImageJ/jre/lib/font/ folder and restart ImageJ. fonts = getFontList(); Dialog.create("Available fonts"); Dialog.addChoice("Font name",fonts); Dialog.addChoice("Font size",newArray("9","12","18","24","36","48","72"), "24"); Dialog.addCheckbox("Antialiased",true); Dialog.addCheckbox("Display all fonts",true); Dialog.show(); font = Dialog.getChoice(); size = Dialog.getChoice(); aa = Dialog.getCheckbox(); all = Dialog.getCheckbox(); if (aa) aa = "antialiased"; else aa = ""; setFont(font, size, aa); newImage(font+" Demo", "8-bit White", 512, size+size/2, 1); setColor(0); drawString ("ABCDEFGHIJKLMNOPQRSTUVWXYZ", 5, getHeight); if (!all) exit; n = fonts.length; newImage("All "+n+" Fonts", "RGB White", 512, 35*n, 1); for (i=0; i