A comprehensive representation of monochromous Amiga bitmap fonts.
Nowadays fonts are represented by vector graphics an computer systems.
On the original Commodore Amiga, the screen resolution, system memory
and cpu speed were limited. On those systems, it was more efficient
to use bitmap images to represent the glyphs in fonts. The
AmigaBitmapFont classes can be used
to represent Amiga bitmap fonts.
The Commodore Amiga had a directory named 'FONTS' located in the root, where (bitmap) fonts were stored. Font sets were stored under the font name with a *.font extension. Files with the *.font extension did not contain the bitmap images of the font. Rather the *.font file contained information on which font heights (in pixels) are available, in addition to some other meta-information.
The bitmap images were stored in separate files for each individual
AmigaBitmapFontSet is an S3 class that forms
a comprehensive format (named
list) to represent the *.font
AmigaBitmapFont is an S3 class is a comprehensive
list) that represent each font bitmap and glyph
AmigaBitmapFontSet objects will hold one or more
AmigaBitmapFontSet objects are
lists. Their structure and most important
elements are described below. Although it is possible to replace
elements manually, it is only advisable when you know what you
are doing as it may break the validity of the font.
factor with levels 'FontContents', 'TFontContents' and
'ScalableOutline'. It specifies the type of font.
Currently only the first level is supported.
number of font heights available for this font. It should
match with the length of
FontContents. Do not change
this value manually.
This is a
list with bitmap entries for each specific font
height (in pixels). The name of each element in this list is
'pt' followed by the height. Each element in this list holds
Miscellaneous information from the *.font file
This element represents the filename of the
nested font bitmap images. Note that it should be a valid
Commodore Amiga filename. It is best to modify this name
fontName. Note that this field could cause
problems as Commodore Amiga filenames can contain characters
that most modern platforms would not allow (such as the
This element is of type
AmigaBitmapFont and is structured
as described in the following section. The information in this
element is no longer part of the *.font file.
Information represented by a
AmigaBitmapFont is not stored
in *.font files. Rather it is stored in sub-directories of the font
in separate files. It has the following structure:
Elements with information on the font properties and style, and also relative file pointers.
data.frame containing glyph info with information
for specific glyphs on each row. Each row matches with a specific
ASCII code, ranging from
tf_LoChar up to
tf_HiChar. There is an additional
row that contains information for the default glyph that is
out of the range of the
2 + tf_HiChar - tf_LoChar rows. This
table is used to extract and plot a glyph from the
bitmap image correctly.
Is a monochromous bitmap image of all the font's glyphs in a
single line. It is a simple
as.raster) with an additional
attribute 'palette', which lists the two colours in the image. In
this palette, the first colour is the background colour and the
second colour is interpreted as the foregroundcolour.
For importing and exporting the following functions are useful:
The following generic functions are implemented for these objects:
c to combine one or more
AmigaBitmapFont objects into a
Pepijn de Vries
http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node03E0.html http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node03DE.html http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node05BA.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
## Not run: ## 'font_example' is an example of the AmigaBitmapFontSet object: data(font_example) ## An AmigaBitmapFont object can also be extracted from this object: font_example_9 <- getAmigaBitmapFont(font_example, 9) ## the objects can be printed, plotted, converted to raw data or a raster: print(font_example) plot(font_example) font_example_raw <- as.raw(font_example) font_example_raster <- as.raster(font_example) ## You can also format text using the font: formated_raster <- as.raster(font_example, text = "Foo bar", style = "bold") plot(font_example, text = "Foo bar", style = "underlined", interpolate = F) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.