2 *******************************************************************************
3 * Copyright (C) 1998-2004, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
7 package com.ibm.icu.dev.tool.layout;
13 public class OpenTypeTagBuilder
15 private static String[] tableTags = {
71 private static String[] featureTags = {
197 private static String tagLabel(String tag)
199 StringBuffer result = new StringBuffer();
200 String upperTag = tag.toUpperCase();
202 for (int i = 0; i < upperTag.length(); i += 1) {
203 char ch = upperTag.charAt(i);
205 if ((ch < 'A' || ch > 'Z') && (ch < '0' || ch > '9')) {
212 return result.toString();
215 private static void dumpTags(String enumName, String[] tags)
217 System.out.println("enum LE" + enumName + "Tags {");
219 for (int i = 0; i < tags.length; i += 1) {
220 String tag = tags[i];
222 System.out.println(" LE_" + tagLabel(tag) + "_" + enumName.toUpperCase() +
223 "_TAG = " + TagUtilities.makeTag(tag) + "UL" +
224 (i == tags.length - 1? " " : ",") + " /* '" + tag + "' */");
227 System.out.println("};");
230 public static void main(String[] args)
232 dumpTags("Table", tableTags);
233 dumpTags("Feature", featureTags);