STRPTR file = hw_FindTTFFont(STRPTR name, int weight, int slant, int fileonly, int *offset, int *len, int *tmp);
#define HWFONTWEIGHT_THIN 0 #define HWFONTWEIGHT_EXTRALIGHT 40 #define HWFONTWEIGHT_ULTRALIGHT 40 #define HWFONTWEIGHT_LIGHT 50 #define HWFONTWEIGHT_BOOK 75 #define HWFONTWEIGHT_NORMAL 80 #define HWFONTWEIGHT_REGULAR 80 #define HWFONTWEIGHT_MEDIUM 100 #define HWFONTWEIGHT_SEMIBOLD 180 #define HWFONTWEIGHT_DEMIBOLD 180 #define HWFONTWEIGHT_BOLD 200 #define HWFONTWEIGHT_EXTRABOLD 205 #define HWFONTWEIGHT_ULTRABOLD 205 #define HWFONTWEIGHT_HEAVY 210 #define HWFONTWEIGHT_BLACK 210 #define HWFONTWEIGHT_EXTRABLACK 215 #define HWFONTWEIGHT_ULTRABLACK 215 |
If you pass -1 in the weight
argument, hw_FindTTFFont()
will ignore both the
weight
and the slant
parameters. The slant
parameter may be set to one
of the following special constants:
#define HWFONTSLANT_ROMAN 0 #define HWFONTSLANT_ITALIC 100 #define HWFONTSLANT_OBLIQUE 110 |
If the fileonly
parameter is set to True
, hw_FindTTFFont()
will only return
stand-alone TrueType font files. If fileonly
is set to False
, hw_FindTTFFont()
might also return TrueType fonts that have been linked into other files. In that
case, hw_FindTTFFont()
will write the TrueType font's location and its size inside
the container file to the offset
and len
integer pointers that you have to pass
as parameters 5 and 6.
Finally, if fileonly
is False
, hw_FindTTFFont()
might also extract a TrueType
font from a TTC file, write it to a temporary file and return this temporary
file to you. If that is the case, hw_FindTTFFont()
will write True
to the tmp
integer pointer that is the last parameter of this function. So if you find out
that hw_FindTTFFont()
has written True
to the integer pointer you've passed as the
last parameter, you will have to delete the temporary file when you're done with it.
True
if you only want to have stand-alone files
and no files-within-files or temporary TrueType fonts extracted by Hollywood (see above)True
or False
depending
on whether this function has created a temporary file
NULL
if no font could be found