"Fossies" - the Fresh Open Source Software Archive

Member "yudit-3.0.7/swindow/SFontImpl.h" (7 Jun 2020, 2410 Bytes) of package /linux/misc/yudit-3.0.7.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "SFontImpl.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.0.5_vs_3.0.7.

    1 /** 
    2  *  Yudit Unicode Editor Source File
    3  *
    4  *  GNU Copyright (C) 1997-2006  Gaspar Sinai <gaspar@yudit.org>  
    5  *
    6  *  This program is free software; you can redistribute it and/or modify
    7  *  it under the terms of the GNU General Public License, version 2,
    8  *  dated June 1991. See file COPYYING for details.
    9  *
   10  *  This program is distributed in the hope that it will be useful,
   11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13  *  GNU General Public License for more details.
   14  *
   15  *  You should have received a copy of the GNU General Public License
   16  *  along with this program; if not, write to the Free Software
   17  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   18  */
   19  
   20 #ifndef SFontImpl_h
   21 #define SFontImpl_h
   22 
   23 #include "swindow/SCanvas.h"
   24 #include "swindow/SPen.h"
   25 
   26 #include "stoolkit/SMatrix.h"
   27 #include "stoolkit/SStringVector.h"
   28 #include "stoolkit/SProperties.h"
   29 #include "stoolkit/SObject.h"
   30 
   31 
   32 /**
   33  * @author: Gaspar Sinai <gaspar@yudit.org>
   34  * @version: 2000-04-23
   35  * This is the abstract widget toolkit font package
   36  */
   37 class SFontImpl : public SObject
   38 {
   39 public:
   40   SFontImpl (const SString& name, const SString& encoding); 
   41   SFontImpl (const SFontImpl& ff);
   42   SFontImpl operator= (const SFontImpl& ff);
   43   virtual ~SFontImpl (); 
   44 
   45   static void setPath (const SStringVector& path);
   46   static void guessPath(const SStringVector& files, const SString& property);
   47   static void guessPath();
   48 
   49   virtual SObject*  clone() const;
   50 
   51   void   scale (double x, double y);
   52 
   53   bool draw (SCanvas* canvas, const SPen& pen, 
   54        const SS_Matrix2D& matrix, SS_UCS4 uch, bool isLRContext, 
   55        bool isSelected, bool baseOK);
   56   bool width (SS_UCS4 uch, double* width);
   57 
   58   double width () const;
   59 
   60   double ascent () const;
   61 
   62   double descent () const;
   63 
   64   double gap () const;
   65   bool isTTF() const;
   66   bool isLeftAligned(SS_UCS4 uch) const;
   67 
   68   void setAttributes (const SProperties& properties);
   69   bool isLR () const { return lrFont; }
   70   bool isRL () const { return rlFont; }
   71   bool needSoftMirror (SS_UCS4 uch, bool isLRContext) const;
   72 
   73   /* set the base character for better glyph positioning */
   74   static void setBase(SS_UCS4 base);
   75 
   76 private:
   77   void createSaneXLFD ();
   78   SString xlfd;
   79   SString name;
   80   SString encoding;
   81   SS_Matrix2D matrix;
   82   bool lrFont;
   83   bool rlFont;
   84   void* delegate;
   85 };
   86 
   87 #endif /* SFontImpl_h */