summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArghKevin <kagheli@student.sdccd.edu>2024-05-16 03:21:16 -0700
committerArghKevin <kagheli@student.sdccd.edu>2024-05-16 03:21:16 -0700
commitae99f9afc615bfd6f4dd0b6d6f7847928956a318 (patch)
tree129e4600c8ab916b6f974705ea50d0fa8af43297
parent8c7631f8c21472ea0699a3def7682583efc119a9 (diff)
Week 4 progress.
-rw-r--r--README.md11
-rw-r--r--src/FontFamily.java13
-rw-r--r--src/LineGraph.java2
-rw-r--r--update.sh2
-rw-r--r--week4.pngbin0 -> 66975 bytes
5 files changed, 23 insertions, 5 deletions
diff --git a/README.md b/README.md
index 7b3a020..0087f37 100644
--- a/README.md
+++ b/README.md
@@ -151,3 +151,14 @@ CSV parsing added. Not quite the original design, but one that's more practical.
JSON parsing not yet implemented, though the places where it will be needed have been outlined.
Javadoc comments added for existing methods.
![week3](week3.png)
+
+## Week 4: Updates
+JSON parsing works well enough for most FontFamily metadata to be composed.
+The only parsing which still needs implementation is tables of values.
+That'll be worked on tomorrow, when the trend calculation methods are begun.
+When originally writing the plans for this week, the repository still contained
+all of the outline fonts. That proved impractical. However, the metadata contains
+sets of data describing the Unicode subsets implemented by a font. Along with JSONReader.getAll(),
+this fulfulls most of the same purpose. No disk space calculation, unfortunately.
+There are 9 days left.
+![week4](week4.png)
diff --git a/src/FontFamily.java b/src/FontFamily.java
index 39fae26..cff4f87 100644
--- a/src/FontFamily.java
+++ b/src/FontFamily.java
@@ -23,8 +23,8 @@ public class FontFamily {
private HashMap<String,Integer> styles;
/* Taken from top level of METADATA.pb */
private String dateAdded;
- /* Languages supported. */
- private String[] languages;
+ /* Unicode ranges. */
+ private String[] subsets;
private String designer;
/* total views, 7day views, 30day views, 90day views, year views.
Taken from popularity.json. */
@@ -50,7 +50,7 @@ public class FontFamily {
private void parseMetadata(JSONReader metadata) {
familyName = metadata.get("name");
dateAdded = metadata.get("date_added");
- languages = metadata.getAll("languages");
+ subsets = metadata.getAll("subsets");
designer = metadata.get("designer");
license = metadata.get("license");
category = metadata.get("category");
@@ -67,4 +67,11 @@ public class FontFamily {
*/
private void parseStyles(CSVReader styles) {
}
+
+ public String getFamilyName() {
+ return familyName;
+ }
+ public String[] getSubsets() {
+ return subsets;
+ }
}
diff --git a/src/LineGraph.java b/src/LineGraph.java
index 4e05bb7..129bb1c 100644
--- a/src/LineGraph.java
+++ b/src/LineGraph.java
@@ -14,7 +14,7 @@ import javax.swing.*;
*/
public class LineGraph {
- int[][] coordinates; // A line graph has-a set of coordinates
+ private int[][] coordinates; // A line graph has-a set of coordinates
/**
* Constructor.
diff --git a/update.sh b/update.sh
index 361bcfd..b1ee72b 100644
--- a/update.sh
+++ b/update.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#git pull --recurse
-curl -LO https://raw.githubusercontent.com/google/fonts/main/tags/all/families.csv
+#curl -LO https://raw.githubusercontent.com/google/fonts/main/tags/all/families.csv
curl https://fonts.google.com/metadata/stats | \
# First line is junk.
sed -n -e '2,$p' > popularity.json
diff --git a/week4.png b/week4.png
new file mode 100644
index 0000000..1e86cc6
--- /dev/null
+++ b/week4.png
Binary files differ