forked from rillig/sfntly
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new tool FontViewer for examining existing fonts.
The goal of the FontViewer is to allow inspection of a font file, being close to the actual representation in the file. Only a few tables are implemented yet.
- Loading branch information
Showing
2 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
java/src/com/google/typography/font/tools/fontviewer/GsubTableNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.google.typography.font.tools.fontviewer; | ||
|
||
import com.google.typography.font.sfntly.table.opentype.GSubTable; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import javax.swing.JComponent; | ||
import javax.swing.JTextArea; | ||
|
||
public class GsubTableNode extends AbstractNode { | ||
|
||
private final GSubTable gsub; | ||
private final List<AbstractNode> children = new ArrayList<AbstractNode>(); | ||
|
||
public GsubTableNode(GSubTable gsub) { | ||
this.gsub = gsub; | ||
this.children.add(new SubTableNode(gsub.scriptList(), "script")); | ||
this.children.add(new SubTableNode(gsub.featureList(), "feature")); | ||
this.children.add(new SubTableNode(gsub.lookupList(), "lookup")); | ||
} | ||
|
||
@Override | ||
protected String getNodeName() { | ||
return "GSUB"; | ||
} | ||
|
||
@Override | ||
public int getChildCount() { | ||
return children.size(); | ||
} | ||
|
||
@Override | ||
public AbstractNode getChildAt(int index) { | ||
return children.get(index); | ||
} | ||
|
||
@Override | ||
JComponent render() { | ||
return new JTextArea(this.gsub.toString()); | ||
} | ||
} |