The Hollywood font specification is the notation that needs to be used when opening new fonts using SetFont(), OpenFont(), or @FONT. These three commands require you to pass a string describing the font you would like to open. This string must follow these guidelines:
SetFont("dh0:Fonts/Goudyb.font", 23) ; --> wrong! SetFont("Goudyb", 23) ; --> right! OpenFont(1, "c:/Windows/Fonts/Arial.ttf", 36) ; --> wrong! OpenFont(1, "Arial", 36) ; --> right! |
EXCEPTION: Starting with Hollywood 4.7, there is a new font engine called
#FONTENGINE_INBUILT
. If you are using this engine, you can specify the
font file directly, but only for *.ttf
fonts! So the following code is
legal with Hollywood 4.7 and up:
OpenFont(1, "c:/Windows/Fonts/Arial.ttf", 36, {Engine = #FONTENGINE_INBUILT}) |
#FONTENGINE_NATIVE
(for example on macOS). Thus, you should always specify the font name in exactly
the same way as it appears in the font. This can avoid potential problems.
SetFont("arial", 36) ; --> wrong! SetFont("Arial", 36) ; --> right! |
SetFont("Arial", 36) SetFont("Arial Bold", 36) SetFont("Arial Bold Italic", 36) |
Of course, you could also open "Arial" and then call SetFontStyle()
with #BOLD
or #ITALIC
set, but the advantage of using it directly
with SetFont() is that this will open the designed bold/italic
variant of the TrueType font. SetFontStyle() on the other hand, will
create bold and italic using an algorithm which does not look as good
as specifically designed bold/italic font faces.
"adobecaslonprobolditalic" -> "adobe caslon pro bold italic" |
"adobe caslon pro bold italic" -> "Adobe Caslon Pro bold italic" |
"Adobe Caslon Pro bold italic" -> "Adobe Caslon Pro Bold Italic" |
If you follow these guidelines, the font will also work on other systems than AmigaOS3, MorphOS, and AROS.