Amos Professional Manual  Contents  Index

Fonts


Assigning fonts
In the original AMOS system, you were obliged to go back to the Amiga Disc Operating System every time that the current font directory needed changing. With AMOS Professional, ill(' ASSIGN instruction solves this problem.

ASSIGN
instruction: assign a name to a file or device
Assign "Name:" To "New_Pathname"
Assign "Name:" To "Device"

Supposing that you have an extensive library of fonts installed on a hard disc, as part of your development system, but you are writing programs for users who only have use of the internal floppy drive. You will need to test your programs with a reduced number of fonts, and employ the internal drive instead of your hard disc. This is easily achieved with the following line:

X> Assign "Fonts:" To "Df0:Fonts"

Now, every time that GET FONTS or GET DISC FONTS is called, the internal drive will be used instead of your hard disc.

Converting font coordinates
Obviously, with graphic fonts using coordinates measured in pixels, and text fonts positioned by character coordinates, a set of conversion functions between the two systems is vital.

XTEXT
YTEXT
functions: convert graphic coordinates to text coordinates
text x-coordinate=Xtext(graphic x-coordinate)
text y-coordinate=Ytext(graphic y-coordinate)

These self-explanatory functions convert coordinates from the standard graphical screen coordinates that use pixels, to text coordinates, that are given in character lines and column spacings. The resulting text coordinates are relative to the current window, and if the screen coordinate lies outside of this window, a negative value will be returned.

XGRAPHIC
YGRAPHIC
functions: convert text coordinates to graphic coordinates
graphic x-coordinate=Xtext(text x-coordinate)
graphic y-coordinate=Ytext(text y-coordinate)

This pair of functions performs the conversion of text format coordinates to graphic format coordinates, and can be used to position text over an area of graphics on the screen.

Back    Next
11.01.04