00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00025 #ifndef _GLYPH_OUTLINE_H_
00026 #define _GLYPH_OUTLINE_H_
00027
00028 #include <ft2build.h>
00029 #include FT_FREETYPE_H
00030
00031 #include <vector>
00032
00033 #include "Point.h"
00034 #include "Line.h"
00035
00036 namespace LetterCDT
00037 {
00038
00039 enum ContourType
00040 {
00041 Inner,
00042 Outer
00043 };
00044
00046 class GlyphOutline
00047 {
00048 public:
00053 GlyphOutline(wchar_t charCode, FT_Face face);
00054
00056 ~GlyphOutline(void);
00057
00060 const std::vector<Point>& GetPoints(void) const;
00061
00064 const std::vector<Line>& GetSegments(void) const;
00065
00071 const std::vector<int>& GetContours(void) const;
00072
00077 const std::vector<ContourType>& GetContoursType(void) const;
00078
00081 int GetWidth(void) const;
00082
00085 int GetAdvance(void) const;
00086
00087 private:
00089 std::vector<Point> m_points;
00090
00092 std::vector<Line> m_segments;
00093
00095 std::vector<int> m_contours;
00096
00099 std::vector<ContourType> m_contoursTypes;
00100
00102 int m_width;
00103
00105 int m_advance;
00106
00108 GlyphOutline(const GlyphOutline&);
00109
00111 GlyphOutline& operator=(const GlyphOutline&);
00112
00117 void LoadGlyph(wchar_t charCode, FT_Face face);
00118
00125 bool ContourCounterClockWise(int segmentStartIndex, int segmentEndIndex);
00126 };
00127
00128 }
00129
00130 #endif