Blender  V2.59
Functions | Variables
font.c File Reference
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <wchar.h>
#include <wctype.h>
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_vfontdata.h"
#include "BLI_utildefines.h"
#include "DNA_packedFile_types.h"
#include "DNA_curve_types.h"
#include "DNA_vfont_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "BKE_utildefines.h"
#include "BKE_packedFile.h"
#include "BKE_library.h"
#include "BKE_font.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_anim.h"
#include "BKE_curve.h"
#include "BKE_displist.h"

Go to the source code of this file.

Functions

size_t chtoutf8 (const unsigned long c, char o[4])
void wcs2utf8s (char *dst, const wchar_t *src)
size_t wcsleninu8 (wchar_t *src)
static size_t utf8slen (const char *strc)
size_t utf8towchar (wchar_t *w, const char *c)
void free_vfont (struct VFont *vf)
void BKE_font_register_builtin (void *mem, int size)
static PackedFileget_builtin_packedfile (void)
void free_ttfont (void)
struct TmpFontvfont_find_tmpfont (VFont *vfont)
static VFontDatavfont_get_data (VFont *vfont)
VFontload_vfont (const char *name)
static VFontwhich_vfont (Curve *cu, CharInfo *info)
VFontget_builtin_font (void)
static VCharfind_vfont_char (VFontData *vfd, intptr_t character)
static void build_underline (Curve *cu, float x1, float y1, float x2, float y2, int charidx, short mat_nr)
static void buildchar (Curve *cu, unsigned long character, CharInfo *info, float ofsx, float ofsy, float rot, int charidx)
int BKE_font_getselection (Object *ob, int *start, int *end)
static float char_width (Curve *cu, VChar *che, CharInfo *info)
struct chartransBKE_text_to_curve (Scene *scene, Object *ob, int mode)

Variables

static ListBase ttfdata = {NULL, NULL}
static void * builtin_font_data = NULL
static int builtin_font_size = 0

Detailed Description

Definition in file font.c.


Function Documentation

int BKE_font_getselection ( Object ob,
int *  start,
int *  end 
)
void BKE_font_register_builtin ( void *  mem,
int  size 
)

Definition at line 237 of file font.c.

References builtin_font_data, builtin_font_size, and size().

Referenced by main().

struct chartrans* BKE_text_to_curve ( Scene scene,
Object ob,
int  mode 
) [read]

Definition at line 665 of file font.c.

References KDL::atan2(), BKE_font_getselection(), BLI_vfontchar_from_freetypefont(), build_underline(), buildchar(), ceilf, char_width(), CLAMP(), co, copy_m3_m4(), cos(), CU_CHINFO_SMALLCAPS, CU_CHINFO_SMALLCAPS_CHECK, CU_CHINFO_UNDERLINE, CU_CHINFO_WRAP, CU_FLUSH, CU_FOLLOW, CU_JUSTIFY, CU_LEFT, CU_MIDDLE, CU_PATH, CU_RIGHT, Object::data, chartrans::dobreak, Curve::editfont, find_vfont_char(), CharInfo::flag, Curve::flag, FO_BUILTIN_NAME, FO_CURSDOWN, FO_CURSUP, FO_DUPLI, FO_EDIT, FO_PAGEDOWN, FO_PAGEUP, FO_SELCHANGE, freeNurblist(), Curve::fsize, SelBox::h, TextBox::h, i, invert_m4_m4(), CharInfo::kern, Curve::len, Curve::linedist, Curve::lines, Object::loc, M_PI, makeDispListCurveTypes(), CharInfo::mat_nr, MAX2, MAXTEXTBOX, MEM_callocN(), MEM_freeN(), MEM_mallocN(), mul_m3_m3m3(), mul_v3_fl(), mul_v3_m4v3(), VFont::name, normalize_v3(), NULL, Curve::nurb, OB_CURVE, OB_FONT, Object::obmat, Curve::path, Curve::pos, Curve::selboxes, Curve::sepchar, si, sin(), Curve::spacemode, Curve::spacing, Curve::str, Curve::strinfo, Curve::tb, EditFont::textbufinfo, EditFont::textcurs, Curve::textoncurve, Curve::totbox, Object::totcol, Path::totdist, Object::type, Curve::ulheight, Curve::ulpos, utf8slen(), utf8towchar(), Curve::vfont, vfont_get_data(), SelBox::w, TextBox::w, where_on_path(), which_vfont(), Curve::wordspace, SelBox::x, TextBox::x, chartrans::xof, Curve::xof, SelBox::y, TextBox::y, chartrans::yof, and Curve::yof.

Referenced by copy_attr(), do_makeDispListCurveTypes(), font_duplilist(), move_cursor(), and text_update_edited().

static void build_underline ( Curve cu,
float  x1,
float  y1,
float  x2,
float  y2,
int  charidx,
short  mat_nr 
) [static]
static void buildchar ( Curve cu,
unsigned long  character,
CharInfo info,
float  ofsx,
float  ofsy,
float  rot,
int  charidx 
) [static]
static float char_width ( Curve cu,
VChar che,
CharInfo info 
) [static]

Definition at line 651 of file font.c.

References CU_CHINFO_SMALLCAPS_CHECK, CharInfo::flag, NULL, Curve::smallcaps_scale, and VChar::width.

Referenced by BKE_text_to_curve().

size_t chtoutf8 ( const unsigned long  c,
char  o[4] 
)

Definition at line 70 of file font.c.

Referenced by wcs2utf8s(), and wcsleninu8().

static VChar* find_vfont_char ( VFontData vfd,
intptr_t  character 
) [static]

Definition at line 445 of file font.c.

References VFontData::characters, ListBase::first, VChar::index, VChar::next, and NULL.

Referenced by BKE_text_to_curve(), and buildchar().

void free_ttfont ( void  )
void free_vfont ( struct VFont vf)
VFont* get_builtin_font ( void  ) [read]
static PackedFile* get_builtin_packedfile ( void  ) [static]

Definition at line 243 of file font.c.

References builtin_font_data, builtin_font_size, MEM_mallocN(), newPackedFileMemory(), and NULL.

Referenced by load_vfont(), and vfont_get_data().

VFont* load_vfont ( const char *  name) [read]
static size_t utf8slen ( const char *  strc) [static]

Definition at line 124 of file font.c.

Referenced by BKE_text_to_curve().

size_t utf8towchar ( wchar_t *  w,
const char *  c 
)
struct TmpFont* vfont_find_tmpfont ( VFont vfont) [read]

Definition at line 270 of file font.c.

References ListBase::first, TmpFont::next, NULL, and TmpFont::vfont.

Referenced by objchr_to_ftvfontdata(), and vfont_get_data().

static VFontData* vfont_get_data ( VFont vfont) [static]
void wcs2utf8s ( char *  dst,
const wchar_t *  src 
)

Definition at line 103 of file font.c.

References chtoutf8().

Referenced by insert_text_invoke(), and update_string().

size_t wcsleninu8 ( wchar_t *  src)

Definition at line 112 of file font.c.

References chtoutf8().

Referenced by update_string().

static VFont* which_vfont ( Curve cu,
CharInfo info 
) [static]

Variable Documentation

void* builtin_font_data = NULL [static]

Definition at line 234 of file font.c.

Referenced by BKE_font_register_builtin(), and get_builtin_packedfile().

int builtin_font_size = 0 [static]

Definition at line 235 of file font.c.

Referenced by BKE_font_register_builtin(), and get_builtin_packedfile().

ListBase ttfdata = {NULL, NULL} [static]

Definition at line 67 of file font.c.