Merge branch 'gh/maint-clean' into ht/-include
[shapes.git] / source / fonttypes.h
blobf610178df2b7f3316aa60c5ee86b17faed298b07
1 /* This file is part of Shapes.
3 * Shapes is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * any later version.
8 * Shapes is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright 2008 Henrik Tidefelt
19 #pragma once
21 #include "Shapes_Lang_decls.h"
22 #include "FontMetrics_decls.h"
24 #include "shapesvalue.h"
25 #include "elementarylength.h"
28 namespace Shapes
30 namespace Lang
33 class Type3Glyph : public NoOperatorOverloadValue
35 public:
36 typedef enum { BASIC, COLORED } Kind;
37 typedef unsigned char CodeType;
38 private:
39 Kind kind_;
40 CodeType code_; // Use 0 for undefined.
41 RefCountPtr< const char > name_;
42 RefCountPtr< const Lang::Drawable2D > glyph_;
43 Concrete::Length widthX_;
44 Concrete::Length xmin_;
45 Concrete::Length ymin_;
46 Concrete::Length xmax_;
47 Concrete::Length ymax_;
49 public:
50 Type3Glyph( Kind kind, CodeType code, const RefCountPtr< const char > & name, const RefCountPtr< const Lang::Drawable2D > & glyph, Concrete::Length widthX, Concrete::Length xmin, Concrete::Length ymin, Concrete::Length xmax, Concrete::Length ymax );
51 virtual ~Type3Glyph( );
53 RefCountPtr< const char > name( ) const;
54 CodeType code( ) const { return code_; }
55 double widthX( ) const { return Concrete::Length::offtype( widthX_ ); }
56 void enlargeBBox( double * dstXMin, double * dstYMin, double * dstXMax, double * dstYMax ) const;
57 void setupMetric( FontMetrics::CharacterMetrics * metric, Concrete::ReciprocalLength invSize ) const;
58 void shipout( std::ostream & os, RefCountPtr< SimplePDF::PDF_Resources > resources ) const;
60 virtual void gcMark( Kernel::GCMarkedSet & marked );
61 TYPEINFODECL;