Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoFont.h
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : Thad Beier (MMM yyyy)
25** Modified by : Gavin Bell (MMM yyyy)
26**=======================================================================*/
27/*=======================================================================
28 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
29 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
30 *** ***
31 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
32 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
33 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
34 *** ***
35 *** RESTRICTED RIGHTS LEGEND ***
36 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
37 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
38 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
39 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
40 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
41 *** ***
42 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, ***
43 *** BORDEAUX, FRANCE ***
44 *** ALL RIGHTS RESERVED ***
45**=======================================================================*/
46/*=======================================================================
47** Modified by : TGS (Dec 2004)
48** Modified by : MCS (Mmm YYYY)
49** Modified by : VSG (Mmm YYYY)
50**=======================================================================*/
51
52
53
54
55#ifndef _SO_FONT_
56#define _SO_FONT_
57
58#include <Inventor/fields/SoSFBool.h>
59#include <Inventor/fields/SoSFEnum.h>
60#include <Inventor/fields/SoSFFloat.h>
61#include <Inventor/fields/SoSFName.h>
62#include <Inventor/fields/SoSFString.h>
63#include <Inventor/nodes/SoNode.h>
64
303class SoFont : public SoNode {
304
305 SO_NODE_HEADER(SoFont);
306
307 public:
308 // Fields
316 //SoSFName name;
318
325
343
351
356
369 static void enableJapaneseSF(SbBool flag = TRUE);
370
377
391 static void setNumFontCaches(int maxNumCaches);
392
396 static int getNumFontCaches();
397
402
413 static int getAvailableFonts(SbString*& strings, SbBool clearDB = FALSE);
414
423 SoNONUNICODE static void setFontPaths(char*);
424
431 static void setFontPaths( const SbString& );
432
440 SoNONUNICODE static void addFontPaths(char*);
441
447 static void addFontPaths( const SbString& );
448
453
462 SoNONUNICODE static SbBool isAvailableFont(char* );
463
471
475 static void clearFontNameCache();
476
481 inline virtual void setOverride(const SbBool state)
482 { override.setValue(state); }
483
487 inline virtual SbBool isOverride() const
488 { return override.getValue(); }
489
490private:
491 virtual void doAction(SoAction *action);
492 virtual void GLRender(SoGLRenderAction *action);
493 virtual void callback(SoCallbackAction *action);
494 virtual void pick(SoPickAction *action);
495 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
496 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action);
497
498 private:
499 static void initClass();
500 static void exitClass();
501
502 SoSFBool override;
503
504 private:
505 virtual ~SoFont();
506
507 // TRUE by default
508 static SbBool s_isJapaneseSFEnabled;
509
510};
511
512#endif /* _SO_FONT_ */
513
Class for smart character strings.
Definition SbString.h:202
Abstract base class for all actions.
Definition SoAction.h:132
Performs a generic traversal of a scene graph or path.
Node that defines font name, size, and type for text.
Definition SoFont.h:303
SoSFString name
This field specifies the font name.
Definition SoFont.h:317
static void setNumFontCaches(int maxNumCaches)
Sets the maximum number of caches that can be used for font rendering.
static int getCurrNumFontCaches()
Returns the current number of caches used for font rendering.
static SbBool isJapaneseSFEnabled()
Gets flag that indicates whether strings should be interpreted using the MCS Japanese MBCS encoding.
static SoNONUNICODE void setFontPaths(char *)
Specifies paths for searching for font files.
virtual SbBool isOverride() const
Returns the state of the override field.
Definition SoFont.h:487
static int getNumFontCaches()
Returns the maximum number of caches that can be used for font rendering.
virtual void setOverride(const SbBool state)
Set the state of the override field.
Definition SoFont.h:481
static SbBool isAvailableFont(const SbString &)
Returns TRUE if the specified font is available for use by Open Inventor.
SoSFFloat size
This field specifies the font size.
Definition SoFont.h:324
static SbString getFontPaths()
Gets current font path list.
SoSFEnum renderStyle
This field specifies the rendering style of the font.
Definition SoFont.h:350
static void setFontPaths(const SbString &)
Specifies paths for searching for font files.
static int getAvailableFonts(SbString *&strings, SbBool clearDB=FALSE)
Returns the number of loadable font files and a list of their names.
SoFont()
Creates a font node with default settings.
RenderStyle
Render style.
Definition SoFont.h:327
@ POLYGON_AND_OUTLINE
Render outlining font.
Definition SoFont.h:341
@ TEXTURE
Render font as texture objects.
Definition SoFont.h:333
@ POLYGON
Render font as polygonal objects.
Definition SoFont.h:329
@ TEXTURE_DELAYED
Render font as texture objects, but delay the rendering to prevent transparency artifacts,...
Definition SoFont.h:339
static void clearFontNameCache()
Clears the Open Inventor internal font name cache, i.e., the list of available fonts.
static SoNONUNICODE void addFontPaths(char *)
Specifies paths for searching for font files.
static void addFontPaths(const SbString &)
Specifies paths for searching for font files.
static void enableJapaneseSF(SbBool flag=TRUE)
Sets flag to enable strings to be interpreted using the Japanese MBCS encoding.
static SoNONUNICODE SbBool isAvailableFont(char *)
Returns TRUE if the specified font is available for use by Open Inventor.
Renders a scene graph using Open Inventor's Render Engine.
Computes bounding box of a scene.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Counts number of...
Abstract base class for all database nodes.
Definition SoNode.h:145
Abstract base class for picking objects in a scene.
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing an enumerated value.
Definition SoSFEnum.h:89
Field containing a floating-point value.
Definition SoSFFloat.h:78
Field containing a string.
Definition SoSFString.h:117
int SbBool
Boolean type.
Definition SbBase.h:87