font_metrics.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2009 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Magnus Norddahl
00027 **    Harry Storbacka
00028 **    Mark Page
00029 */
00030 
00033 
00034 #pragma once
00035 
00036 #include "../api_display.h"
00037 #include "../../Core/System/sharedptr.h"
00038 
00039 class CL_FontMetrics_Impl;
00040 
00044 class CL_API_DISPLAY CL_FontMetrics
00045 {
00048 
00049 public:
00051         CL_FontMetrics();
00052 
00053         CL_FontMetrics(
00054                 float height,
00055                 float ascent=0.0f,
00056                 float descent=0.0f,
00057                 float internal_leading=0.0f,
00058                 float external_leading=0.0f,
00059                 float average_character_width=0.0f,
00060                 float max_character_width=0.0f,
00061                 float weight=0.0f,
00062                 float overhang=0.0f,
00063                 float digitized_aspect_x=0.0f,
00064                 float digitized_aspect_y=0.0f,
00065                 bool italic=false,
00066                 bool underlined=false,
00067                 bool struck_out=false,
00068                 bool fixed_pitch=false
00069         );
00070 
00071         ~CL_FontMetrics();
00072 
00076 
00077 public:
00079         float get_height() const;
00080 
00082         float get_ascent() const;
00083 
00085         float get_descent() const;
00086 
00088         float get_internal_leading() const;
00089 
00091         float get_external_leading() const;
00092 
00094 
00096         float get_average_character_width() const;
00097 
00099         float get_max_character_width() const;
00100 
00102         float get_weight() const;
00103 
00105         float get_overhang() const;
00106 
00108         float get_digitized_aspect_x() const;
00109 
00111         float get_digitized_aspect_y() const;
00112 
00114         CL_String::char_type get_first_char() const;
00115 
00117         CL_String::char_type get_last_char() const;
00118 
00120         CL_String::char_type get_default_char() const;
00121 
00123         CL_String::char_type get_word_break_char() const;
00124 
00126         bool is_italic() const;
00127 
00129         bool is_underlined() const;
00130 
00132         bool is_struck_out() const;
00133 
00135         bool is_fixed_pitch() const;
00136 
00140 
00141 public:
00142 
00146         void set_height(float value);
00147 
00151         void set_ascent(float value);
00152 
00156         void set_descent(float value);
00157 
00161         void set_internal_leading(float value);
00162 
00166         void set_external_leading(float value);
00167 
00171         void set_average_character_width(float value);
00172 
00176         void set_max_character_width(float value);
00177 
00181         void set_weight(float value);
00182 
00186         void set_overhang(float value);
00187 
00191         void set_digitized_aspect_x(float value);
00192 
00196         void set_digitized_aspect_y(float value);
00197 
00201         void set_italic(bool value);
00202 
00206         void set_underlined(bool value);
00207 
00211         void set_struck_out(bool value);
00212 
00216         void set_fixed_pitch(bool value);
00217 
00218 
00222 
00223 private:
00224         CL_SharedPtr<CL_FontMetrics_Impl> impl;
00226 };
00227 
00229 

Generated on Thu Dec 3 02:39:29 2009 for ClanLib by  doxygen 1.4.6