Functions to write AmigaBitmapFont()
and AmigaBitmapFontSet()
class objects to files.
Usage
write.AmigaBitmapFont(x, file, disk = NULL)
write.AmigaBitmapFontSet(x, path = getwd(), disk = NULL)
Arguments
- x
Respectively an
AmigaBitmapFont()
or aAmigaBitmapFontSet()
object depending on which of the write-functions is called. This is the object that will be written to the specified file.- file
A
character
string specifying the file location to whichx
(anAmigaBitmapFont()
object) needs to be written. It is common practice on the Amiga to use the font height in pixels as file name.- disk
A virtual Commodore Amiga disk to which the
file
should be written. This should be anamigaDisk()
object. Using this argument requires the adfExplorer package. When set toNULL
, this argument is ignored.- path
A
character
string specifying the path wherex
(anAmigaBitmapFontSet()
object) needs to be stored. The filename for the font set will be extracted fromx
usingfontName()
followed by the *.font extension. A subdirectory will be created with the same name (without the extension) if it doesn't already exists. In this subdirectory all the nestedAmigaBitmapFont()
objects are stored.
Value
Invisibly returns the result of the call of close
to the
file connection. Or, when disk
is specified, a copy of
disk
is returned to which the file(s) is/are written.
Details
AmigaBitmapFontSet()
class objects are written to a *.font
file. The filename used for this purpose is obtained from the object
itself using fontName()
. In addition, a subdirectory is
created automatically (when it doesn't already exist)
to which al the separate bitmap images for each font height are written
to individual files.
AmigaBitmapFont()
class objects can also be written to a
file. In order to use it on a Commodore Amiga or emulator, it is better
to embed the font bitmap in a font set (using c()
)
and write the set to corresponding files.
See also
Other AmigaBitmapFont.operations:
AmigaBitmapFont
,
availableFontSizes()
,
c()
,
fontName()
,
font_example
,
getAmigaBitmapFont()
,
rasterToAmigaBitmapFont()
,
rawToAmigaBitmapFontSet()
,
rawToAmigaBitmapFont()
,
read.AmigaBitmapFontSet()
,
read.AmigaBitmapFont()
Other io.operations:
read.AmigaBasicBMAP()
,
read.AmigaBasicShape()
,
read.AmigaBasic()
,
read.AmigaBitmapFontSet()
,
read.AmigaBitmapFont()
,
read.AmigaIcon()
,
read.SysConfig()
,
read.iff()
,
write.AmigaBasicShape()
,
write.AmigaBasic()
,
write.AmigaIcon()
,
write.SysConfig()
,
write.iff()
Examples
if (FALSE) {
## obtain a bitmap font set:
data(font_example)
## write the font set to their files. The file name
## is extracted from the font object, so you only have
## to provide the path:
write.AmigaBitmapFont(font_example, temp.dir())
## extract a font bitmap:
font <- getAmigaBitmapFont(font_example, 9)
## and write it to the temp dir:
write.AmigaBitmapFont(font, file.path(temp.dir(), "9"))
## The following examples require the 'adfExplorer' package:
font.disk <- adfExplorer::blank.amigaDOSDisk("font.disk")
font.disk <- adfExplorer::dir.create.adf(font.disk, "FONTS")
font.disk <- write.AmigaBitmapFontSet(font_example, "DF0:FONTS", font.disk)
}