cr-fonts.c revision cc34471355d340f13c2745632cc3e986791e8064
/* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
/*
* This file is part of The Croco Library
*
*
* modify it under the terms of version 2.1 of
* the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the
* GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
*See COPYRIGHTS file for copyright information
*/
#include "cr-fonts.h"
#include <string.h>
static enum CRStatus
{
if (!*a_string) {
}
if (!a_this) {
return CR_OK;
}
case FONT_FAMILY_SANS_SERIF:
break;
case FONT_FAMILY_SERIF:
break;
case FONT_FAMILY_CURSIVE:
break;
case FONT_FAMILY_FANTASY:
break;
case FONT_FAMILY_MONOSPACE:
break;
case FONT_FAMILY_NON_GENERIC:
break;
default:
break;
}
if (name) {
} else {
}
}
}
return result;
}
static const gchar *
{
switch (a_code) {
case FONT_SIZE_XX_SMALL:
str = "xx-small";
break;
case FONT_SIZE_X_SMALL:
str = "x-small";
break;
case FONT_SIZE_SMALL:
str = "small";
break;
case FONT_SIZE_MEDIUM:
str = "medium";
break;
case FONT_SIZE_LARGE:
str = "large";
break;
case FONT_SIZE_X_LARGE:
str = "x-large";
break;
case FONT_SIZE_XX_LARGE:
str = "xx-large";
break;
default:
str = "unknown absolute font size value";
}
return str;
}
static const gchar *
{
switch (a_code) {
case FONT_SIZE_LARGER:
str = "larger";
break;
case FONT_SIZE_SMALLER:
str = "smaller";
break;
default:
str = "unknown relative font size value";
break;
}
return str;
}
/**
* cr_font_family_new:
* @a_type: the type of font family to create.
* @a_name: the name of the font family.
*
* create a font family.
*
* Returns the newly built font family.
*/
{
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
}
return result;
}
/**
* cr_font_family_to_string:
* @a_this: the current instance of #CRFontFamily.
* @a_walk_font_family_list: wether the serialize the entire list.
*
* Returns the seriliazed font family. The caller has to free it using
* g_free().
*/
guchar *
{
if (!a_this) {
}
&stringue);
} else {
if (stringue) {
}
}
}
/**
* cr_font_family_set_name:
* @a_this: the current instance of #CRFontFamily.
* @a_name: the new name
*
* Returns CR_OK upon sucessful completion, an error code otherwise.
*/
enum CRStatus
{
/*
*only non generic font families can have a name
*/
return CR_BAD_PARAM_ERROR;
}
}
return CR_OK;
}
/**
* cr_font_family_append:
* @a_this: the current instance of #CRFontFamily.
* @a_family_to_append: the font family to append to the list
*
* Returns the new font family list.
*/
{
if (!a_this)
return a_family_to_append;
return a_this;
}
/**
* cr_font_family_prepend:
* @a_this: the current instance #CRFontFamily.
* @a_family_to_prepend: the font family to prepend to the list.
*
* Returns the font family list.
*/
{
if (!a_this)
return a_family_to_prepend;
return a_family_to_prepend;
}
/**
* cr_font_family_destroy:
* @a_this: the current instance of #CRFontFamily.
*
* Returns CR_OK upon sucessful completion, an error code otherwise.
*/
enum CRStatus
{
}
}
}
}
return CR_OK;
}
/***************************************************
*'font-size' manipulation functions definitions
***************************************************/
/**
* cr_font_size_new:
*
* Returns the newly created font size.
*/
cr_font_size_new (void)
{
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
}
return result;
}
/**
* cr_font_size_clear:
* @a_this: the current instance of #CRFontSize
*
* Returns CR_OK upon successful completion, an error code otherwise.
*/
enum CRStatus
{
case RELATIVE_FONT_SIZE:
case INHERITED_FONT_SIZE:
break;
case ABSOLUTE_FONT_SIZE:
break;
default:
return CR_UNKNOWN_TYPE_ERROR;
}
return CR_OK;
}
/**
* cr_font_size_copy:
* @a_dst: the destination #CRFontSize (where to copy to).
* @a_src: the source #CRFontSize (where to copy from).
*
* Returns CR_OK upon successful completion, an error code otherwise.
*/
enum CRStatus
{
case RELATIVE_FONT_SIZE:
case INHERITED_FONT_SIZE:
break;
case ABSOLUTE_FONT_SIZE:
break;
default:
return CR_UNKNOWN_TYPE_ERROR;
}
return CR_OK;
}
/**
* cr_font_size_set_predefined_absolute_font_size:
* @a_this: the current instance of #CRFontSize.
* @a_predefined: what to set.
*
* Returns CR_OK upon sucessful completion, an error code otherwise.
*/
enum CRStatus
{
return CR_OK ;
}
/**
* cr_font_size_set_relative_font_size:
* @a_this: the current instance of #CRFontSize
* @a_relative: the new relative font size
*
* Returns CR_OK upon successful completion, an error code otherwise.
*/
enum CRStatus
enum CRRelativeFontSize a_relative)
{
return CR_OK ;
}
/**
* cr_font_size_set_absolute_font_size:
* @a_this: the current instance of #CRFontSize
* @a_num_type: the type of number to set.
* @a_value: the actual value to set.
*
* Returns CR_OK upon succesful completion, an error code otherwise.
*/
enum CRStatus
enum CRNumType a_num_type,
{
a_value, a_num_type) ;
return CR_OK ;
}
/**
* cr_font_size_set_to_inherit:
* @a_this: the current instance of #CRFontSize
*
* Returns CR_OK upon succesful completion, an error code otherwise.
*/
enum CRStatus
{
return CR_OK ;
}
/**
* cr_font_size_is_set_to_inherit:
* @a_this: the current instance of #CRFontSize.
*
* Returns TRUE if the current instance is set to 'inherit'.
*/
{
}
/**
* cr_font_size_to_string:
* @a_this: the current instance of #CRFontSize
*
* Returns the serialized form of #CRFontSize. The returned string
* has to bee freed using g_free().
*/
gchar *
{
if (!a_this) {
return str;
}
break;
case ABSOLUTE_FONT_SIZE:
break;
case RELATIVE_FONT_SIZE:
break;
case INHERITED_FONT_SIZE:
break;
default:
break;
}
return str;
}
/**
* cr_font_size_get_smaller_predefined:
* @a_font_size: the font size to consider.
* @a_smaller_size: out parameter. The a smaller value than @a_font_size.
*/
void
{
switch (a_font_size) {
case FONT_SIZE_XX_SMALL:
break ;
case FONT_SIZE_X_SMALL:
break ;
case FONT_SIZE_SMALL:
break ;
case FONT_SIZE_MEDIUM:
break ;
case FONT_SIZE_LARGE:
break ;
case FONT_SIZE_X_LARGE:
break ;
case FONT_SIZE_XX_LARGE:
break ;
case FONT_SIZE_INHERIT:
cr_utils_trace_info ("can't return a smaller size for FONT_SIZE_INHERIT") ;
break ;
default:
cr_utils_trace_info ("Unknown FONT_SIZE") ;
break ;
}
*a_smaller_size = result ;
}
/**
* cr_font_size_get_larger_predefined_font_size:
* @a_font_size: the font size to consider.
* @a_larger_size: out parameter. the font size considered larger than
* @a_font_size.
*
*/
void
{
switch (a_font_size) {
case FONT_SIZE_XX_SMALL:
break ;
case FONT_SIZE_X_SMALL:
break ;
case FONT_SIZE_SMALL:
break ;
case FONT_SIZE_MEDIUM:
break ;
case FONT_SIZE_LARGE:
break ;
case FONT_SIZE_X_LARGE:
break ;
case FONT_SIZE_XX_LARGE:
break ;
case FONT_SIZE_INHERIT:
cr_utils_trace_info ("can't return a bigger size for FONT_SIZE_INHERIT") ;
break ;
default:
cr_utils_trace_info ("Unknown FONT_SIZE") ;
break ;
}
*a_larger_size = result ;
}
/**
* cr_font_size_is_predefined_absolute_font_size:
* @a_font_size: the font size to consider.
*
* Returns TRUE if the instance is an predefined absolute font size, FALSE
* otherwise.
*/
{
if ((unsigned)a_font_size < NB_PREDEFINED_ABSOLUTE_FONT_SIZES) {
return TRUE ;
} else {
return FALSE ;
}
}
/**
* cr_font_size_adjust_to_string:
* @a_this: the instance of #CRFontSizeAdjust.
*
* Returns the serialized form of #CRFontSizeAdjust
*/
gchar *
{
if (!a_this) {
return str;
}
case FONT_SIZE_ADJUST_NONE:
break;
case FONT_SIZE_ADJUST_NUMBER:
else
break;
case FONT_SIZE_ADJUST_INHERIT:
}
return str;
}
/**
* cr_font_style_to_string:
* @a_code: the current instance of #CRFontStyle .
*
* Returns the serialized #CRFontStyle. The caller must free the returned
* string using g_free().
*/
const gchar *
{
switch (a_code) {
case FONT_STYLE_NORMAL:
break;
case FONT_STYLE_ITALIC:
break;
case FONT_STYLE_OBLIQUE:
break;
case FONT_STYLE_INHERIT:
break;
default:
break;
}
return str;
}
/**
* cr_font_variant_to_string:
* @a_code: the current instance of #CRFontVariant.
*
* Returns the serialized form of #CRFontVariant. The caller has
* to free the returned string using g_free().
*/
const gchar *
{
switch (a_code) {
case FONT_VARIANT_NORMAL:
break;
case FONT_VARIANT_SMALL_CAPS:
break;
case FONT_VARIANT_INHERIT:
break;
}
return str;
}
/**
* cr_font_weight_get_bolder:
* @a_weight: the #CRFontWeight to consider.
*
* Returns a font weight bolder than @a_weight
*/
enum CRFontWeight
{
if (a_weight == FONT_WEIGHT_INHERIT) {
cr_utils_trace_info ("can't return a bolder weight for FONT_WEIGHT_INHERIT") ;
return a_weight;
} else if (a_weight >= FONT_WEIGHT_900) {
return FONT_WEIGHT_900 ;
} else if (a_weight < FONT_WEIGHT_NORMAL) {
return FONT_WEIGHT_NORMAL ;
} else if (a_weight == FONT_WEIGHT_BOLDER
|| a_weight == FONT_WEIGHT_BOLDER) {
cr_utils_trace_info ("FONT_WEIGHT_BOLDER or FONT_WEIGHT_LIGHTER should not appear here") ;
return FONT_WEIGHT_NORMAL ;
} else {
}
}
/**
* cr_font_weight_to_string:
* @a_code: the font weight to consider.
*
* Returns the serialized form of #CRFontWeight.
*/
const gchar *
{
switch (a_code) {
case FONT_WEIGHT_NORMAL:
break;
case FONT_WEIGHT_BOLD:
break;
case FONT_WEIGHT_BOLDER:
break;
case FONT_WEIGHT_LIGHTER:
break;
case FONT_WEIGHT_100:
break;
case FONT_WEIGHT_200:
break;
case FONT_WEIGHT_300:
break;
case FONT_WEIGHT_400:
break;
case FONT_WEIGHT_500:
break;
case FONT_WEIGHT_600:
break;
case FONT_WEIGHT_700:
break;
case FONT_WEIGHT_800:
break;
case FONT_WEIGHT_900:
break;
case FONT_WEIGHT_INHERIT:
break;
default:
break;
}
return str;
}
/**
* cr_font_stretch_to_string:
* @a_code: the instance of #CRFontStretch to consider.
*
* Returns the serialized form of #CRFontStretch.
*/
const gchar *
{
switch (a_code) {
case FONT_STRETCH_NORMAL:
break;
case FONT_STRETCH_WIDER:
break;
case FONT_STRETCH_NARROWER:
break;
break;
break;
case FONT_STRETCH_CONDENSED:
break;
break;
break;
case FONT_STRETCH_EXPANDED:
break;
break;
break;
case FONT_STRETCH_INHERIT:
break;
}
return str;
}
/**
* cr_font_size_destroy:
* @a_font_size: the font size to destroy
*
*/
void
{
g_free (a_font_size) ;
}
/*******************************************************
*'font-size-adjust' manipulation function definition
*******************************************************/
/**
* cr_font_size_adjust_new:
*
* Returns a newly built instance of #CRFontSizeAdjust
*/
cr_font_size_adjust_new (void)
{
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
}
return result;
}
/**
* cr_font_size_adjust_destroy:
* @a_this: the current instance of #CRFontSizeAdjust.
*
*/
void
{
}
}