Name
SetFontScale -- apply scaling factor to font (V10.0)
Synopsis
int error = SetFontScale(APTR handle, double *sx, double *sy, struct
                hwTagList *tags);
Function
If your LoadFont() implementation has indicated that the font is a vector font by setting the HWFONTFLAGS_VECTOR flag, SetFontScale() needs to apply the scaling coefficients passed in sx and sy to the font. Note that these are passed as pointers to double solely for compatibility with WarpOS. You must not write anything to these pointers, they are just for reading.

Note that if your LoadFont() implementation has set the HWFONTFLAGS_LAYOUT flag, SetFontScale() will never be called. In that case, any scaling coefficients will be passed to your RenderText() implementation as a 2D transformation matrix.

Since applying scaling coefficients can always lead to floating point inaccuracies, your implementation of SetFontScale() should always pass the scaled pixel height and baseline of the font back to Hollywood. This is done using the tag list passed to SetFontScale() in the tags parameter. The tag list can contain the following tags:

HWFONTSCALETAG_HEIGHT:
The pData member of the tag contains a pointer to an int that you should write the new font height in pixels to.

HWFONTSCALETAG_BASELINE:
The pData member of the tag contains a pointer to an int that you should write the new font baseline in pixels to.

Inputs
handle
the font handle allocated by LoadFont()
sx
x scaling coefficient passed as a pointer to a double
sy
y scaling coefficient passed as a pointer to a double
tags
tag list containing further options
Results
error
error code or 0 for success

Show TOC