Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

cr-fonts.h

Go to the documentation of this file.
00001 /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
00002 
00003 /*
00004  * This file is part of The Croco Library
00005  *
00006  * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org>
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of version 2.1 of 
00010  * the GNU Lesser General Public
00011  * License as published by the Free Software Foundation.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the 
00019  * GNU Lesser General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00022  * USA
00023  */
00024 #ifndef __CR_FONTS_H__
00025 #define __CR_FONTS_H__
00026 #endif
00027 
00028 #include "cr-utils.h"
00029 #include "cr-num.h"
00030 
00031 /**
00032  *@file
00033  *Various type declarations about font selection related
00034  *properties.
00035  */
00036 G_BEGIN_DECLS
00037 
00038 
00039 enum CRFontFamilyType
00040 {
00041         FONT_FAMILY_SANS_SERIF,
00042         FONT_FAMILY_SERIF,      
00043         FONT_FAMILY_CURSIVE,
00044         FONT_FAMILY_FANTASY,
00045         FONT_FAMILY_MONOSPACE,
00046         FONT_FAMILY_NON_GENERIC,
00047         /**/
00048         NB_FONT_FAMILIE_TYPES
00049 } ;
00050 
00051 typedef struct _CRFontFamily CRFontFamily ;
00052 
00053 struct _CRFontFamily
00054 {
00055         enum CRFontFamilyType type ;
00056 
00057         /*
00058          *The name of the font family, in case
00059          *it is non generic.
00060          *Is set only if the type is FONT_FAMILY_NON_GENERIC.
00061          */
00062         guchar *name ;
00063 
00064         CRFontFamily *next ;
00065         CRFontFamily *prev ;
00066 } ;
00067 
00068 
00069 /**
00070  *The different types
00071  *of absolute font size.
00072  *This is used by the 'font-size'
00073  *property defined in css2 spec
00074  *in chapter 15.2.4 .
00075  *These values a indexes of 
00076  *table of size so please, do not
00077  *change their definition order unless
00078  *you know what you are doing.
00079  */
00080 enum CRPredefinedAbsoluteFontSize
00081 {
00082         FONT_SIZE_XX_SMALL=0,
00083         FONT_SIZE_X_SMALL,
00084         FONT_SIZE_SMALL,
00085         FONT_SIZE_MEDIUM,
00086         FONT_SIZE_LARGE,
00087         FONT_SIZE_X_LARGE,
00088         FONT_SIZE_XX_LARGE,
00089 
00090         NB_PREDEFINED_ABSOLUTE_FONT_SIZES
00091 } ;
00092 
00093 /**
00094  *The different types
00095  *of relative font size.
00096  *This is used by the 'font-size'
00097  *property defined in css2 spec
00098  *in chapter 15.2.4 .
00099  *These values a indexes of 
00100  *table of size so please, do not
00101  *change their definition order unless
00102  *you know what you are doing.
00103  */
00104 enum CRRelativeFontSize
00105 {
00106         FONT_SIZE_LARGER,
00107         FONT_SIZE_SMALLER
00108 } ;
00109 
00110 /**
00111  *The type of font-size property.
00112  *Used to define the type of #CRFontSize .
00113  *See css2 spec chapter 15.2.4 to understand.
00114  */
00115 enum CRFontSizeType
00116 {
00117         /**
00118          *If the type of #CRFontSize is
00119          *PREDEFINED_ABSOLUTE_FONT_SIZE,
00120          *the CRFontSize::value.predefined_absolute 
00121          *field will be defined.
00122          */
00123         PREDEFINED_ABSOLUTE_FONT_SIZE,
00124         
00125         /**
00126          *If the type of #CRFontSize is
00127          *ABSOLUTE_FONT_SIZE,
00128          *the CRFontSize::value.absolute 
00129          *field will be defined.
00130          */
00131         ABSOLUTE_FONT_SIZE,
00132 
00133         /**
00134          *If the type of #CRFontSize is
00135          *RELATIVE_FONT_SIZE,
00136          *the CRFontSize::value.relative
00137          *field will be defined.
00138          */
00139         RELATIVE_FONT_SIZE,
00140 
00141         /**
00142          *If the type of #CRFontSize is
00143          *INHERITED_FONT_SIZE,
00144          *the None of the field of the CRFontSize::value enum
00145          *will be defined.
00146          */
00147         INHERITED_FONT_SIZE
00148 } ;
00149 
00150 typedef struct _CRFontSize CRFontSize ;
00151 struct _CRFontSize
00152 {
00153         enum CRFontSizeType type ;
00154         union 
00155         {
00156                 enum CRPredefinedAbsoluteFontSize predefined ;
00157                 enum CRRelativeFontSize relative ;
00158                 CRNum * absolute ;
00159         } value;
00160 } ;
00161 
00162 enum CRFontSizeAdjustType
00163 {
00164         FONT_SIZE_ADJUST_NONE = 0,
00165         FONT_SIZE_ADJUST_NUMBER,
00166         FONT_SIZE_ADJUST_INHERIT        
00167 } ;
00168 typedef struct _CRFontSizeAdjust CRFontSizeAdjust ;
00169 struct _CRFontSizeAdjust
00170 {
00171         enum CRFontSizeAdjustType type ;
00172         CRNum *num ;
00173 } ;
00174 
00175 enum CRFontStyle
00176 {
00177         FONT_STYLE_NORMAL=0,
00178         FONT_STYLE_ITALIC,
00179         FONT_STYLE_OBLIQUE,
00180         FONT_STYLE_INHERIT
00181 } ;
00182 
00183 enum CRFontVariant
00184 {
00185         FONT_VARIANT_NORMAL=0,
00186         FONT_VARIANT_SMALL_CAPS,
00187         FONT_VARIANT_INHERIT
00188 } ;
00189 
00190 enum CRFontWeight
00191 {
00192         FONT_WEIGHT_NORMAL=0,
00193         FONT_WEIGHT_BOLD,
00194         FONT_WEIGHT_BOLDER,
00195         FONT_WEIGHT_LIGHTER,
00196         FONT_WEIGHT_100,
00197         FONT_WEIGHT_200,
00198         FONT_WEIGHT_300,
00199         FONT_WEIGHT_400,
00200         FONT_WEIGHT_500,
00201         FONT_WEIGHT_600,
00202         FONT_WEIGHT_700,
00203         FONT_WEIGHT_800,
00204         FONT_WEIGHT_900,
00205         FONT_WEIGHT_INHERIT,
00206 } ;
00207 
00208 enum CRFontStretch
00209 {
00210         FONT_STRETCH_NORMAL=0,
00211         FONT_STRETCH_WIDER,
00212         FONT_STRETCH_NARROWER,
00213         FONT_STRETCH_ULTRA_CONDENSED,
00214         FONT_STRETCH_EXTRA_CONDENSED,
00215         FONT_STRETCH_CONDENSED,
00216         FONT_STRETCH_SEMI_CONDENSED,
00217         FONT_STRETCH_SEMI_EXPANDED,
00218         FONT_STRETCH_EXPANDED,
00219         FONT_STRETCH_EXTRA_EXPANDED,
00220         FONT_STRETCH_ULTRA_EXPANDED,
00221         FONT_STRETCH_INHERIT
00222 } ;
00223 
00224 /**************************************
00225  *'font-family' manipulation functions
00226  ***************************************/
00227 CRFontFamily *
00228 cr_font_family_new (enum CRFontFamilyType a_type, guchar *a_name) ;
00229 
00230 CRFontFamily *
00231 cr_font_family_append (CRFontFamily *a_this, 
00232                        CRFontFamily *a_family_to_append) ;
00233 
00234 guchar *
00235 cr_font_family_to_string (CRFontFamily *a_this,
00236                           gboolean a_walk_font_family_list) ;
00237 
00238 CRFontFamily *
00239 cr_font_family_prepend (CRFontFamily *a_this, 
00240                         CRFontFamily *a_family_to_prepend);
00241 
00242 enum CRStatus
00243 cr_font_family_destroy (CRFontFamily *a_this) ;
00244 
00245 enum CRStatus
00246 cr_font_family_set_name (CRFontFamily *a_this, guchar *a_name) ;
00247 
00248 
00249 /************************************
00250  *'font-size' manipulation functions
00251  ***********************************/
00252 
00253 CRFontSize *
00254 cr_font_size_new (void) ;
00255 
00256 enum CRStatus
00257 cr_font_size_clear (CRFontSize *a_this) ;
00258 
00259 enum CRStatus
00260 cr_font_size_copy (CRFontSize *a_dst, CRFontSize *a_src) ;
00261 
00262 
00263 void
00264 cr_font_size_destroy (CRFontSize *a_font_size) ;
00265 
00266 /*******************************************************
00267  *'font-size-adjust' manipulation function declarations
00268  *******************************************************/
00269 
00270 CRFontSizeAdjust *
00271 cr_font_size_adjust_new (void) ;
00272 
00273 void
00274 cr_font_size_adjust_destroy (CRFontSizeAdjust *a_this) ;
00275 
00276 G_END_DECLS

Generated on Wed Oct 1 01:36:45 2003 for Libcroco by doxygen 1.3.3