01: /*
02: *******************************************************************************
03: * Copyright (C) 1998-2004, International Business Machines Corporation and *
04: * others. All Rights Reserved. *
05: *******************************************************************************
06: *
07: * Created on Dec 3, 2003
08: *
09: *******************************************************************************
10: */
11: package com.ibm.icu.dev.tool.layout;
12:
13: import java.io.PrintStream;
14:
15: public class GSUBWriter extends OpenTypeTableWriter {
16: private ScriptList scriptList;
17: private FeatureList featureList;
18: private LookupList lookupList;
19: private String scriptName;
20:
21: public GSUBWriter(String theScriptName, ScriptList theScriptList,
22: FeatureList theFeatureList, LookupList theLookupList) {
23: super (1024);
24:
25: scriptList = theScriptList;
26: featureList = theFeatureList;
27: lookupList = theLookupList;
28: scriptName = theScriptName;
29: }
30:
31: public void writeTable(PrintStream output) {
32: System.out.println("writing " + scriptName + " GSUB table...");
33:
34: // 0x00010000 (fixed1) version number
35: writeData(0x0001);
36: writeData(0x0000);
37:
38: int listOffset = getOutputIndex();
39:
40: writeData(0); // script list offset (fixed later)
41: writeData(0); // feature list offset (fixed later)
42: writeData(0); // lookup list offset (fixed later)
43:
44: fixOffset(listOffset++, 0);
45: scriptList.writeScriptList(this );
46:
47: fixOffset(listOffset++, 0);
48: featureList.writeFeaturetList(this );
49:
50: fixOffset(listOffset++, 0);
51: lookupList.writeLookupList(this );
52:
53: output.print("const le_uint8 ");
54: output.print(scriptName);
55: output.println("Shaping::glyphSubstitutionTable[] = {");
56:
57: dumpTable(output, 8);
58: output.println("};\n");
59: }
60: }
|