<CXP:BuildError/>

Compilation Error

Description: One or more errors occurred during the compilation of a resource required to build this page. Please review the following specific error details and modify your source code appropriately.

Files:

CXP File: C:\inetpub\wwwroot\webdoc-v2-standalone\v2\content\xppguide_h2_attributes_for_graphic_primitives.cxp
Intermediate Xbase++ Code: C:\inetpub\wwwroot\webdoc-v2-standalone\v2\content\cxp-application\xppguide_h2_attributes_for_graphic_primitives.cxp.20251016-13958935.dll

Message(s):

Compiler: error XBT0523: Length of input line exceeds input buffer length in Line 0
A single line of code which is broken down into several lines using the line continuation character (;) exceeds the limit of 20kB characters. This line must be split into several lines without line continuation, or blank spaces must be converted into tabs.

(No Source Code Location Determinable)

Build Process

The builder was invoked with the following parameters, the output is shown below.

Current Directory:
C:\Program Files (x86)\Alaska Software\cxp20\bin
Command:
C:\Program Files (x86)\Alaska Software\cxp20\bin\cxc-builder.exe
Parameters:
"@C:\inetpub\wwwroot\webdoc-v2-standalone\v2\content\cxp-application\xppguide_h2_attributes_for_graphic_primitives.cxp.20251016-13958935.lst"
Output:
c:\inetpub\wwwroot\webdoc-v2-standalone\v2\content\cxp-application\xppguide_h2_attributes_for_graphic_primitives.cxp.prg(0:0): error XBT0523: Length of input line exceeds input buffer length


Full Source

In the following the full source code of your resource is shown.

0001 <%#page implements="PageClass_1DF5B381AFB95FFC0A390DBCBF68F6D6C201FE35" layout="/layouts/content-h2.layout" %>
0002
0003 @SECTION meta-title
0004 <title>Attributes for graphic primitives</title>
0005
0006 @SECTION meta-description
0007 <meta name="description" content="Attributes are set before drawing in order to modify the output of graphic primitives." />
0008
0009 @SECTION menu-sidebar
0010 <div id="sidebar-menu-placeholder"><div class="ui blue inverted left vertical menu sidebar mobile only" id="sidebar-menu">
0011    <div class="item" id="wdg-sidebar-left-menu">
0012     <div class="header" >xppguide</div>
0013     <div class="menu" >
0014      <a class="item"  href="xppguide_h1_the_xbaseop_plusop_plus_graphics_engine_gra.cxp">The Xbase++ Graphics Engine (GRA)</a><a class="item"  href="xppguide_h2_basics_for_graphic_output.cxp">Basics for graphic output</a><a class="item"  href="xppguide_h2_graphic_primitives.cxp">Graphic primitives</a><a class="item active"  href="xppguide_h2_attributes_for_graphic_primitives.cxp">Attributes for graphic primitives</a><a class="item"  href="xppguide_h2_graphic_segments.cxp">Graphic segments</a><a class="item"  href="xppguide_h2_graphic_paths.cxp">Graphic paths</a><a class="item"  href="xppguide_h2_graphic_transformations_and_raster_operations.cxp">Graphic transformations and raster operations</a>
0015     </div>
0016    </div>
0017   </div>
0018 </div>
0019
0020 @SECTION top-header
0021 <div class="ui huge center aligned dividing header" id="top-level-header">
0022  <div class="content" id="wdg-top-level-title">
0023   <i class="compass icon" ></i>
0024 <span id="wdg-top-level-title-header">Programming Guide:xppguide</span>
0025  </div>
0026 </div>
0027
0028 @SECTION left-menu
0029 <div class="ui vertical accordion inverted orange fluid menu" id="wgd-left-menu">
0030  <a class="item" href="xppguide_h1_the_xbaseop_plusop_plus_graphics_engine_gra.cxp" id="wgd-left-menu-parent">
0031   <div class="header" id="wgd-left-menu-parent-header">The Xbase++ Graphics Engine (GRA)</div>
0032     </a>
0033 <a class="item"  href="xppguide_h2_basics_for_graphic_output.cxp">Basics for graphic output</a><a class="item"  href="xppguide_h2_graphic_primitives.cxp">Graphic primitives</a><a class="item active"  href="xppguide_h2_attributes_for_graphic_primitives.cxp">Attributes for graphic primitives</a><a class="item"  href="xppguide_h2_graphic_segments.cxp">Graphic segments</a><a class="item"  href="xppguide_h2_graphic_paths.cxp">Graphic paths</a><a class="item"  href="xppguide_h2_graphic_transformations_and_raster_operations.cxp">Graphic transformations and raster operations</a>
0034 </div>
0035
0036 @SECTION breadcrumbs
0037 <a class="link item" href="bc_programming_guide.cxp" >
0038 <i class="compass icon" ></i>
0039 <span>Programming Guide</span>
0040 </a>
0041 <i class="right angle icon divider"></i>
0042 <a class="link item" href="bc_programming_guide.cxp" >
0043 <i class="compass icon" ></i>
0044 <span>xppguide</span>
0045 </a>
0046 <i class="right angle icon divider" ></i>
0047 <a class="link item" href="xppguide_h1_the_xbaseop_plusop_plus_graphics_engine_gra.cxp" >
0048 <i class="compass icon" ></i>
0049 <span>The Xbase++ Graphics Engine (GRA)</span>
0050   <!-- go to contentPageHeading1-->
0051 </a>
0052 <i class="right angle icon divider"></i>
0053 <span class="item" >
0054 <i class="compass icon" ></i>
0055 <span>Attributes for graphic primitives</span>
0056 </span>
0057
0058 @SECTION name
0059 <span>Attributes for graphic primitives</span>
0060
0061 @SECTION feature
0062 <a class="bg-blue ui tag label" href="/document-conventions.cxp#FeatureGrades" id="wdg-feature">Foundation</a>
0063
0064 @SECTION body
0065 <div id="wdg-central-column">
0066  <div id="wdg-segment">
0067   <div class="ui vertical basic segment">
0068    <div>
0069     <p>Attributes are set before drawing in order to modify the output of graphic primitives. These settings are valid until they are reset. For example, colors, line types and fill patterns for areas can be defined. The number of attributes differs for different graphic primitives. Attributes are defined in the form of an attribute array whose size and elements are determined using constants defined in the GRA.CH file. Also, the values that are entered in the elements of the attribute array are represented using #define constants. The basic procedure for changing attributes of graphic primitives is shown in the following code: </p>
0070     <p><figure class="code-block-segment" >
0071        <div class="code-block">
0072         <pre><code  class="language-xpp">aAttribute := Array( GRA_AL_COUNT )       // create empty attribute 
0073 // array for lines 
0074
0075 aAttribute[ GRA_AL_TYPE ]  := GRA_LINETYPE_SHORTDASH 
0076 aAttribute[ GRA_AL_COLOR ] := GRA_CLR_RED // select line type &quot;short 
0077 // dash&quot; and the color red 
0078
0079 GraSetAttrLine( , aAttribute )            // set line attributes 
0080 </code></pre>
0081        </div>
0082       </figure></p>
0083     <p>This code illustrates the naming convention used by the GRA engine for the #define constants. All the constants begin with the prefix GRA_. Generally another prefix is also included to identify the group of GRA_ constants and a suffix is included at the end which uniquely defines the constant. Attributes can be set for markers, lines, areas and character strings. Thus, there are four possible attribute arrays that are created using the four constants: </p>
0084     <p><figure class="code-block-segment" >
0085        <div class="code-block">
0086         <pre><code  class="language-xpp">aAttrMarker := Array( GRA_AM_COUNT ) // attribute array for markers 
0087 aAttrLine   := Array( GRA_AL_COUNT ) // attribute array for lines 
0088 aAttrArea   := Array( GRA_AA_COUNT ) // attribute array for areas 
0089 aAttrString := Array( GRA_AS_COUNT ) // attribute array for string 
0090 </code></pre>
0091        </div>
0092       </figure></p>
0093     <p>The letters AM, AL, AA and AS are abbreviations for &quot;attribute marker&quot;, &quot;attribute line&quot;, &quot;attribute area&quot; and &quot;attribute string&quot;. Each element of an attribute array defines a specific attribute. An element is identified by a #define constant which is prefixed by the attribute array prefix such as GRA_AM_, GRA_AL_, GRA_AA_ or GRA_AS_. An attribute is set by assigning a value to the appropriate element in the attribute array. For each attribute there is only a limited number of valid values which are again used in the form of #define constants. </p>
0094     <p><figure class="code-block-segment" >
0095        <div class="code-block">
0096         <pre><code  class="language-xpp">aAttribute[ GRA_AL_TYPE ] := GRA_LINETYPE_SHORTDASH 
0097 </code></pre>
0098        </div>
0099       </figure></p>
0100     <p>In this line of code, the attribute &quot;line type&quot; receives the value for a short dashed line. Valid values for line types (more precisely, for the attribute GRA_AL_TYPE) are constants that are prefixed with GRA_LINETYPE_. For each attribute there is a group of #define constants like this that can be assigned as the value for the attribute. </p>
0101     <p>Attributes are defined for a presentation space and therefore the attribute array must be passed to the presentation space after the attribute is inserted into the array. Only then are the attributes actually set and used for the graphic primitives during drawing. The functions used to assign the attribute arrays to the presentation space are listed in the following table. </p>
0102     <p><div class="ui vertical basic segment wdg-table-with-notes">
0103        <div class="ui small header wdg-table-header">Functions for attributes of graphic primitives</div>
0104        <table class="ui stackable table wdg-table-table">
0105         <thead class="wdg-table-thead">
0106          <tr class="wdg-table-thead-tr">
0107           <th class="wdg-table-thead-th">Function</th>
0108           <th class="wdg-table-thead-th">Description</th>
0109          </tr>
0110         </thead>
0111         <tbody class="wdg-table-tbody">
0112          <tr class="wdg-table-tbody-tr">
0113           <td class="wdg-table-tbody-td">GraSetAttrMarker()</td>
0114           <td class="wdg-table-tbody-td">Sets attributes for markers</td>
0115          </tr>
0116          <tr class="wdg-table-tbody-tr">
0117           <td class="wdg-table-tbody-td">GraSetAttrLine()</td>
0118           <td class="wdg-table-tbody-td">Sets attributes for lines</td>
0119          </tr>
0120          <tr class="wdg-table-tbody-tr">
0121           <td class="wdg-table-tbody-td">GraSetAttrArea()</td>
0122           <td class="wdg-table-tbody-td">Sets attributes for areas</td>
0123          </tr>
0124          <tr class="wdg-table-tbody-tr">
0125           <td class="wdg-table-tbody-td">GraSetAttrString()</td>
0126           <td class="wdg-table-tbody-td">Sets attributes for character strings</td>
0127          </tr>
0128          <tr class="wdg-table-tbody-tr">
0129           <td class="wdg-table-tbody-td">GraSetColor()</td>
0130           <td class="wdg-table-tbody-td">Sets colors for all graphic primitives</td>
0131          </tr>
0132          <tr class="wdg-table-tbody-tr">
0133           <td class="wdg-table-tbody-td">GraSetFont()</td>
0134           <td class="wdg-table-tbody-td">Sets font for graphic output of characters</td>
0135          </tr>
0136         </tbody>
0137        </table>
0138       </div></p>
0139     <p>The GraSetAttr..() functions pass an attribute array to a presentation space. </p><div class="ui blue icon message" >
0140       <i class="icon info circle"></i>
0141       <div class="content">
0142        <p> These functions are coded in the GRASYS.PRG file. They call corresponding methods of an XbpPresSpace object. </p>
0143       </div>
0144      </div><p>The attributes set for markers are used by the graphic primitive GraMarker(). The attributes for lines are used by GraLine() and GraSpline(). They are also used by GraArc() and GraBox() when a circle or a rectangle is drawn with a border (the border is a line). If a circle or a rectangle is to be filled with a pattern, the attributes for areas are used. These are defined by GraSetAttrArea(). The graphic primitives GraArc() and GraBox() use line attributes as well as area attributes. Attributes for character strings are used exclusively by GraStringAt(). The following tables give an overview of the attributes that can be set for markers, lines, areas and character strings. </p>
0145     <p><div class="ui vertical basic segment wdg-table-with-notes">
0146        <div class="ui small header wdg-table-header">#define constants for the attribute array for markers - GraSetAttrMarker()</div>
0147        <table class="ui stackable table wdg-table-table">
0148         <thead class="wdg-table-thead">
0149          <tr class="wdg-table-thead-tr">
0150           <th class="wdg-table-thead-th">Array element</th>
0151           <th class="wdg-table-thead-th">#define | value</th>
0152           <th class="wdg-table-thead-th">Description</th>
0153          </tr>
0154         </thead>
0155         <tbody class="wdg-table-tbody">
0156          <tr class="wdg-table-tbody-tr">
0157           <td class="wdg-table-tbody-td">GRA_AM_COLOR </td>
0158           <td class="wdg-table-tbody-td">GRA_CLR_*</td>
0159           <td class="wdg-table-tbody-td">Foreground color</td>
0160          </tr>
0161          <tr class="wdg-table-tbody-tr">
0162           <td class="wdg-table-tbody-td">GRA_AM_BACKCOLOR</td>
0163           <td class="wdg-table-tbody-td">GRA_CLR_*</td>
0164           <td class="wdg-table-tbody-td">Background color</td>
0165          </tr>
0166          <tr class="wdg-table-tbody-tr">
0167           <td class="wdg-table-tbody-td">GRA_AM_MIXMODE</td>
0168           <td class="wdg-table-tbody-td">GRA_FGMIX_*</td>
0169           <td class="wdg-table-tbody-td">Mix attribute for foreground color</td>
0170          </tr>
0171          <tr class="wdg-table-tbody-tr">
0172           <td class="wdg-table-tbody-td">GRA_AM_BGMIXMODE</td>
0173           <td class="wdg-table-tbody-td">GRA_BGMIX_*</td>
0174           <td class="wdg-table-tbody-td">Mix attribute for background color</td>
0175          </tr>
0176          <tr class="wdg-table-tbody-tr">
0177           <td class="wdg-table-tbody-td">GRA_AM_SYMBOL</td>
0178           <td class="wdg-table-tbody-td">GRA_MARKSYM_*</td>
0179           <td class="wdg-table-tbody-td">Marker symbol</td>
0180          </tr>
0181          <tr class="wdg-table-tbody-tr">
0182           <td class="wdg-table-tbody-td">GRA_AM_BOX</td>
0183           <td class="wdg-table-tbody-td">{nXsize, nYsize}</td>
0184           <td class="wdg-table-tbody-td">Size of the marker symbol</td>
0185          </tr>
0186         </tbody>
0187        </table>
0188       </div></p>
0189     <p><div class="ui vertical basic segment wdg-table-with-notes">
0190        <div class="ui small header wdg-table-header">#define constants for the attribute array for lines - GraSetAttrLine()</div>
0191        <table class="ui stackable table wdg-table-table">
0192         <thead class="wdg-table-thead">
0193          <tr class="wdg-table-thead-tr">
0194           <th class="wdg-table-thead-th">Array element</th>
0195           <th class="wdg-table-thead-th">#define group</th>
0196           <th class="wdg-table-thead-th">Description</th>
0197          </tr>
0198         </thead>
0199         <tbody class="wdg-table-tbody">
0200          <tr class="wdg-table-tbody-tr">
0201           <td class="wdg-table-tbody-td">GRA_AL_COLOR</td>
0202           <td class="wdg-table-tbody-td">GRA_CLR_*</td>
0203           <td class="wdg-table-tbody-td">Foreground color</td>
0204          </tr>
0205          <tr class="wdg-table-tbody-tr">
0206           <td class="wdg-table-tbody-td">GRA_AL_MIXMODE</td>
0207           <td class="wdg-table-tbody-td">GRA_FGMIX_*</td>
0208           <td class="wdg-table-tbody-td">Mix attribute for foreground color</td>
0209          </tr>
0210          <tr class="wdg-table-tbody-tr">
0211           <td class="wdg-table-tbody-td">GRA_AL_WIDTH</td>
0212           <td class="wdg-table-tbody-td">GRA_LINEWIDTH_*</td>
0213           <td class="wdg-table-tbody-td">Line width</td>
0214          </tr>
0215          <tr class="wdg-table-tbody-tr">
0216           <td class="wdg-table-tbody-td">GRA_AL_TYPE</td>
0217           <td class="wdg-table-tbody-td">GRA_LINETYPE_*</td>
0218           <td class="wdg-table-tbody-td">Line type</td>
0219          </tr>
0220         </tbody>
0221        </table>
0222       </div></p>
0223     <p><div class="ui vertical basic segment wdg-table-with-notes">
0224        <div class="ui small header wdg-table-header">#define constants for the attribute array for areas - GraSetAttrArea()</div>
0225        <table class="ui stackable table wdg-table-table">
0226         <thead class="wdg-table-thead">
0227          <tr class="wdg-table-thead-tr">
0228           <th class="wdg-table-thead-th">Array element</th>
0229           <th class="wdg-table-thead-th">#define | value</th>
0230           <th class="wdg-table-thead-th">Description</th>
0231          </tr>
0232         </thead>
0233         <tbody class="wdg-table-tbody">
0234          <tr class="wdg-table-tbody-tr">
0235           <td class="wdg-table-tbody-td">GRA_AA_COLOR</td>
0236           <td class="wdg-table-tbody-td">GRA_CLR_*</td>
0237           <td class="wdg-table-tbody-td">Foreground color</td>
0238          </tr>
0239          <tr class="wdg-table-tbody-tr">
0240           <td class="wdg-table-tbody-td">GRA_AA_BACKCOLOR</td>
0241           <td class="wdg-table-tbody-td">GRA_CLR_*</td>
0242           <td class="wdg-table-tbody-td">Background color</td>
0243          </tr>
0244          <tr class="wdg-table-tbody-tr">
0245           <td class="wdg-table-tbody-td">GRA_AA_MIXMODE</td>
0246           <td class="wdg-table-tbody-td">GRA_FGMIX_*</td>
0247           <td class="wdg-table-tbody-td">Mix attribute for foreground color</td>
0248          </tr>
0249          <tr class="wdg-table-tbody-tr">
0250           <td class="wdg-table-tbody-td">GRA_AA_BGMIXMODE</td>
0251           <td class="wdg-table-tbody-td">GRA_BGMIX_*</td>
0252           <td class="wdg-table-tbody-td">Mix attribute for background color</td>
0253          </tr>
0254          <tr class="wdg-table-tbody-tr">
0255           <td class="wdg-table-tbody-td">GRA_AA_SYMBOL</td>
0256           <td class="wdg-table-tbody-td">GRA_SYM_*</td>
0257           <td class="wdg-table-tbody-td">Fill pattern for areas</td>
0258          </tr>
0259         </tbody>
0260        </table>
0261       </div></p>
0262     <p><div class="ui vertical basic segment wdg-table-with-notes">
0263        <div class="ui small header wdg-table-header">#define constants for the attribute arrays for character strings</div>
0264        <table class="ui stackable table wdg-table-table">
0265         <thead class="wdg-table-thead">
0266          <tr class="wdg-table-thead-tr">
0267           <th class="wdg-table-thead-th">Array element</th>
0268           <th class="wdg-table-thead-th">#define | value</th>
0269           <th class="wdg-table-thead-th">Description</th>
0270          </tr>
0271         </thead>
0272         <tbody class="wdg-table-tbody">
0273          <tr class="wdg-table-tbody-tr">
0274           <td class="wdg-table-tbody-td">GRA_AS_COLOR </td>
0275           <td class="wdg-table-tbody-td">GRA_CLR_*</td>
0276           <td class="wdg-table-tbody-td">Foreground color</td>
0277          </tr>
0278          <tr class="wdg-table-tbody-tr">
0279           <td class="wdg-table-tbody-td">GRA_AS_BACKCOLOR</td>
0280           <td class="wdg-table-tbody-td">GRA_CLR_*</td>
0281           <td class="wdg-table-tbody-td">Background color</td>
0282          </tr>
0283          <tr class="wdg-table-tbody-tr">
0284           <td class="wdg-table-tbody-td">GRA_AS_MIXMODE</td>
0285           <td class="wdg-table-tbody-td">GRA_FGMIX_*</td>
0286           <td class="wdg-table-tbody-td">Mix attribute for foreground color</td>
0287          </tr>
0288          <tr class="wdg-table-tbody-tr">
0289           <td class="wdg-table-tbody-td">GRA_AS_BGMIXMODE</td>
0290           <td class="wdg-table-tbody-td">GRA_BGMIX_*</td>
0291           <td class="wdg-table-tbody-td">Mix attribute for background color</td>
0292          </tr>
0293          <tr class="wdg-table-tbody-tr">
0294           <td class="wdg-table-tbody-td">GRA_AS_BOX</td>
0295           <td class="wdg-table-tbody-td">{nXsize,nYsize}</td>
0296           <td class="wdg-table-tbody-td">Size of each character</td>
0297          </tr>
0298          <tr class="wdg-table-tbody-tr">
0299           <td class="wdg-table-tbody-td">GRA_AS_ANGLE</td>
0300           <td class="wdg-table-tbody-td">{nX,nY}</td>
0301           <td class="wdg-table-tbody-td">Output angle of character strings</td>
0302          </tr>
0303          <tr class="wdg-table-tbody-tr">
0304           <td class="wdg-table-tbody-td">GRA_AS_SHEAR</td>
0305           <td class="wdg-table-tbody-td">{nX,nY}</td>
0306           <td class="wdg-table-tbody-td">Shear of characters (italics)</td>
0307          </tr>
0308          <tr class="wdg-table-tbody-tr">
0309           <td class="wdg-table-tbody-td">GRA_AS_DIRECTION</td>
0310           <td class="wdg-table-tbody-td">GRA_CHDIRN_*</td>
0311           <td class="wdg-table-tbody-td">Write direction</td>
0312          </tr>
0313          <tr class="wdg-table-tbody-tr">
0314           <td class="wdg-table-tbody-td">GRA_AS_HORIZALIGN</td>
0315           <td class="wdg-table-tbody-td">GRA_HALIGN_*</td>
0316           <td class="wdg-table-tbody-td">Horizontal alignment</td>
0317          </tr>
0318          <tr class="wdg-table-tbody-tr">
0319           <td class="wdg-table-tbody-td">GRA_AS_VERTALIGN</td>
0320           <td class="wdg-table-tbody-td">GRA_VALIGN_*</td>
0321           <td class="wdg-table-tbody-td">Vertical alignment</td>
0322          </tr>
0323          <tr class="wdg-table-tbody-tr">
0324           <td class="wdg-table-tbody-td">GRA_AS_EXTRA</td>
0325           <td class="wdg-table-tbody-td">nExtra</td>
0326           <td class="wdg-table-tbody-td">Distance between characters in character strings</td>
0327          </tr>
0328          <tr class="wdg-table-tbody-tr">
0329           <td class="wdg-table-tbody-td">GRA_AS_BREAK_EXTRA</td>
0330           <td class="wdg-table-tbody-td">nBreakExtra</td>
0331           <td class="wdg-table-tbody-td">Distance between words</td>
0332          </tr>
0333         </tbody>
0334        </table>
0335       </div></p>
0336     <p><span class="bold">Colors for graphic primitives</span></p>
0337     <p>The function GraSetColor() defines the foreground and background color for the graphic primitives of the GRA engine. Colors defined using the function SetColor() are valid only for display in text mode and in hybrid mode. The GraSetAttr..() functions can individually set colors for markers, lines, areas and character strings that are then used instead of the globally defined colors. With the exception of lines, graphic primitives have a foreground and a background color. Lines have only a foreground color. The background color is not generally visible. It is used when displaying characters, which are always surrounded by a rectangle. The rectangle surrounding each character is drawn in the background color and the character itself (the letter) is displayed in the foreground color. The mix attribute for the background color must be defined in order to make the background color visible. Color mix attributes can be defined for the foreground color as well as for the background color. They determine how the colors of graphic primitives are mixed with each other when the output of a graphic primitive covers an already existing drawing. </p><div class="ui basic center aligned segment wdg-centered-image">
0338       <div class="ui image image-content">
0339        <img class="wdg-centered-image-img"
0340                  src="./images/img_xppguide_mixmode2.gif"/>
0341        <div class="ui bottom attached header image-title wdg-centered-image-title">Mix of foreground and background colors</div>
0342       </div>
0343      </div><p>In this illustration, the circles are drawn first. The mix attribute for the foreground color is changed from GRA_FGMIX_OVERPAINT (the default value, that causes the new primitive to cover the old) to GRA_FGMIX_OR prior to display of the lower square. When this mix attribute is set, the foreground color of the square is mixed with the foreground color of the existing drawing. When GRA_FGMIX_OR is set, the mix occurs using a bitwise OR between the color values of the existing colors and the colors of the new graphic being drawn. The area where the circle and square are combined is visible in the mix color and this section appears somewhat lighter than the rest of the circle. The color of the rest of the square in the illustration is the result of the color mix between dark gray (square) and pale gray (window color). </p>
0344     <p>In the right part of the illustration, character strings are drawn over a circle. Within the circle, the background color for characters is visible. It causes the fill pattern of the circle to appear lighter. In this case, the mix color is a result of the value GRA_BGMIX_OR for the mix attribute of the background color of GraStringAt(). By default the mix attributes are set so that the foreground color paints over everything already displayed (GRA_FGMIX_OVERPAINT) and the background color remains unaffected (GRA_BGMIX_LEAVEALONE). The mix attribute for the foreground color is always significant when graphic primitives overlap each other and the shared section is to remain visible. When character strings are displayed, the mix attribute for the background color should also be considered, since both the foreground color (letter) and the background color (the rectangle which surrounds a letter) are shown. </p>
0345     <p>A special value for the color mix attribute for foreground colors is GRA_FGMIX_XOR. The result of displaying graphic primitives when this value is set is that the graphic primitives are deleted from the screen if they are drawn at the same location a second time. Also, the resulting mix color of a graphic primitive which paints over an existing drawing depends on the color of the existing drawing and the color of the graphic primitive. The following two tables list the constants that can be used for the mix attribute of the foreground color and the background color: </p>
0346     <p><div class="ui vertical basic segment wdg-table-with-notes">
0347        <div class="ui small header wdg-table-header">Mix attributes for foreground colors</div>
0348        <table class="ui stackable table wdg-table-table">
0349         <thead class="wdg-table-thead">
0350          <tr class="wdg-table-thead-tr">
0351           <th class="wdg-table-thead-th">Constant</th>
0352           <th class="wdg-table-thead-th">Description</th>
0353          </tr>
0354         </thead>
0355         <tbody class="wdg-table-tbody">
0356          <tr class="wdg-table-tbody-tr">
0357           <td class="wdg-table-tbody-td">GRA_FGMIX_OVERPAINT</td>
0358           <td class="wdg-table-tbody-td">Paints over existing colors</td>
0359          </tr>
0360          <tr class="wdg-table-tbody-tr">
0361           <td class="wdg-table-tbody-td">GRA_FGMIX_LEAVEALONE</td>
0362           <td class="wdg-table-tbody-td">Uses existing colors</td>
0363          </tr>
0364          <tr class="wdg-table-tbody-tr">
0365           <td class="wdg-table-tbody-td">GRA_FGMIX_OR</td>
0366           <td class="wdg-table-tbody-td">Mixes new and existing colors using bitwise OR of the color bits</td>
0367          </tr>
0368          <tr class="wdg-table-tbody-tr">
0369           <td class="wdg-table-tbody-td">GRA_FGMIX_XOR</td>
0370           <td class="wdg-table-tbody-td">Mixes new and existing colors using bitwise XOR of the color bits</td>
0371          </tr>
0372          <tr class="wdg-table-tbody-tr">
0373           <td class="wdg-table-tbody-td">GRA_FGMIX_AND</td>
0374           <td class="wdg-table-tbody-td">Mixes new and existing colors using bitwise AND of the color bits</td>
0375          </tr>
0376          <tr class="wdg-table-tbody-tr">
0377           <td class="wdg-table-tbody-td">GRA_FGMIX_NOTMERGESRC</td>
0378           <td class="wdg-table-tbody-td">Inverts mix color of GRA_FGMIX_OR</td>
0379          </tr>
0380          <tr class="wdg-table-tbody-tr">
0381           <td class="wdg-table-tbody-td">GRA_FGMIX_NOTMASKSRC</td>
0382           <td class="wdg-table-tbody-td">Inverts mix color of GRA_FGMIX_AND</td>
0383          </tr>
0384          <tr class="wdg-table-tbody-tr">
0385           <td class="wdg-table-tbody-td">GRA_FGMIX_NOTXORSRC</td>
0386           <td class="wdg-table-tbody-td">Inverts mix color of GRA_FGMIX_XOR</td>
0387          </tr>
0388          <tr class="wdg-table-tbody-tr">
0389           <td class="wdg-table-tbody-td">GRA_FGMIX_INVERT</td>
0390           <td class="wdg-table-tbody-td">Inverts existing color</td>
0391          </tr>
0392          <tr class="wdg-table-tbody-tr">
0393           <td class="wdg-table-tbody-td">GRA_FGMIX_NOTCOPYSRC</td>
0394           <td class="wdg-table-tbody-td">Inverts new color</td>
0395          </tr>
0396          <tr class="wdg-table-tbody-tr">
0397           <td class="wdg-table-tbody-td">GRA_FGMIX_SUBTRACT</td>
0398           <td class="wdg-table-tbody-td">Inverts new color and mixes it with existing color using bitwise AND of the color bits</td>
0399          </tr>
0400          <tr class="wdg-table-tbody-tr">
0401           <td class="wdg-table-tbody-td">GRA_FGMIX_MERGENOTSRC</td>
0402           <td class="wdg-table-tbody-td">Inverts new color and mixes it with existing color using bitwise OR of the color bits</td>
0403          </tr>
0404          <tr class="wdg-table-tbody-tr">
0405           <td class="wdg-table-tbody-td">GRA_FGMIX_MASKSRCNOT</td>
0406           <td class="wdg-table-tbody-td">Inverts existing color and mixes it with new color using bitwise AND of the color bits</td>
0407          </tr>
0408          <tr class="wdg-table-tbody-tr">
0409           <td class="wdg-table-tbody-td">GRA_FGMIX_MERGESRCNOT</td>
0410           <td class="wdg-table-tbody-td">Inverts existing color and mixes it with new color using bitwise OR of the color bits</td>
0411          </tr>
0412          <tr class="wdg-table-tbody-tr">
0413           <td class="wdg-table-tbody-td">GRA_FGMIX_ZERO</td>
0414           <td class="wdg-table-tbody-td">Resulting color is black (all color bits are set to 0)</td>
0415          </tr>
0416          <tr class="wdg-table-tbody-tr">
0417           <td class="wdg-table-tbody-td">GRA_FGMIX_ONE</td>
0418           <td class="wdg-table-tbody-td">Resulting color is white (all color bits are set to 1)</td>
0419          </tr>
0420         </tbody>
0421        </table>
0422       </div></p>
0423     <p><div class="ui vertical basic segment wdg-table-with-notes">
0424        <div class="ui small header wdg-table-header">Mix attributes for background colors</div>
0425        <table class="ui stackable table wdg-table-table">
0426         <thead class="wdg-table-thead">
0427          <tr class="wdg-table-thead-tr">
0428           <th class="wdg-table-thead-th">Constant</th>
0429           <th class="wdg-table-thead-th">Description</th>
0430          </tr>
0431         </thead>
0432         <tbody class="wdg-table-tbody">
0433          <tr class="wdg-table-tbody-tr">
0434           <td class="wdg-table-tbody-td">GRA_BGMIX_OVERPAINT</td>
0435           <td class="wdg-table-tbody-td">Paints over existing colors</td>
0436          </tr>
0437          <tr class="wdg-table-tbody-tr">
0438           <td class="wdg-table-tbody-td">GRA_BGMIX_LEAVEALONE</td>
0439           <td class="wdg-table-tbody-td">Uses existing colors</td>
0440          </tr>
0441          <tr class="wdg-table-tbody-tr">
0442           <td class="wdg-table-tbody-td">GRA_BGMIX_OR</td>
0443           <td class="wdg-table-tbody-td">Mixes new and existing color using bitwise OR of the color bits</td>
0444          </tr>
0445          <tr class="wdg-table-tbody-tr">
0446           <td class="wdg-table-tbody-td">GRA_BGMIX_XOR</td>
0447           <td class="wdg-table-tbody-td">Mixes new and existing color using bitwise XOR of the color bits</td>
0448          </tr>
0449         </tbody>
0450        </table>
0451       </div></p>
0452     <p><span class="bold">Set font for characters</span></p>
0453     <p>The function GraSetFont(), along with GraSetAttrString(), affects the display of characters and character strings. GraSetFont() passes to a presentation space an XbpFont object defining the font for graphic display of characters. By default, the font &quot;System VIO&quot; is used. To change the font, an XbpFont object must be created and passed to the presentation space. The size can be defined when an XbpFont object is created (the size is in points). When an XbpFont object is created using XbpFont():new(), a font is not yet available, but is only loaded into memory by the method <span class="italic">:create()</span> (refer to the section <a  href="xppguide_h2_applications_in_graphics_mode_gui_mode.cxp#basics_of_xbase_parts">&quot;Basics of Xbase Parts&quot;</a> and the discussion of their life cycle). Also, an XbpFont object can only load fonts that are available as system fonts. A distinction must be made between fonts that are device dependent (for example, fonts only available for a printer) and those that are device independent. </p>
0454     <p>It is recommended that fonts be loaded using XbpFont():new() and then modifid using GraSetAttrString(). The attributes for character strings allow the creation of diverse font displays. This begins with the size of individual characters and includes the angle in which a character is displayed relative to the horizontal axis. </p>
0455     <p>Because of internal differences between XbpFont()and GraSetAttrString(), XbpFont() should be used only to load a font and GraSetAttrString() should be used to define the attributes for displaying characters. It should be noted that many attributes are valid only for vector fonts. A vector font is drawn as the outline of the letters using graphic primitives and then the outline is filled. A letter in a bitmap font consists of a raster image. Because of this, the characters of a bitmap font cannot be automatically converted to italics. In order to display the characters of a bitmap font in italics, a separate italic bitmap font is required. </p>
0456    </div>
0457   </div>
0458  </div>
0459 </div>
0460
0461 @SECTION feedback
0462 <a href="/feedback/feedback.cxp?bid=2515&amp;fid=Feature-Not-Available&amp;title=Attributes%20for%20graphic%20primitives"  rel="nofollow">this form</a>
0463
0464 @SECTION right-menu-go-to
0465 <div class="menu" id="wdg-goto-menu">
0466 <a class="item" href="#feedback" id="wdg-right-menu-feedback">Feedback</a>
0467 <a class="item" href="#end-of-page">End of page</a>
0468 </div>
0469