/* * [FontSamples.java] * * Summary: Sample text to display, includes "difficult" characters to test a font. * * Copyright: (c) 2005-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 2.9 2009-01-23 add Kanji digits to font samples */ package com.mindprod.fontshowerawt; import com.mindprod.common18.ST; /** * Sample text to display, includes "difficult" characters to test a font. *

* Used by both FontShower and FontShowerAwt. * * @author Roedy Green, Canadian Mind Products * @version 2.9 2009-01-23 add Kanji DIGITS to font samples * @since 2005 */ public final class FontSamples { /** * ARROWS */ private static final String ARROWS = "arrows: " + ST.spaceOut( "\u2190" + "\u2191" + "\u2192" + "\u2193" + "\u2194" + "\u2195" + "\u2196" + "\u2197" + "\u2198" + "\u2199" + "\u21d0" + "\u21d1" + "\u21d2" + "\u21d3" + "\u21d4" + "\u21d5" ); /** * various CURRENCY SYMBOLS */ private static final String CURRENCY = "currency: " + ST.spaceOut( "$"// $ + "\u20ac"// Euro + "\u00a3"// pound sterling sign + "\u00a4"// general CURRENCY sign + "\u00a5"// Yen + "\u00a2"// cent sign + "\u20a1"// Costa Rica Colon + "\u20a2"// Brazil Cruzeiro + "\u20a3"// French Franc + "\u20a4"// Lira + "\u20a5"// mil + "\u20a6"// Nigera Naira + "\u20a7"// Spain Peseta + "\u20a8"// India Rupee + "\u20a9"// Korea Won + "\u20aa"// Israel new shequel + "\u20ab"// VietName Dong + "\u20ad"// Laos Kip + "\u20ae"// Mongolia Tugrik + "\u20af"// Greek Drachma + "\u20b1"// peso + "\u20b2"// Paraguay Gurani + "\u20b4"// Urkraine Hryvnia + "\u20b5"// Ghana cedi + "\u17db"// Kmer Riel ); // + "\u060b" // Afghani sign (makes list display backwards) // + "\u0e3f" // Thai Baht (inhibits anti-aliasing) // + "\ufdfc" // Yemeni rial (inhibits antialiasing) /** * DIGITS */ private static final String DIGITS = "digits: " + ST.spaceOut( "0123456789" ); /** * esperanto accented letters */ private static final String ESPERANTO = "Esperanto: " + ST.spaceOut( "cghjsu = " + "\u0109\u011d\u0125\u0135\u015d\u016d\u00fb" + " CGHJSU = " + "\u0108\u011c\u0124\u0134\u015c\u016c\u00db" ); /** * Japanese DIGITS. Symbols needd for InWords Japaneseu */ private static final String JAPANESE_DIGITS = "Kanji digits: " + ST.spaceOut( "\u96f6" + "\u4e00" + "\u4e8c" + "\u4e09" + "\u56db" + "\u4e94" + "\u516d" + "\u4e03" + "\u516b" + "\u4e5d" + // groups "\u5341" + "\u767e" + "\u5343" + "\u4e07" + "\u61b6" + "\u5146" + "\u4eac" + "\u5793" + // minus "\u30de\u30a4\u30ca\u30b9" ); /** * high ascii latin-1 extension to ASCII */ private static final String LATIN_EXTENDED = "Latin ext: " + ST.spaceOut( "\u00a2" // cent + "\u00a3" // pound + "\u00a4" // curren + "\u00a5" // yen + "\u00a1" // inverted ! + "\u00bf" // inverted question mark + "\u00a6" // brev bar + "\u00a7" // section + "\u00a8" // dieresis + "\u00af" // raised bar + "\u00b0" // degree + "\u00a9" // copyright + "\u00ae" // reg + "\u00ab" // << + "\u00bb" // >> + "\u00b9" // sup1 + "\u00b2" // sup2 + "\u00b3" // sup3 + "\u00b4" // acute + "\u00b5" // micro + "\u00b6" // pilcrow para + "\u00b7" // middot + "\u00b8" // cedilla + "\u00bc" // 1/4 + "\u00bd" // 1/2 + "\u00be" // 1/3 + "\u00b1" // plus minus + "\u00d7" // x + "\u00f7" // division + "\u00ac" // not + "\u00df" // German SS + "\u00aa" // underlined a + "\u00ba"// underlined o ); /** * look alikes 164 ¤ ¤ CURRENCY 8216 ‘ ‘ left single quotation mark 8217 ’ ’ * right single quotation mark 8218 ‚ ‚ single low-9 quotation mark 8220 “ “ left double * quotation mark 8221 ” ” right double quotation mark 8222 „ „ double low-9 quotation * mark */ private static final String LOOK_ALIKES = "lookalikes: " + "uvw wW gq9 2z 5s il17|!j oO08" + "\u00a4" /* ¤ */ + " " + ";:," + "\u201c" /* “ */ + "\u2018" /* ‘ */ + "\u2019" /* ’ */ + "\u201d" /* ” */ + "\u201a" /* ‚ */ + "\u201e" /* „ */ + ". " + "`'" + "\u00b4" /* ´ */ + "\"" + "{[()]} m nn rn"; /** * lower case accented letters */ private static final String LOWER_ACCENTS = "lower accents: " + ST.spaceOut( "\u00e1" + "\u00e2" + "\u00e6" + "\u00e0" + "\u00e5" + "\u00e3" + "\u00e4" + "\u00e7" + "\u00e9" + "\u00ea" + "\u00e8" + "\u00f0" + "\u00eb" + "\u0192" + "\u00ed" + "\u00ee" + "\u00ec" + "\u00ef" + "\u00f1" + "\u00f3" + "\u00f4" + "\u0153" + "\u00f2" + "\u00f8" + "\u00f5" + "\u00f6" + "\u0161" + "\u00df" + "\u00fe" + "\u00fa" + "\u00fb" + "\u00f9" + "\u00fc" + "\u00fd" + "\u0178" + "\u111d"/* ghat */ ); /** * lower case unaccented letters. */ private static final String LOWER_CASE = "lower: " + ST.spaceOut( "abcdefghijklmnopqrstuvwxyz" ); /** * ASCII puncutation */ private static final String PUNCTUATION = "punctuation: " + ST.spaceOut( "!\"#$%&'()*+,-./:;<=>?@[\\^_z{|}~" ); /** * various SYMBOLS */ private static final String SYMBOLS = "symbols: " + ST.spaceOut( "\u3041"// Hiragana Japanese + "\u30b0"// Katakana Japanese + "\u3302"// Chinese + "\u4e02"// Chinese + "\u4e70"// chinese buy, purchase, bribe, persuade + "\u0921"// Hindi/Devanagari + "\u2208"// element of + "\u2209"// not element of, works in Opera but not IE + "\u227a"// curly < + "\u260e"// phone + "\u2642"// male + "\u2646"// neptune + "\u2661"// white heart + "\u2665"// black heart (card suit) + "\u2714"// check + "\u2718"// ballot x + "\u2741"// dingbat mandala + "\u2766"// leaf marking end of section + "\u27a6"// swooping arrow + "\u27bd"// feathered arrow + "\u267b"// recycle + "\u262d"// hammer and sickle + "\u2779"// black circled 4 + "\u2466"// circled 7 ); /** * upper case accented */ private static final String UPPER_ACCENTS = "upper accents: " + ST.spaceOut( "\u00c1" + "\u00c2" + "\u00c6" + "\u00c0" + "\u00c5" + "\u00c3" + "\u00c4" + "\u00c7" + "\u00c9" + "\u00ca" + "\u00c8" + "\u00d0" + "\u00cb" + "\u0192" + "\u00cd" + "\u00ce" + "\u00cc" + "\u00cf" + "\u00d1" + "\u00d3" + "\u00d4" + "\u0152" + "\u00d2" + "\u00d8" + "\u00d5" + "\u00d6" + "\u0160" + "\u00df" + "\u00de" + "\u00da" + "\u00db" + "\u00d9" + "\u00dc" + "\u00dd" + "\u00ff" + "\u011c"/* Ghat */ ); /** * upper case unaccented */ private static final String UPPER_CASE = "upper: " + ST.spaceOut( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ); /** * all the lines combined ready to display */ private static final String[] fontSampleLines; /** * use an assortment of pangrams see http://www.fun-with-words.com/pang_example.html */ private static final String[] pangrams = { "The quick brown fox jumped over the lazy dog's back.", "Pack my box with five dozen liquor jugs.", "Jackdaws love my big sphinx of quartz.", "Mr. Jock, TV quiz PhD, bags few lynx." }; static { // combined all lines into an array final String[] combined = { LOOK_ALIKES, LOWER_CASE + " " + DIGITS, UPPER_CASE, LOWER_ACCENTS, UPPER_ACCENTS, ESPERANTO, JAPANESE_DIGITS, PUNCTUATION, LATIN_EXTENDED, SYMBOLS, ARROWS, CURRENCY }; // glue combined + pangrams to produce sampleLines fontSampleLines = ST.join( combined, pangrams ); } /** * get a font sample in the form an array of strings, one per line * * @return array of Strings one per line, with the sample text * @noinspection UnusedParameters */ public static String[] getFontSampleLines() { return fontSampleLines; } /** * get a font sample in the form one long String with line separated by \ns. * * @return sample text */ public static String getFontSampleText() { // append \n to all lines but the last. StringBuilder sb = new StringBuilder( 1100 ); for ( int i = 0; i < fontSampleLines.length; i++ ) { if ( i != 0 ) { sb.append( '\n' ); } sb.append( fontSampleLines[ i ] ); } return sb.toString(); } }