SetSimpleDialogResourceFont

Declaration

Delphi (DLL)
function SetSimpleDialogResourceFont(ResourceName: ShortString;   ResourceFilePath: PAnsiChar; WPARAM: integer): integer;register;

C/C++ (DLL)
_stdcall int SOPAD_SetSimpleDialogResourceScript(char *ResourceName, char *ScriptFilePath, int WParam);

ActiveX
HRESULT _stdcall SetSimpleDialogResourceFont([in] BSTR ResourceName, [in] BSTR ResourceFilePath, [in] long WParam, [out, retval] long* Result);

Description

Load or upload a font on/to the device. The default resources of the Device contain the following font options.

FontSizeResource Name
Arial8

arial8.sof

10

arial10.sof

12

arial12.sof

14arial14.sof
16arial16.sof
18arial18.sof
20arial20.sof
22arial22.sof
24arial24.sof
Times new Roman8tnr8.sof
10tnr10.sof
12tnr12.sof
14tnr14.sof
16tnr16.sof
18tnr18.sof
20tnr20.sof
22tnr22.sof
24tnr24.sof


Arguments

ResourceName: String; 

e.g.  "arail10.sof"   (note: Font File must reside on device)

ResourceFilePath: string

a Path to the SOF file on host system. Font File will be uploaded to device and immediately activated, but it will not be saved permanently.

WParam:DWORD

not used yet

Return value

SetSimpleDialogResourceFont returns (SOPAD_ERROR_SUCCESS = 0) if it was possible to cache the settings.
Otherwise the function returns the appropriate error code. You can get extended error code with the help of GetSOPadError call.

Possible error codes are listed below: Driver error codes

Samples

C#
//  Upload Images to the Device (to shadow framebuffer, which means they not dirctly visible)
SigDev.SetSimpleDialogResourceImage("", RessourcePath + "background.png", 0, 0, 0);

//  Select a font resource
int fontStatus = SigDev.SetSimpleDialogResourceFont("arial14.sof", "", 0);
//  Set Text, Placement and Colour
SigDev.SetSimpleDialogResourceText("This is a Test", 100, 300, 0, 0, 0);

//  Update Screen (with all images which are loaded to shadow framebuffer)
int displayOptionStatus = SigDev.SetSimpleDialogDisplayOption(1, 0);
Delphi
//  Upload Images to the Device (to shadow framebuffer, which means they not dirctly visible)
SigDev.SetSimpleDialogResourceImage('', RessourcePath + 'background.png', 0, 0, 0);

//  Select a font resource
SigDev.SetSimpleDialogResourceFont('arial14.sof', '', 0);
//  Set Text, Placement and black Text Colour and transparent Background color 
SigDev.SetSimpleDialogResourceText('This is a Test', 100, 300, clBlack , clBlack, 0);

//  Update Screen (with all images/texts which are loaded to shadow framebuffer)
SigDev.SetSimpleDialogDisplayOption(1, 0);

 

See also

SetSimpleDialogDisplayOption

SetSimpleDialogResourceImage

SetSimpleDialogResourceText