Learn R Programming

AmigaFFH (version 0.4.3)

c: Combine multiple AmigaFFH objects

Description

Use this function to correctly combine one or more AmigaBitmapFont class objects into a single AmigaBitmapFontSet class object, or to combine multiple AmigaBasic class objects.

Usage

# S3 method for AmigaBasic
c(...)

# S3 method for AmigaBitmapFont c(..., name = "font")

Value

Returns an AmigaBitmapFontSet in which the AmigaBitmapFont objects are combined. Or when AmigaBasic

objects are combined, an AmigaBasic object is returned in which the lines of Amiga Basic code are combined.

Arguments

...

Either AmigaBasic or AmigaBitmapFont class objects. In case of AmigaBitmapFont objects: Each AmigaBitmapFont object should have a unique Y-size.

name

This argument is only valid when ... are one or more AmigaBitmapFont class objects.

A character string specifying the name that needs to be applied to the font set. When unspecified, the default name 'font' is used. Note that this name will also be used as a file name when writing the font to a file. So make sure the name is also a valid file name. This will not be checked for you and may thus result in errors.

Author

Pepijn de Vries

Details

In case ... are one or more AmigaBasic class objects:

AmigaBasic class objects are combined into a single AmigaBasic class object in the same order as they are given as argument to this function. for this purpose the lines of Amiga Basic codes are simply concatenated.

In case ... are one or more AmigaBitmapFont class objects:

AmigaBitmapFontSet class objects can hold multiple AmigaBitmapFont class objects. Use this method to combine font bitmaps into such a font set. Make sure each bitmap represents a unique font height (in pixels). When heights are duplicated an error will be thrown.

You can also specify a name for the font, that will be embeded in the object. As this name will also be used as a file name when writing the font to a file, make sure that it is a valid filename.

See Also

Other AmigaBitmapFont.operations: AmigaBitmapFont, availableFontSizes(), fontName(), font_example, getAmigaBitmapFont(), rasterToAmigaBitmapFont(), rawToAmigaBitmapFontSet(), rawToAmigaBitmapFont(), read.AmigaBitmapFontSet(), read.AmigaBitmapFont(), write.AmigaBitmapFont()

Examples

Run this code
if (FALSE) {
data(font_example)

## first get some AmigaBitmapFont objects:
font8 <- getAmigaBitmapFont(font_example, 8)
font9 <- getAmigaBitmapFont(font_example, 9)

## now bind these bitmaps again in a single set
font.set <- c(font8, font9, name = "my_font_name")

## Amiga Basic codes can also be combined:
bas1 <- as.AmigaBasic("LET a = 1")
bas2 <- as.AmigaBasic("PRINT a")
bas  <- c(bas1, bas2)
}

Run the code above in your browser using DataLab