From 314d86e36e9955fd5f4f695d0f5429900a4d84b9 Mon Sep 17 00:00:00 2001 From: Denis Molony Date: Fri, 1 Nov 2019 16:39:23 +1000 Subject: [PATCH] add load address to font files --- src/com/bytezone/diskbrowser/applefile/FontFile.java | 5 +++-- src/com/bytezone/diskbrowser/dos/AbstractCatalogEntry.java | 2 +- src/com/bytezone/diskbrowser/prodos/FileEntry.java | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/com/bytezone/diskbrowser/applefile/FontFile.java b/src/com/bytezone/diskbrowser/applefile/FontFile.java index af8bf79..150538d 100644 --- a/src/com/bytezone/diskbrowser/applefile/FontFile.java +++ b/src/com/bytezone/diskbrowser/applefile/FontFile.java @@ -23,9 +23,10 @@ public class FontFile extends AbstractFile List characters = new ArrayList (); - public FontFile (String name, byte[] buffer) + public FontFile (String name, byte[] buffer, int address) { super (name, buffer); + loadAddress = address; image = new BufferedImage ( // dimension (charsX, borderX, sizeX, gapX), // @@ -37,7 +38,7 @@ public class FontFile extends AbstractFile if (false) // show gaps around the glyphs { - g2d.setColor (new Color (245, 245, 245)); + g2d.setColor (new Color (245, 245, 245)); // match background g2d.fillRect (0, 0, image.getWidth (), image.getHeight ()); } diff --git a/src/com/bytezone/diskbrowser/dos/AbstractCatalogEntry.java b/src/com/bytezone/diskbrowser/dos/AbstractCatalogEntry.java index feb2c28..0a2c1ea 100644 --- a/src/com/bytezone/diskbrowser/dos/AbstractCatalogEntry.java +++ b/src/com/bytezone/diskbrowser/dos/AbstractCatalogEntry.java @@ -199,7 +199,7 @@ abstract class AbstractCatalogEntry implements AppleFileSource if ((name.endsWith (".FONT") || name.endsWith (" FONT") || name.endsWith (".SET") || name.startsWith ("ASCII.")) && FontFile.isFont (exactBuffer)) - appleFile = new FontFile (name, exactBuffer); + appleFile = new FontFile (name, exactBuffer, loadAddress); else if (ShapeTable.isShapeTable (exactBuffer)) appleFile = new ShapeTable (name, exactBuffer); else if (name.endsWith (".S")) diff --git a/src/com/bytezone/diskbrowser/prodos/FileEntry.java b/src/com/bytezone/diskbrowser/prodos/FileEntry.java index 1f50509..8d5c66e 100755 --- a/src/com/bytezone/diskbrowser/prodos/FileEntry.java +++ b/src/com/bytezone/diskbrowser/prodos/FileEntry.java @@ -249,9 +249,9 @@ class FileEntry extends CatalogEntry implements ProdosConstants // I made up aux=99 to test it without stepping on aux==04 file = new SHRPictureFile2 (name, exactBuffer, 0xC0, 99, endOfFile); else if (name.endsWith (".FNT") && FontFile.isFont (exactBuffer)) - file = new FontFile (name, exactBuffer); + file = new FontFile (name, exactBuffer, auxType); else if (name.endsWith (".FONT") && FontFile.isFont (exactBuffer)) - file = new FontFile (name, exactBuffer); + file = new FontFile (name, exactBuffer, auxType); else if (ShapeTable.isShapeTable (exactBuffer)) file = new ShapeTable (name, exactBuffer); else if (link != null) @@ -386,7 +386,7 @@ class FileEntry extends CatalogEntry implements ProdosConstants break; case FILE_TYPE_FNT: - file = new FontFile (name, exactBuffer); + file = new FontFile (name, exactBuffer, auxType); break; case FILE_TYPE_FONT: