00001 /*======================================================================= 00002 * Copyright 1991-1996, Silicon Graphics, Inc. 00003 * ALL RIGHTS RESERVED 00004 * 00005 * UNPUBLISHED -- Rights reserved under the copyright laws of the United 00006 * States. Use of a copyright notice is precautionary only and does not 00007 * imply publication or disclosure. 00008 * 00009 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND: 00010 * Use, duplication or disclosure by the Government is subject to restrictions 00011 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights 00012 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or 00013 * in similar or successor clauses in the FAR, or the DOD or NASA FAR 00014 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc., 00015 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311. 00016 * 00017 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY 00018 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION, 00019 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY 00020 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON 00021 * GRAPHICS, INC. 00022 **=======================================================================*/ 00023 /*======================================================================= 00024 ** Author : Thad Beier (MMM yyyy) 00025 ** Modified by : Gavin Bell (MMM yyyy) 00026 **=======================================================================*/ 00027 /*======================================================================= 00028 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00029 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00030 *** *** 00031 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00032 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00033 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00034 *** *** 00035 *** RESTRICTED RIGHTS LEGEND *** 00036 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00037 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00038 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00039 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00040 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00041 *** *** 00042 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, *** 00043 *** BORDEAUX, FRANCE *** 00044 *** ALL RIGHTS RESERVED *** 00045 **=======================================================================*/ 00046 /*======================================================================= 00047 ** Modified by : TGS (Dec 2004) 00048 ** Modified by : MCS (Mmm YYYY) 00049 ** Modified by : VSG (Mmm YYYY) 00050 **=======================================================================*/ 00051 00052 00053 00054 00055 #ifndef _SO_FONT_ 00056 #define _SO_FONT_ 00057 00058 #include <Inventor/fields/SoSFBool.h> 00059 #include <Inventor/fields/SoSFEnum.h> 00060 #include <Inventor/fields/SoSFFloat.h> 00061 #include <Inventor/fields/SoSFName.h> 00062 #include <Inventor/fields/SoSFString.h> 00063 #include <Inventor/nodes/SoNode.h> 00064 00308 class SoFont : public SoNode { 00309 00310 SO_NODE_HEADER(SoFont); 00311 00312 public: 00313 // Fields 00321 //SoSFName name; 00322 SoSFString name; 00323 00329 SoSFFloat size; 00330 00332 enum RenderStyle { 00334 POLYGON, 00338 TEXTURE, 00344 TEXTURE_DELAYED, 00346 POLYGON_AND_OUTLINE 00347 }; 00348 00355 SoSFEnum renderStyle; 00356 00360 SoFont(); 00361 00374 static void enableJapaneseSF(SbBool flag = TRUE); 00375 00381 static SbBool isJapaneseSFEnabled() ; 00382 00396 static void setNumFontCaches(int maxNumCaches); 00397 00401 static int getNumFontCaches(); 00402 00406 static int getCurrNumFontCaches(); 00407 00418 static int getAvailableFonts(SbString*& strings, SbBool clearDB = FALSE); 00419 00428 SoNONUNICODE static void setFontPaths(char*); 00429 00436 static void setFontPaths( const SbString& ); 00437 00445 SoNONUNICODE static void addFontPaths(char*); 00446 00452 static void addFontPaths( const SbString& ); 00453 00457 static SbString getFontPaths(); 00458 00467 SoNONUNICODE static SbBool isAvailableFont(char* ); 00468 00475 static SbBool isAvailableFont(const SbString& ); 00476 00480 static void clearFontNameCache(); 00481 00486 inline virtual void setOverride(const SbBool state) 00487 { override.setValue(state); } 00488 00492 inline virtual SbBool isOverride() const 00493 { return override.getValue(); } 00494 00495 #if 1 SoDEPRECATED 00498 static void enableTGSJapaneseSF(SbBool flag = TRUE); 00499 SoDEPRECATED 00501 static SbBool isTGSJapaneseSFEnabled(); 00502 00503 #endif 00505 #if 1 SoDEPRECATED 00508 static void enableMCSJapaneseSF(SbBool flag = TRUE); 00509 SoDEPRECATED 00511 static SbBool isMCSJapaneseSFEnabled(); 00512 00513 #endif 00515 private: 00516 virtual void doAction(SoAction *action); 00517 virtual void GLRender(SoGLRenderAction *action); 00518 virtual void callback(SoCallbackAction *action); 00519 virtual void pick(SoPickAction *action); 00520 virtual void getBoundingBox(SoGetBoundingBoxAction *action); 00521 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action); 00522 00523 private: 00524 static void initClass(); 00525 static void exitClass(); 00526 00527 SoSFBool override; 00528 00529 private: 00530 virtual ~SoFont(); 00531 00532 // TRUE by default 00533 static SbBool m_isJapaneseSFEnabled; 00534 00535 }; 00536 00537 #endif /* _SO_FONT_ */ 00538 00539