GUIDOLib  1.7.7
A Music Score Rendering Engine
VGFont.h
Go to the documentation of this file.
1 #ifndef VGFont_H
2 #define VGFont_H
3 
4 /*
5  GUIDO Library
6  Copyright (C) 2006 Grame
7 
8  This Source Code Form is subject to the terms of the Mozilla Public
9  License, v. 2.0. If a copy of the MPL was not distributed with this
10  file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 
12  Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
13  research@grame.fr
14 
15 */
16 
17 #include "VGDevice.h"
18 
24 // --------------------------------------------------------------
25 // VGFont class
26 // --------------------------------------------------------------
36 class VGFont
37 {
38  public:
40  enum {
41  kFontNone = 0,
42  kFontBold = 1,
45  };
46 
47  virtual ~VGFont() {}
48 
49  // - VGFont services ---------------------------------------------
51  virtual const char * GetName() const = 0;
53  virtual int GetSize() const = 0 ;
55  virtual int GetProperties() const = 0 ;
56 
57  // - Symbol services ---------------------------------------------
60  virtual void GetExtent( const char * s,
61  int inCharCount,
62  float * outWidth,
63  float * outHeight,
64  VGDevice * context ) const = 0;
65 
68  virtual void GetExtent( int c,
69  float * outWidth,
70  float * outHeight,
71  VGDevice * context ) const = 0;
72 
73  protected:
74  void * GetContext( VGDevice * context) const { return context->GetNativeContext(); }
75 };
76 
79 #endif
VGDevice::GetNativeContext
virtual void * GetNativeContext() const =0
Exports all graphical data to an image file.
VGDevice.h
VGFont::GetExtent
virtual void GetExtent(const char *s, int inCharCount, float *outWidth, float *outHeight, VGDevice *context) const =0
VGFont::GetContext
void * GetContext(VGDevice *context) const
Definition: VGFont.h:74
VGFont::GetProperties
virtual int GetProperties() const =0
Returns the current object's property value(s) (see enum above)
VGFont::GetName
virtual const char * GetName() const =0
Returns the current object's name (as a string)
VGFont::GetSize
virtual int GetSize() const =0
Returns the current object's size (as an int)
VGFont::kFontBold
Definition: VGFont.h:42
VGDevice
Generic platform independant drawing device.
Definition: VGDevice.h:68
VGFont::~VGFont
virtual ~VGFont()
Definition: VGFont.h:47
VGFont
Generic pure virtual & device-independant font class.
Definition: VGFont.h:36
VGFont::kFontNone
Definition: VGFont.h:41
VGFont::kFontUnderline
Definition: VGFont.h:44
VGFont::kFontItalic
Definition: VGFont.h:43

Guido Project Copyright © 2019 Grame-CNCM