Jump to content

GpiSetCharSet: Difference between revisions

From EDM2
Created page with "This function sets the current value of the character-set attribute. ==Syntax== GpiSetCharSet(hps, llcid); ==Parameters== ;hps (HPS) - input :Presentation-space handle. ;llcid (LONG) - input :Character-set local identifier. :;LCID_DEFAULT ::Default (can be set explicitly with GpiSetDefAttrs). :;1-254 ::Identifies a logical font. ==Returns== ; rc (BOOL) - returns :Success indicator. :;TRUE ::Successful completion :;FALSE ::Error occurred. ==Errors== Possible re..."
 
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
This function sets the current value of the character-set attribute.  
This function sets the current value of the character-set attribute.


==Syntax==
==Syntax==
  GpiSetCharSet(hps, llcid);
  GpiSetCharSet(hps, llcid)


==Parameters==
==Parameters==
;hps (HPS) - input
;hps (HPS) - input:Presentation-space handle.
:Presentation-space handle.  
;llcid (LONG) - input:Character-set local identifier.
 
::LCID_DEFAULT - Default (can be set explicitly with [[GpiSetDefAttrs]]).
;llcid (LONG) - input
::1-254 - Identifies a logical font.
:Character-set local identifier.
:;LCID_DEFAULT
::Default (can be set explicitly with GpiSetDefAttrs).  
:;1-254
::Identifies a logical font.  


==Returns==
==Returns==
; rc (BOOL) - returns
;rc (BOOL) - returns:Success indicator.
:Success indicator.
::TRUE - Successful completion
:;TRUE
::FALSE - Error occurred.
::Successful completion  
:;FALSE
::Error occurred.


==Errors==
==Errors==
Possible returns from WinGetLastError
Possible returns from WinGetLastError:
;PMERR_INV_HPS (0x207F)
;PMERR_INV_HPS (0x207F):An invalid presentation-space handle was specified.
:An invalid presentation-space handle was specified.
;PMERR_PS_BUSY (0x20F4):An attempt was made to access the presentation space from more than one thread simultaneously.
;PMERR_PS_BUSY (0x20F4)
;PMERR_INV_CHAR_SET_ATTR (0x204F):An invalid character setid attribute value was specified or the default value was explicitly specified with GpiSetAttrs instead of using the defaults mask. ;PMERR_HUGE_FONTS_NOT_SUPPORTED (0x2035):An attempt was made using GpiSetCharSet, GpiSetPatternSet, GpiSetMarkerSet, or GpiSetAttrs to select a font that is larger than the maximum size (64Kb) supported by the target device driver.
:An attempt was made to access the presentation space from more than one thread simultaneously.  
;PMERR_INV_CHAR_SET_ATTR (0x204F)
:An invalid character setid attribute value was specified or the default value was explicitly specified with GpiSetAttrs instead of using the defaults mask. ;PMERR_HUGE_FONTS_NOT_SUPPORTED (0x2035)
:An attempt was made using GpiSetCharSet, GpiSetPatternSet, GpiSetMarkerSet, or GpiSetAttrs to select a font that is larger than the maximum size (64Kb) supported by the target device driver.  


==Remarks==
==Remarks==
This function must not be issued in an area bracket.
This function must not be issued in an area bracket.


The attribute mode (see GpiSetAttrMode) determines whether the current value of the character-set attribute is preserved.  
The attribute mode (see [[GpiSetAttrMode]]) determines whether the current value of the character-set attribute is preserved.
 
==Example Code==
==Example Code==
<pre>
<pre>
Line 48: Line 37:
rc = GpiSetCharSet(hps, llcid);
rc = GpiSetCharSet(hps, llcid);
</pre>
</pre>
This function sets the current value of the character-set attribute.
This function sets the current value of the character-set attribute.
<pre>  
<pre>  
#define INCL_GPIPRIMITIVES
#define INCL_GPIPRIMITIVES
#include <OS2.H>
#include <OS2.H>


 
HPS    hps;         /* Presentation space handle */
HPS    hps;   /* Presentation space handle     */
LONG   llcid = 32L;
LONG llcid = 32L;


GpiSetCharSet(hps, llcid);
GpiSetCharSet(hps, llcid);
</pre>
</pre>


Line 80: Line 65:
* GpiSetCharMode
* GpiSetCharMode
* GpiSetCharShear
* GpiSetCharShear
* GpiSetDefAttrs  
* GpiSetDefAttrs


==Graphic Elements and Orders==
==Graphic Elements and Orders==

Revision as of 11:01, 4 April 2025

This function sets the current value of the character-set attribute.

Syntax

GpiSetCharSet(hps, llcid)

Parameters

hps (HPS) - input
Presentation-space handle.
llcid (LONG) - input
Character-set local identifier.
LCID_DEFAULT - Default (can be set explicitly with GpiSetDefAttrs).
1-254 - Identifies a logical font.

Returns

rc (BOOL) - returns
Success indicator.
TRUE - Successful completion
FALSE - Error occurred.

Errors

Possible returns from WinGetLastError:

PMERR_INV_HPS (0x207F)
An invalid presentation-space handle was specified.
PMERR_PS_BUSY (0x20F4)
An attempt was made to access the presentation space from more than one thread simultaneously.
PMERR_INV_CHAR_SET_ATTR (0x204F)
An invalid character setid attribute value was specified or the default value was explicitly specified with GpiSetAttrs instead of using the defaults mask. ;PMERR_HUGE_FONTS_NOT_SUPPORTED (0x2035):An attempt was made using GpiSetCharSet, GpiSetPatternSet, GpiSetMarkerSet, or GpiSetAttrs to select a font that is larger than the maximum size (64Kb) supported by the target device driver.

Remarks

This function must not be issued in an area bracket.

The attribute mode (see GpiSetAttrMode) determines whether the current value of the character-set attribute is preserved.

Example Code

#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>

HPS     hps;    /*  Presentation-space handle. */
LONG    llcid;  /*  Character-set local identifier. */
BOOL    rc;     /*  Success indicator. */

rc = GpiSetCharSet(hps, llcid);

This function sets the current value of the character-set attribute.

 
#define INCL_GPIPRIMITIVES
#include <OS2.H>

HPS     hps;         /* Presentation space handle */
LONG    llcid = 32L;

GpiSetCharSet(hps, llcid);

Related Functions

  • GpiCharString
  • GpiCharStringAt
  • GpiCharStringPos
  • GpiCharStringPosAt
  • GpiCreateLogFont
  • GpiPop
  • GpiQueryCharSet
  • GpiQueryCharStringPos
  • GpiQueryCharStringPosAt
  • GpiSetAttrMode
  • GpiSetAttrs
  • GpiSetCharAngle
  • GpiSetCharBox
  • GpiSetCharDirection
  • GpiSetCharMode
  • GpiSetCharShear
  • GpiSetDefAttrs

Graphic Elements and Orders

Element Type: OCODE_GSCS

This element type is generated if the attribute mode (see GpiSetAttrMode) is set to AM_NOPRESERVE.

Order: Set Character Set

Element Type: OCODE_GPSCS

This element type is generated if the attribute mode is set to AM_PRESERVE.

Order: Push and Set Character Set