1
/* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
4
* This file is part of The Croco Library
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of version 2.1 of
8
* the GNU Lesser General Public
9
* License as published by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the
17
* GNU Lesser General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22
* Author: Dodji Seketeli
23
* See COPYRIGHTS file for copyright information.
26
#ifndef __CR_FONTS_H__
27
#define __CR_FONTS_H__
35
*Various type declarations about font selection related
43
FONT_FAMILY_SANS_SERIF,
47
FONT_FAMILY_MONOSPACE,
48
FONT_FAMILY_NON_GENERIC,
54
typedef struct _CRFontFamily CRFontFamily ;
58
enum CRFontFamilyType type ;
61
*The name of the font family, in case
63
*Is set only if the type is FONT_FAMILY_NON_GENERIC.
74
*of absolute font size.
75
*This is used by the 'font-size'
76
*property defined in css2 spec
78
*These values a indexes of
79
*table of size so please, do not
80
*change their definition order unless
81
*you know what you are doing.
83
enum CRPredefinedAbsoluteFontSize
93
NB_PREDEFINED_ABSOLUTE_FONT_SIZES
98
*of relative font size.
99
*This is used by the 'font-size'
100
*property defined in css2 spec
102
*These values a indexes of
103
*table of size so please, do not
104
*change their definition order unless
105
*you know what you are doing.
107
enum CRRelativeFontSize
111
NB_RELATIVE_FONT_SIZE
115
*The type of font-size property.
116
*Used to define the type of #CRFontSize .
117
*See css2 spec chapter 15.2.4 to understand.
119
enum CRFontSizeType {
121
*If the type of #CRFontSize is
122
*PREDEFINED_ABSOLUTE_FONT_SIZE,
123
*the CRFontSize::value.predefined_absolute
124
*field will be defined.
126
PREDEFINED_ABSOLUTE_FONT_SIZE,
129
*If the type of #CRFontSize is
131
*the CRFontSize::value.absolute
132
*field will be defined.
137
*If the type of #CRFontSize is
139
*the CRFontSize::value.relative
140
*field will be defined.
145
*If the type of #CRFontSize is
146
*INHERITED_FONT_SIZE,
147
*the None of the field of the CRFontSize::value enum
155
typedef struct _CRFontSize CRFontSize ;
157
enum CRFontSizeType type ;
159
enum CRPredefinedAbsoluteFontSize predefined ;
160
enum CRRelativeFontSize relative ;
165
enum CRFontSizeAdjustType
167
FONT_SIZE_ADJUST_NONE = 0,
168
FONT_SIZE_ADJUST_NUMBER,
169
FONT_SIZE_ADJUST_INHERIT
171
typedef struct _CRFontSizeAdjust CRFontSizeAdjust ;
172
struct _CRFontSizeAdjust
174
enum CRFontSizeAdjustType type ;
188
FONT_VARIANT_NORMAL=0,
189
FONT_VARIANT_SMALL_CAPS,
195
FONT_WEIGHT_NORMAL = 1,
196
FONT_WEIGHT_BOLD = 1<<1,
197
FONT_WEIGHT_BOLDER = 1<<2,
198
FONT_WEIGHT_LIGHTER = 1<<3,
199
FONT_WEIGHT_100 = 1<<4,
200
FONT_WEIGHT_200 = 1<<5,
201
FONT_WEIGHT_300 = 1<<6,
202
FONT_WEIGHT_400 = 1<<7,
203
FONT_WEIGHT_500 = 1<<8,
204
FONT_WEIGHT_600 = 1<<9,
205
FONT_WEIGHT_700 = 1<<10,
206
FONT_WEIGHT_800 = 1<<11,
207
FONT_WEIGHT_900 = 1<<12,
208
FONT_WEIGHT_INHERIT = 1<<13,
214
FONT_STRETCH_NORMAL=0,
216
FONT_STRETCH_NARROWER,
217
FONT_STRETCH_ULTRA_CONDENSED,
218
FONT_STRETCH_EXTRA_CONDENSED,
219
FONT_STRETCH_CONDENSED,
220
FONT_STRETCH_SEMI_CONDENSED,
221
FONT_STRETCH_SEMI_EXPANDED,
222
FONT_STRETCH_EXPANDED,
223
FONT_STRETCH_EXTRA_EXPANDED,
224
FONT_STRETCH_ULTRA_EXPANDED,
228
/**************************************
229
*'font-family' manipulation functions
230
***************************************/
232
cr_font_family_new (enum CRFontFamilyType a_type, guchar *a_name) ;
235
cr_font_family_append (CRFontFamily *a_this,
236
CRFontFamily *a_family_to_append) ;
239
cr_font_family_to_string (CRFontFamily *a_this,
240
gboolean a_walk_font_family_list) ;
243
cr_font_family_prepend (CRFontFamily *a_this,
244
CRFontFamily *a_family_to_prepend);
247
cr_font_family_destroy (CRFontFamily *a_this) ;
250
cr_font_family_set_name (CRFontFamily *a_this, guchar *a_name) ;
253
/************************************
254
*'font-size' manipulation functions
255
***********************************/
257
CRFontSize * cr_font_size_new (void) ;
259
enum CRStatus cr_font_size_clear (CRFontSize *a_this) ;
261
enum CRStatus cr_font_size_copy (CRFontSize *a_dst,
263
enum CRStatus cr_font_size_set_predefined_absolute_font_size (CRFontSize *a_this,
264
enum CRPredefinedAbsoluteFontSize a_predefined) ;
265
enum CRStatus cr_font_size_set_relative_font_size (CRFontSize *a_this,
266
enum CRRelativeFontSize a_relative) ;
268
enum CRStatus cr_font_size_set_absolute_font_size (CRFontSize *a_this,
269
enum CRNumType a_num_type,
272
enum CRStatus cr_font_size_set_to_inherit (CRFontSize *a_this) ;
274
gboolean cr_font_size_is_set_to_inherit (CRFontSize *a_this) ;
276
gchar* cr_font_size_to_string (CRFontSize *a_this) ;
278
void cr_font_size_destroy (CRFontSize *a_font_size) ;
280
/*******************************************************
281
*'font-size-adjust' manipulation function declarations
282
*******************************************************/
284
CRFontSizeAdjust * cr_font_size_adjust_new (void) ;
286
gchar * cr_font_size_adjust_to_string (CRFontSizeAdjust *a_this) ;
288
void cr_font_size_adjust_destroy (CRFontSizeAdjust *a_this) ;
291
cr_font_size_get_smaller_predefined_font_size (enum CRPredefinedAbsoluteFontSize a_font_size,
292
enum CRPredefinedAbsoluteFontSize *a_smaller_size) ;
294
cr_font_size_get_larger_predefined_font_size (enum CRPredefinedAbsoluteFontSize a_font_size,
295
enum CRPredefinedAbsoluteFontSize *a_larger_size) ;
298
cr_font_size_is_predefined_absolute_font_size (enum CRPredefinedAbsoluteFontSize a_font_size) ;
300
/***********************************
301
*various other font related functions
302
***********************************/
303
const gchar * cr_font_style_to_string (enum CRFontStyle a_code) ;
305
const gchar * cr_font_weight_to_string (enum CRFontWeight a_code) ;
308
cr_font_weight_get_bolder (enum CRFontWeight a_weight) ;
310
const gchar * cr_font_variant_to_string (enum CRFontVariant a_code) ;
312
const gchar * cr_font_stretch_to_string (enum CRFontStretch a_code) ;