• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Symbol Functions
      • Item Functions
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
        • Accept Function
        • Advance Statement
        • Ask Statement
        • ChangeKeyboard Function
        • Connection Function
        • DeMode Function
        • Display Orientation
        • EditNote Function
        • EndLevel Statement
        • EndGroup Statement
        • Enter Statement
        • GetCaptureType Function
        • GetCaseLabel Function
        • GetDeviceID Function
        • GetImage Function
        • GetNote Function
        • GetOperatorId Function
        • GetOS Function
        • GetRecord Function
        • GetUserName Function
        • GPS Function
        • Interactive GPS Modes
        • HideOcc Function
        • Highlighted Function
        • InAdvance Function
        • IsPartial Function
        • IsVerified Function
        • Move Statement
        • NoInput Statement
        • OnChangeLanguage Global Function
        • OnChar Global Function
        • OnKey Global Function
        • OnStop Global Function
        • OnSystemMessage Global Function
        • Prompt Function
        • Protect Function
        • PutNote Function
        • RandomizeVS Function
        • Reenter Statement
        • SavePartial Function
        • SelCase Function
        • Set Attributes Statement
        • Set Behavior CanEnter Statement
        • SetCapturePos Function
        • SetCaptureType Function
        • SetCaseLabel Function
        • Set ErrMsg Statement
        • SetFont Function
        • SetOperatorId Function
        • Show Function
        • ShowArray Function
        • ShowOcc Function
        • Skip Statement
        • Userbar Function
        • VisualValue Function
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

SetFont Function

Setting Format
b = setfont(ErrMsg ‖ ValueSets ‖ NumberPad ‖ UserBar ‖ Notes ‖ All, font_name, font_sizeʃ, bold, italicsʅ);
Resetting Format
b = setfont(ErrMsg ‖ ValueSets ‖ NumberPad UserBar ‖ Notes ‖ All, default);
Description
In a data entry application, the setfont function allows you to modify the font that CSPro uses to display text in:
  • ErrMsg: The font that appears in boxes generated by the errmsg function.
  • ValueSets: The font that appears in capture type popup windows (other than the number pad).
  • NumberPad: The font that is used by the number pad.
  • UserBar: The font that appears in buttons and text strings on the userbar.
  • Notes: The font that appears when a user edits a field note.
  • All: The font is changed for all of the four above entities.
The font is changed to the font indicated by the string expression font_name and the numeric expression font_size, or if the resetting format is used, the font is restored to CSPro's default font selection. The user must ensure that the desired font is installed on the machine that will run the data entry application. Optional bold and italics markers may be indicated. Calls to this function are ignored when executed on mobile devices.
Return Value
The function returns 1 (true) if the font(s) were changed successfully, and 0 (false) otherwise.
Example
function majorError(string message)

   
setfont(ErrMsg, "Arial", 24, bold, italics);
   
errmsg("%s", message);

end;

function minorError(string message)

   
setfont(ErrMsg, "Arial", 12, bold);
   
errmsg("%s", message);

end;

function minorWarning(string message)

   
setfont(ErrMsg, "Arial", 12, italics);
   
errmsg("%s", message);

end;


PROC AGE

   
if AGE > 95 then
        minorWarning(
maketext("Age (%d) is over 95, set to 95", AGE));
        AGE = 
95;

   
elseif not AGE in 12:95 then
        minorError(
maketext("Age (%d) is invalid for this survey, reenter", AGE));
       
reenter;

   
endif;
See also: Set ErrMsg Statement, SetValueSets Function