diff options
author | ArghKevin <kagheli@student.sdccd.edu> | 2024-05-16 03:14:12 -0700 |
---|---|---|
committer | ArghKevin <kagheli@student.sdccd.edu> | 2024-05-16 03:14:12 -0700 |
commit | 8c7631f8c21472ea0699a3def7682583efc119a9 (patch) | |
tree | 7c148a37e66ff7929d24ffba53bd4a0e4ab5b9cc /src | |
parent | 4a88de54721a6b11220d9b5a747f936e995941e3 (diff) |
Creation of FontFamily objects.
Diffstat (limited to 'src')
-rw-r--r-- | src/ComparisonView.java | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/ComparisonView.java b/src/ComparisonView.java index 04961ce..8e20cf3 100644 --- a/src/ComparisonView.java +++ b/src/ComparisonView.java @@ -21,6 +21,7 @@ import java.awt.*; public class ComparisonView extends JFrame { private final int WINDOW_MIN_WIDTH = 960; private final int WINDOW_MIN_HEIGHT = 540; + private ArrayList<FontFamily> fonts; /** * Walk the file tree. @@ -73,14 +74,33 @@ public class ComparisonView extends JFrame { } } - /* Create FontFamily objects from each METADATA.pb file. - Not done yet. */ + File styleFile = new File("families.csv"); + if (!styleFile.exists()) { + System.exit(-1); + } + + File popularityFile = new File("popularity.json"); + if (!popularityFile.exists()) { + System.exit(-1); + } + + + CSVReader style = new CSVReader(styleFile); + JSONReader popularity = new JSONReader(popularityFile); + /* Create FontFamily objects from each METADATA.pb file. */ + fonts = new ArrayList<FontFamily>(); for (File file : metadataList) { - System.out.println(file.getPath()); + JSONReader metadata = new JSONReader(file); + metadata.setPb(); + fonts.add(new FontFamily(metadata, popularity, style)); + } + + for (FontFamily font : fonts) { + System.out.println(font.getFamilyName()); + for (String subset : font.getSubsets()) { + System.out.println(subset); + } } - - new CSVReader(new File("families.csv")); - new JSONReader(new File("popularity.json")); } public static void main(String[] argv) { |