Jump to content

GreDeviceSetAVIOFont: Difference between revisions

From EDM2
Created page with "GreDeviceSetAVIOFont loads or deletes an image font used by the AVIO presentation space associated with the device context. ;Simulation support: This function is mandatory f..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreDeviceSetAVIOFont loads or deletes an image font used by the AVIO presentation space associated with the device context.  
GreDeviceSetAVIOFont loads or deletes an image font used by the AVIO presentation space associated with the device context.


;Simulation support: This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.  
;Simulation support: This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.


== Syntax ==  
== Syntax ==  
  GreDeviceSetAVIOFont(hdc, pLogFont, pFontDef, lcid, pInstance, lFunction);
  GreDeviceSetAVIOFont(hdc, pLogFont, pFontDef, lcid, pInstance, lFunction)
 
== Parameters ==
== Parameters ==
;hdc (HDC) - input  
;hdc (HDC) - input:The device context handle.
:The device context handle.  
;pLogFont (P[[FATTRS]]) - input:A pointer to a logical font.
 
;pFontDef (PBYTE) - input:A pointer to a physical font data structure. When the value passed is 0, the handling routine must delete the loaded font corresponding to lLcid. If the high-order bit of the high-order WORD in lLcid is set, the handle is for a device font.
;pLogFont (PFATTRS) - input  
;lcid (LONG) - input:Local identifier value of -2, -3, or -4.
:A pointer to a logical font.  
;pInstance (PVOID) - input:A pointer to instance data.
 
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreDeviceSetAVIOFont.
;pFontDef (PBYTE) - input  
:A pointer to a physical font data structure. When the value passed is 0, the handling routine must delete the loaded font corresponding to lLcid. If the high-order bit of the high-order WORD in lLcid is set, the handle is for a device font.  
 
;lcid (LONG) - input  
:Local identifier value of -2, -3, or -4.  
 
;pInstance (PVOID) - input  
:A pointer to instance data.  
 
;lFunction (ULONG) - input  
:High-order WORD=flags; low-order WORD=NGreDeviceSetAVIOFont.  


== Returns ==
== Returns ==
;fSuccess (BOOL) - returns  
;fSuccess (BOOL) - returns:Return codes.
:Return codes.  
:On completion, the handling routine must return BOOLEAN (fSuccess).
 
:*TRUE Successful. The font is acceptable for use with an AVIO presentation space.
:On completion, the handling routine must return BOOLEAN (fSuccess).  
:*FALSE Error.
 
:*TRUE Successful. The font is acceptable for use with an AVIO presentation space.  
:*FALSE Error.  
 
== Sample ==
<pre>
#define INCL_GRE_DEVMISC1
#include <os2.h>
 
HDC        hdc;        /*  The device context handle. */
PFATTRS    pLogFont;  /*  A pointer to a logical font. */
PBYTE      pFontDef;
LONG      lcid;      /*  Local identifier value of -2, -3, or -4. */
PVOID      pInstance;  /*  A pointer to instance data. */
ULONG      lFunction;  /*  High-order WORD=flags; low-order WORD=NGreDeviceSetAVIOFont. */
BOOL      fSuccess;  /*  Return codes. */
 
fSuccess = GreDeviceSetAVIOFont(hdc, pLogFont,
            pFontDef, lcid, pInstance, lFunction);
</pre>


== Remarks ==
== Remarks ==
When loaded, the font is used by subsequent GreCharRect, GreCharStr, and GreScrollRect calls to draw the character images for the appropriate AVIO set. lLcid identifiers LCID_AVIO_1, LCID_AVIO_2, and LCID_AVIO_3 correspond to AVIO sets 1, 2, and 3 respectively.  
When loaded, the font is used by subsequent [[GreCharRect]], [[GreCharStr]], and [[GreScrollRect]] calls to draw the character images for the appropriate AVIO set. lLcid identifiers LCID_AVIO_1, LCID_AVIO_2, and LCID_AVIO_3 correspond to AVIO sets 1, 2, and 3 respectively.


If the font is not acceptable for use with an AVIO presentation space, the handling routine returns FALSE to indicate an error. The font must be a fixed-pitch image (raster) font that matches one of the cell sizes for the default font. If the font does not match a supported cell size, the characters are displayed in the presentation space as black cells.  
If the font is not acceptable for use with an AVIO presentation space, the handling routine returns FALSE to indicate an error. The font must be a fixed-pitch image (raster) font that matches one of the cell sizes for the default font. If the font does not match a supported cell size, the characters are displayed in the presentation space as black cells.


A possible approach is for the presentation driver to realize the AVIO fonts required and store the pointers to the fonts in the DC instance data structure.  
A possible approach is for the presentation driver to realize the AVIO fonts required and store the pointers to the fonts in the DC instance data structure.


[[Category:Gre]]
[[Category:Gre]]

Latest revision as of 23:10, 17 January 2020

GreDeviceSetAVIOFont loads or deletes an image font used by the AVIO presentation space associated with the device context.

Simulation support
This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.

Syntax

GreDeviceSetAVIOFont(hdc, pLogFont, pFontDef, lcid, pInstance, lFunction)

Parameters

hdc (HDC) - input
The device context handle.
pLogFont (PFATTRS) - input
A pointer to a logical font.
pFontDef (PBYTE) - input
A pointer to a physical font data structure. When the value passed is 0, the handling routine must delete the loaded font corresponding to lLcid. If the high-order bit of the high-order WORD in lLcid is set, the handle is for a device font.
lcid (LONG) - input
Local identifier value of -2, -3, or -4.
pInstance (PVOID) - input
A pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreDeviceSetAVIOFont.

Returns

fSuccess (BOOL) - returns
Return codes.
On completion, the handling routine must return BOOLEAN (fSuccess).
  • TRUE Successful. The font is acceptable for use with an AVIO presentation space.
  • FALSE Error.

Remarks

When loaded, the font is used by subsequent GreCharRect, GreCharStr, and GreScrollRect calls to draw the character images for the appropriate AVIO set. lLcid identifiers LCID_AVIO_1, LCID_AVIO_2, and LCID_AVIO_3 correspond to AVIO sets 1, 2, and 3 respectively.

If the font is not acceptable for use with an AVIO presentation space, the handling routine returns FALSE to indicate an error. The font must be a fixed-pitch image (raster) font that matches one of the cell sizes for the default font. If the font does not match a supported cell size, the characters are displayed in the presentation space as black cells.

A possible approach is for the presentation driver to realize the AVIO fonts required and store the pointers to the fonts in the DC instance data structure.