Skip to contents

Reads AmigaBitmapFontSet() from *.font file including all nested bitmap images for all font heights.

Usage

read.AmigaBitmapFontSet(file, ...)

Arguments

file

A character string of the filename of the *.font file to be read.

...

Currently ignored.

Value

Returns an AmigaBitmapFontSet() object read from the specified file.

Details

The *.font file only holds meta-information. The bitmap images for each font height are stored in separate files, which are listed in the *.font file. The function reads the *.font file, including all nested bitmap files and returns it as a AmigaBitmapFontSet().

It can also read *.font files from virtual disks ((adf_file_con())) objects, but that requires the adfExplorer package to be installed.

Author

Pepijn de Vries

Examples

data(font_example)

## in order to read, we first need to write a file"
write.AmigaBitmapFontSet(font_example, tempdir())

## The font is written as 'AmigaFFH.font' as that name
## is embedded in the AmigaBitmapFontSet object 'font_example'.
## We can read it as follows:
font.read <- read.AmigaBitmapFontSet(file.path(tempdir(), "AmigaFFH.font"))

## similarly, the file can also be written and read from and to
## a virtual amiga disk. The following codes requires the 'adfExplorer'
## package:
if (requireNamespace("adfExplorer")) {
  library("adfExplorer")
  virtual_disk_file <- tempfile(fileext = ".adf") |>
    create_adf_device(write_protected = FALSE) |>
    prepare_adf_device("font_disk") |>
    make_adf_dir("FONTS")
  
  dest <- virtual_path(virtual_disk_file, "DF0:FONTS")
  write.AmigaBitmapFontSet(font_example, dest)
  font.read <- read.AmigaBitmapFontSet(
    virtual_path(virtual_disk_file, "DF0:FONTS/AmigaFFH.font")
  )
  close(virtual_disk_file)
}