Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# glyph.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002-2003 The Inti Development Team.
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU Library General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  */
    00018
    00023
    00024 #ifndef INTI_PANGO_GLYPH_H
    00025 #define INTI_PANGO_GLYPH_H
    00026
    00027 #ifndef INTI_G_BOXED_H
    00028 #include <inti/glib/boxed.h>
    00029 #endif
    00030
    00031 #ifndef INTI_PANGO_TYPES_H
    00032 #include <inti/pango/types.h>
    00033 #endif
    00034
    00035 #ifndef __PANGO_GLYPH_H__
    00036 #include <pango/pango-glyph.h>
    00037 #endif
    00038
    00039 #ifndef _CPP_VECTOR
    00040 #include <vector>
    00041 #endif
    00042
    00043 namespace Inti {
    00044
    00045 namespace Pango {
    00046
    00047 class Analysis;
    00048 class Font;
    00049 class Rectangle;
    00050
    00057
    00058 typedef PangoGlyphUnit GlyphUnit;
    00059
    00065
    00066 class GlyphGeometry
    00067 {
    00068         PangoGlyphGeometry geometry_;
    00069
    00070 public:
    00071         PangoGlyphGeometry* pango_glyph_geometry() const { return const_cast<PangoGlyphGeometry*>(&geometry_); }
    00073
    00074         GlyphUnit width() const;
    00076
    00077         GlyphUnit x_offset() const;
    00079
    00080         GlyphUnit y_offset() const;
    00082 };
    00083
    00089
    00090 class GlyphVisAttr
    00091 {
    00092         PangoGlyphVisAttr attr_;
    00093
    00094 public:
    00095         PangoGlyphVisAttr* pango_glyph_vis_attr() const { return const_cast<PangoGlyphVisAttr*>(&attr_); }
    00097
    00098         bool is_cluster_start() const;
    00103 };
    00104
    00109
    00110 class GlyphInfo
    00111 {
    00112         PangoGlyphInfo info_;
    00113
    00114 public:
    00115         PangoGlyphInfo* pango_glyph_info() const { return const_cast<PangoGlyphInfo*>(&info_); }
    00117
    00118         Glyph glpyh() const;
    00120
    00121         const GlyphGeometry& geometry() const;
    00123
    00124         const GlyphVisAttr& attr() const;
    00127 };
    00128
    00134
    00135 class GlyphString : public G::Boxed
    00136 {
    00137 public:
    00140
    00141         GlyphString();
    00143
    00144         GlyphString(const String& text, const Analysis& analysis);
    00152
    00153         explicit GlyphString(PangoGlyphString *string);
    00161
    00162         GlyphString(PangoGlyphString *string, bool copy);
    00174
    00175         GlyphString(const GlyphString& src);
    00178
    00179         virtual ~GlyphString();
    00181
    00182         GlyphString& operator=(const GlyphString& src);
    00185
    00189
    00190         PangoGlyphString* pango_glyph_string() const { return (PangoGlyphString*)boxed_; }
    00192
    00193         operator PangoGlyphString* () const;
    00195
    00196         int size() const;
    00198
    00199         std::vector<GlyphInfo> glyphs() const;
    00201
    00202         int* log_clusters() const;
    00205
    00206         void extents(const Font& font, Rectangle *ink_rect, Rectangle *logical_rect, int start = 0, int end = -1) const;
    00223
    00224         void get_logical_widths(const String& text, int embedding_level, std::vector<int>& logical_widths) const;
    00233
    00237
    00238         void set_size(int length);
    00241
    00242         int index_to_x(const String& text, const Analysis& analysis, int index, bool trailing);
    00252
    00253         void x_to_index(const String& text, const Analysis& analysis, int x_pos, int *index, bool *trailing);
    00266
    00268 };
    00269
    00270 } // namespace Pango
    00271
    00272 } // namespace Inti
    00273
    00274 #endif // INTI_PANGO_GLYPH_H
    00275

Main Page - Footer