Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2009-04-10 20:30:28 +0400
committerTon Roosendaal <ton@blender.org>2009-04-10 20:30:28 +0400
commit4e81404d7eb00d7373ea8e4c01ae8bdfad287d72 (patch)
treee0414e0bea32707785061910589d173c112756a6 /source/blender/ftfont
parent61249337817d3699ca961c9e4007cb0cdb232051 (diff)
2.5
Grand cleanup: - removal of FTF and ftfont dir - removal of text.c which wrapped it - wrapped old text drawing code temporarily, need to decide how 'style' will behave per editor when you draw strings outside interface code.... wouldn't be very useful to set fonts locally all over?
Diffstat (limited to 'source/blender/ftfont')
-rw-r--r--source/blender/ftfont/CMakeLists.txt43
-rw-r--r--source/blender/ftfont/FTF_Api.h163
-rw-r--r--source/blender/ftfont/FTF_Settings.h46
-rw-r--r--source/blender/ftfont/Makefile34
-rw-r--r--source/blender/ftfont/SConscript16
-rw-r--r--source/blender/ftfont/intern/FTF_Api.cpp205
-rw-r--r--source/blender/ftfont/intern/FTF_TTFont.cpp403
-rw-r--r--source/blender/ftfont/intern/FTF_TTFont.h136
-rw-r--r--source/blender/ftfont/intern/Makefile56
9 files changed, 0 insertions, 1102 deletions
diff --git a/source/blender/ftfont/CMakeLists.txt b/source/blender/ftfont/CMakeLists.txt
deleted file mode 100644
index 134796d0799..00000000000
--- a/source/blender/ftfont/CMakeLists.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-# $Id$
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# 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 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.
-#
-# The Original Code is Copyright (C) 2006, Blender Foundation
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): Jacques Beaurain.
-#
-# ***** END GPL LICENSE BLOCK *****
-
-FILE(GLOB SRC intern/*.cpp)
-
-SET(INC
- . intern ../blenkernel ../blenlib ../makesdna ../include
- ${FTGL_INC}
- ${FREETYPE_INC}
- ${GETTEXT_INC}
-)
-
-ADD_DEFINITIONS(-DFTGL_LIBRARY_STATIC)
-
-IF(WIN32)
- ADD_DEFINITIONS(-D_WIN32 -DUSE_GETTEXT_DLL)
-ENDIF(WIN32)
-
-BLENDERLIB(bf_ftfont "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_ftfont', sources, Split(incs), Split(defs), libtype=['international','player'], priority=[0, 205] )
diff --git a/source/blender/ftfont/FTF_Api.h b/source/blender/ftfont/FTF_Api.h
deleted file mode 100644
index 8b04f5c09c1..00000000000
--- a/source/blender/ftfont/FTF_Api.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * 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 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.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef _FTF_API_H
-#define _FTF_API_H
-
-#define FTF_EXPORT
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-#include "FTF_Settings.h"
-
-/**
- * Set Font Size
- * @param int size
- */
-FTF_EXPORT void FTF_SetSize(int size);
-
-/**
- * Get Font Size
- * @return Font size
- */
-FTF_EXPORT int FTF_GetSize(void);
-
-/**
- * Ascender
- * @return Ascend size
- */
-FTF_EXPORT int FTF_Ascender(void);
-
-/**
- * Descender
- * @return Descend size
- */
-FTF_EXPORT int FTF_Descender(void);
-
-/**
- * String Translation and Code Conversion
- * @param str source string
- * @param ustr distnation string
- * @param flag mode flag
- */
-FTF_EXPORT void FTF_TransConvString(char* str, char* ustr, unsigned int flag);
-
-/**
- * Draw a character at the current raster position.
- * @param c the character to draw
- * @param mode flag to forward to FTF_TransConvString()
- * @return Width drawing
- */
-//FTF_EXPORT float FTF_DrawCharacter(char c, unsigned int flag);
-
-/**
- * Draws a string at the current raster postion.
- * @param str The string to draw
- * @param mode flag to forward to FTF_TransConvString()
- * @return Width drawing
- */
-FTF_EXPORT float FTF_DrawString(char* str, unsigned int flag);
-
-
-/**
- * Get a character width
- * @param mode flag to forward to FTF_TransConvString()
- */
-FTF_EXPORT float FTF_GetCharacterWidth(char c, unsigned int flag);
-
-
-/**
- * Get a string width
- * @param mode flag to forward to FTF_TransConvString()
- */
-FTF_EXPORT float FTF_GetStringWidth(char* str, unsigned int flag);
-
-/**
- * Get Bounding Box
- * @param llx Lower left near x coord
- * @param lly Lower left near y coord
- * @param llz Lower left near z coord
- * @param urx Upper right far x coord
- * @param ury Upper right far y coord
- * @param urz Upper right far z coord
- * @param mode flag to forward to FTF_TransConvString()
- * not test yet.
- */
-FTF_EXPORT void FTF_GetBoundingBox(char* str, float*llx, float *lly, float *llz, float *urx, float *ury, float *urz, unsigned int flag);
-
-/**
- * Following stuff added by phase, ton
- */
-
-/**
- * SetFontSize
- * @param size
- */
-FTF_EXPORT void FTF_SetFontSize(char size);
-
-/**
- * SetFont
- * @param str
- * @param size
- */
-FTF_EXPORT int FTF_SetFont(const unsigned char* str, int datasize, int fontsize);
-
-/**
- * SetLanguage
- * @param str
- * not test yet.
- */
-FTF_EXPORT void FTF_SetLanguage(char* str);
-
-/**
- * SetLanguage
- * @param str
- * not tested yet.
- */
-FTF_EXPORT void FTF_SetEncoding(char* str);
-
-FTF_EXPORT void FTF_SetPosition(float x, float y);
-FTF_EXPORT void FTF_SetMode(int mode);
-FTF_EXPORT void FTF_SetScale(float fsize);
-
-FTF_EXPORT void FTF_End(void);
-
-/* Font preview functions */
-FTF_EXPORT int FTF_GetNewFont (const unsigned char *str, int datasize, int fontsize);
-FTF_EXPORT float FTF_DrawNewFontString(char* str, unsigned int flag);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __FTF_API_H */
-
diff --git a/source/blender/ftfont/FTF_Settings.h b/source/blender/ftfont/FTF_Settings.h
deleted file mode 100644
index ff9d78e3f58..00000000000
--- a/source/blender/ftfont/FTF_Settings.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * 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 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.
- *
- * Copyright (C) 2002 Blender Foundation. All Rights Reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/**
-
- * $Id$
- * Copyright (C) 2001 NaN Technologies B.V.
- * Allows you to determine which fonts to include in the library.
- */
-
-#ifndef __FTF_SETTINGS_H
-#define __FTF_SETTINGS_H
-
-#define FTF_BIT(num) ((unsigned int)1 << (num))
-#define FTF_NO_TRANSCONV 0
-#define FTF_INPUT_SYSTEM_ENCODING FTF_BIT(1)
-#define FTF_USE_GETTEXT FTF_BIT(2)
-#define FTF_INPUT_UTF8 FTF_BIT(3)
-#define FTF_PIXMAPFONT 0
-#define FTF_TEXTUREFONT 1
-
-#endif /* __FTF_SETTINGS_H */
diff --git a/source/blender/ftfont/Makefile b/source/blender/ftfont/Makefile
deleted file mode 100644
index 73f75e77e73..00000000000
--- a/source/blender/ftfont/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# $Id$
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# 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 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.
-#
-# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): none yet.
-#
-# ***** END GPL LICENSE BLOCK *****
-#
-# Bounces make to subdirectories.
-
-SOURCEDIR = source/blender/ftfont
-DIRS = intern
-
-include nan_subdirs.mk
diff --git a/source/blender/ftfont/SConscript b/source/blender/ftfont/SConscript
deleted file mode 100644
index 9d475152194..00000000000
--- a/source/blender/ftfont/SConscript
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/python
-import sys
-Import ('env')
-
-sources = env.Glob('intern/*.cpp')
-
-incs = '. intern ../blenkernel ../blenlib ../makesdna ../editors/include'
-incs += ' ' + env['BF_FTGL_INC']
-incs += ' ' + env['BF_FREETYPE_INC']
-incs += ' ' + env['BF_GETTEXT_INC']
-
-defs = 'FTGL_STATIC_LIBRARY'
-if sys.platform == 'win32':
- defs += ' _WIN32 USE_GETTEXT_DLL'
-
-env.BlenderLib ( 'bf_ftfont', sources, Split(incs), Split(defs), libtype=['core'], priority=[210] )
diff --git a/source/blender/ftfont/intern/FTF_Api.cpp b/source/blender/ftfont/intern/FTF_Api.cpp
deleted file mode 100644
index 702d054e71c..00000000000
--- a/source/blender/ftfont/intern/FTF_Api.cpp
+++ /dev/null
@@ -1,205 +0,0 @@
-/**
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * 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 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.
- *
- * Copyright (C) 2002 Blender Foundation. All Rights Reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/**
-
- * $Id$
- * Copyright (C) 2001 NaN Technologies B.V.
- *
- * Implementation of the API of FTGL library.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "../FTF_Api.h"
-#include "FTF_TTFont.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-//XXX #include "datatoc.h"
-#ifdef __cplusplus
-}
-#endif
-
-#define FTF_EXPORT
-
-FTF_TTFont *newfont= 0; // preview font
-
-static FTF_TTFont *_FTF_GetFont(void) {
- static FTF_TTFont *theFont = NULL;
-
- if (!theFont) {
- theFont = new FTF_TTFont();
- }
-
- return theFont;
-}
-
-FTF_EXPORT int FTF_GetNewFont (const unsigned char *str, int datasize, int fontsize) {
-
- if (newfont) delete newfont;
- newfont= new FTF_TTFont();
-
- if (!(newfont->SetFont((unsigned char*)str, datasize, fontsize))) {
- //XXX newfont->SetFont((unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size, fontsize);
- return 0;
- }
- return 1;
-}
-
-FTF_EXPORT float FTF_DrawNewFontString(char* str, unsigned int flag)
-{
- if (newfont)
- return newfont->DrawString(str, flag);
- return 0.0f;
-}
-
-FTF_EXPORT void FTF_End(void) {
- delete _FTF_GetFont();
- delete newfont;
-}
-
-FTF_EXPORT void FTF_SetSize(int size)
-{
- _FTF_GetFont()->SetSize(size);
-}
-
-FTF_EXPORT int FTF_GetSize(void)
-{
- return _FTF_GetFont()->GetSize();
-}
-
-/*
-FTF_EXPORT int FTF_Ascender(void)
-{
- return _FTF_GetFont()->Ascender();
-}
-
-FTF_EXPORT int FTF_Descender(void)
-{
- return _FTF_GetFont()->Descender();
-}
-*/
-
-FTF_EXPORT void FTF_TransConvString(char* str, char* ustr, unsigned int flag)
-{
- _FTF_GetFont()->TransConvString(str, ustr, flag);
-}
-
-/*
-FTF_EXPORT float FTF_DrawCharacter(char c, unsigned int flag)
-{
- char str[2] = {c, '\0'};
- return FTF_DrawString(str, flag);
-}
-*/
-
-
-/* does color too, using glGet */
-FTF_EXPORT float FTF_DrawString(char* str, unsigned int flag)
-{
- return _FTF_GetFont()->DrawString(str, flag);
-}
-
-
-/**
- * not implemente yet.
- */
-FTF_EXPORT float FTF_GetCharacterWidth(char c, unsigned int flag)
-{
- char str[2] = {c, '\0'};
- return FTF_GetStringWidth(str, flag);
-}
-
-
-/**
- * not implemente yet.
- */
-FTF_EXPORT float FTF_GetStringWidth(char* str, unsigned int flag)
-{
- return _FTF_GetFont()->GetStringWidth(str, flag);
-}
-
-
-/**
- * not implemente yet.
- * ## This return string box!! ##
- */
-FTF_EXPORT void FTF_GetBoundingBox(char* str, float *llx, float *lly, float *llz, float *urx, float *ury, float *urz, unsigned int flag)
-{
- _FTF_GetFont()->GetBoundingBox(str, llx, lly, llz, urx, ury, urz, flag);
-}
-
-/**
- * added by phase
- * changed by ton; to allow both file load as memory load (datasize!=0)
- */
-FTF_EXPORT int FTF_SetFont(const unsigned char* str, int datasize, int fontsize)
-{
- return _FTF_GetFont()->SetFont(str, datasize, fontsize);
-}
-
-/* added by ton */
-
-FTF_EXPORT void FTF_SetFontSize(char size)
-{
- _FTF_GetFont()->SetFontSize( size);
-}
-
-/**
- * added by phase
- *
- */
-FTF_EXPORT void FTF_SetLanguage(char* str)
-{
- _FTF_GetFont()->SetLanguage(str);
-}
-
-FTF_EXPORT void FTF_SetEncoding(char* str)
-{
- _FTF_GetFont()->SetEncoding(str);
-}
-
-FTF_EXPORT void FTF_SetPosition(float x, float y)
-{
- _FTF_GetFont()->SetPosition(x, y);
-}
-
-FTF_EXPORT void FTF_SetMode(int mode)
-{
- _FTF_GetFont()->SetMode(mode);
-}
-
-FTF_EXPORT void FTF_SetScale(float fsize)
-{
- _FTF_GetFont()->SetScale(fsize);
-}
-
-
diff --git a/source/blender/ftfont/intern/FTF_TTFont.cpp b/source/blender/ftfont/intern/FTF_TTFont.cpp
deleted file mode 100644
index e8f2b82f970..00000000000
--- a/source/blender/ftfont/intern/FTF_TTFont.cpp
+++ /dev/null
@@ -1,403 +0,0 @@
-/**
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * 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 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.
- *
- * Copyright (C) 2002 Blender Foundation. All Rights Reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <locale.h>
-#include "libintl.h"
-#include "BLI_blenlib.h"
-#include "BKE_font.h"
-
-#include "../FTF_Settings.h"
-
-#include "FTF_TTFont.h"
-
-#ifdef __APPLE__
-#include "BKE_utildefines.h"
-#endif
-
-#define DOMAIN_NAME "blender"
-
-#define SYSTEM_ENCODING_DEFAULT "UTF-8"
-#define FONT_SIZE_DEFAULT 12
-//#define FONT_PATH_DEFAULT ".bfont.ttf"
-
-#define FTF_MAX_STR_SIZE 512
-
-FTF_TTFont::FTF_TTFont(void)
-{
-#ifdef __APPLE__
- char *bundlepath;
-#endif
-
- font=NULL;
- fontm= fonts= fontl= NULL;
- font_size=FONT_SIZE_DEFAULT;
- mode = FTF_PIXMAPFONT;
- fsize = 1.0;
- strcpy(encoding_name, SYSTEM_ENCODING_DEFAULT);
-
- //set messagepath directory
-
-#ifndef LOCALEDIR
-#define LOCALEDIR "/usr/share/locale"
-#endif
-
- strcpy(messagepath, ".blender/locale");
-
- if ( !BLI_exist(messagepath) ) { // locale not in current dir
- BLI_make_file_string("/", messagepath, BLI_gethome(), ".blender/locale");
-
- if( !BLI_exist(messagepath) ) { // locale not in home dir
-
-#ifdef WIN32
- BLI_make_file_string("/", messagepath, BLI_gethome(), "/locale");
- if( !BLI_exist(messagepath) ) {
-#endif
-#ifdef __APPLE__
- /* message catalogs are stored inside the application bundle */
- bundlepath = BLI_getbundle();
- strcpy(messagepath, bundlepath);
- strcat(messagepath, "/Contents/Resources/locale");
- if( !BLI_exist(messagepath) ) { // locale not in bundle (now that's odd..)
-#endif
- strcpy(messagepath, LOCALEDIR);
-
- if( !BLI_exist(messagepath) ) { // locale not in LOCALEDIR
- strcpy(messagepath, "message"); // old compatibility as last
- }
-#ifdef WIN32
- }
-#endif
-#ifdef __APPLE__
- }
-#endif
- }
- }
-}
-
-
-FTF_TTFont::~FTF_TTFont(void)
-{
- if (fonts) delete fonts;
- if (fontm) delete fontm;
- if (fontl) delete fontl;
-}
-
-void FTF_TTFont::SetFontSize(char size)
-{
- if(size=='s') font=fonts;
- else if(size=='l') font=fontl;
- else font=fontm;
-}
-
-int FTF_TTFont::SetFont(const unsigned char* str, int datasize, int fontsize)
-{
- int err = 0;
- bool success = 0;
-
- if (fonts) delete fonts;
- if (fontm) delete fontm;
- if (fontl) delete fontl;
- fonts= NULL;
- fontm= NULL;
- fontl= NULL;
-
- if(mode == FTF_PIXMAPFONT) {
-
- if(datasize) font = new FTGLPixmapFont(str, datasize);
- else font = new FTGLPixmapFont( (char *)str);
-
- err = font->Error();
-
- if(err) {
- printf("Failed to open font %s\n", str);
- return 0;
- } else {
-
- fontm= font;
-
- if(datasize) fonts = new FTGLPixmapFont(str, datasize);
- else fonts = new FTGLPixmapFont((char *)str);
- if(datasize) fontl = new FTGLPixmapFont(str, datasize);
- else fontl = new FTGLPixmapFont((char *)str);
-
- success = fonts->FaceSize(fontsize-2<8?8:fontsize-2);
- success = fontm->FaceSize(fontsize-1<8?8:fontsize-1);
- success = fontl->FaceSize(fontsize);
- if(!success) return 0;
-
- success = fonts->CharMap(ft_encoding_unicode);
- success = fontm->CharMap(ft_encoding_unicode);
- success = fontl->CharMap(ft_encoding_unicode);
- if(!success) return 0;
-
- return 1;
- }
-
- } else if(mode == FTF_TEXTUREFONT) {
-
- if(datasize) font = new FTGLTextureFont(str, datasize);
- else font = new FTGLTextureFont( (char *)str);
-
- err = font->Error();
-
- if(err) {
- printf("Failed to open font %s\n", str);
- return 0;
- } else {
-
- fontm= font;
-
- if(datasize) fonts = new FTGLTextureFont(str, datasize);
- else fonts = new FTGLTextureFont((char *)str);
- if(datasize) fontl = new FTGLTextureFont(str, datasize);
- else fontl = new FTGLTextureFont((char *)str);
-
- success = fonts->FaceSize(fontsize-2<8?8:fontsize-2);
- success = fontm->FaceSize(fontsize-1<8?8:fontsize-1);
- success = fontl->FaceSize(fontsize);
-// success = fonts->FaceSize(fontsize/2);
-// success = fontm->FaceSize(fontsize);
-// success = fontl->FaceSize(fontsize*2);
- if(!success) return 0;
-
- success = fonts->CharMap(ft_encoding_unicode);
- success = fontm->CharMap(ft_encoding_unicode);
- success = fontl->CharMap(ft_encoding_unicode);
- if(!success) return 0;
-
- return 1;
- }
- }
- return 0;
-}
-
-void FTF_TTFont::SetLanguage(char* str)
-{
-
-#if defined (_WIN32) || defined(__APPLE__)
- char envstr[12];
-
- sprintf(envstr, "LANG=%s", str);
- envstr[strlen(envstr)]='\0';
-#ifdef _WIN32
- gettext_putenv(envstr);
-#else
- putenv(envstr);
-#endif
-#else
- char *locreturn = setlocale(LC_ALL, str);
- if (locreturn == NULL) {
- char *lang;
-
- lang = (char*)malloc(sizeof(char)*(strlen(str)+7));
-
- lang[0] = '\0';
- strcat(lang, str);
- strcat(lang, ".UTF-8");
-
- locreturn = setlocale(LC_ALL, lang);
- if (locreturn == NULL) {
- printf("could not change language to %s nor %s\n", str, lang);
- }
-
- free(lang);
- }
-
- setlocale(LC_NUMERIC, "C");
-#endif
-
-
- bindtextdomain(DOMAIN_NAME, messagepath);
-// bind_textdomain_codeset(DOMAIN_NAME, encoding_name);
- textdomain(DOMAIN_NAME);
-
- strcpy(language, str);
-}
-
-
-void FTF_TTFont::SetEncoding(char* str)
-{
- strcpy(encoding_name, str);
-// bind_textdomain_codeset(DOMAIN_NAME, encoding_name);
-}
-
-
-void FTF_TTFont::SetSize(int size)
-{
- fonts->FaceSize(size-2<8?8:size-2);
- fontm->FaceSize(size-1<8?8:size-1);
- fontl->FaceSize(size);
-
- font_size = size;
-}
-
-int FTF_TTFont::GetSize(void)
-{
- return font_size;
-}
-
-/*
-int FTF_TTFont::Ascender(void)
-{
- return (int)font->Ascender();
-}
-
-int FTF_TTFont::Descender(void)
-{
- return (int)font->Descender();
-}
-
-*/
-int FTF_TTFont::TransConvString(char* str, char* ustr, unsigned int flag)
-{
- return 0;
-}
-
-
-float FTF_TTFont::DrawString(char* str, unsigned int flag)
-{
- float color[4];
- wchar_t wstr[FTF_MAX_STR_SIZE-1]={'\0'};
-
- /* note; this utf8towchar() function I totally don't understand... without using translations it
- removes special characters completely. So, for now we just skip that then. (ton) */
- if (FTF_USE_GETTEXT & flag)
- utf8towchar(wstr, gettext(str));
- else if (FTF_INPUT_UTF8 & flag)
- utf8towchar(wstr, str);
-
- glGetFloatv(GL_CURRENT_COLOR, color);
-
- if(mode == FTF_PIXMAPFONT) {
-
- glPixelTransferf(GL_RED_SCALE, color[0]);
- glPixelTransferf(GL_GREEN_SCALE, color[1]);
- glPixelTransferf(GL_BLUE_SCALE, color[2]);
-
- if ((FTF_USE_GETTEXT | FTF_INPUT_UTF8) & flag)
- font->Render(wstr);
- else
- font->Render(str);
-
- glPixelTransferf(GL_RED_SCALE, 1.0);
- glPixelTransferf(GL_GREEN_SCALE, 1.0);
- glPixelTransferf(GL_BLUE_SCALE, 1.0);
-
- } else if(mode == FTF_TEXTUREFONT) {
-
- glEnable(GL_BLEND);
- glEnable(GL_TEXTURE_2D);
-
- glPushMatrix();
- glTranslatef(pen_x, pen_y, 0.0);
- glScalef(fsize, fsize, 1.0);
-
- if ((FTF_USE_GETTEXT | FTF_INPUT_UTF8) & flag)
- font->Render(wstr);
- else
- font->Render(str);
-
- glPopMatrix();
-
- glDisable(GL_BLEND);
- glDisable(GL_TEXTURE_2D);
- }
-
- if ((FTF_USE_GETTEXT | FTF_INPUT_UTF8) & flag)
- return font->Advance(wstr);
- else
- return font->Advance(str);
-}
-
-
-float FTF_TTFont::GetStringWidth(char* str, unsigned int flag)
-{
- wchar_t wstr[FTF_MAX_STR_SIZE-1]={'\0'};
- int len=0;
-
- if (strlen(str)==0) return 0.0;
-
- /* note; this utf8towchar() function I totally don't understand... without using translations it
- removes special characters completely. So, for now we just skip that then. (ton) */
-
- if (FTF_USE_GETTEXT & flag) {
- len=utf8towchar(wstr, gettext(str));
-
- if(mode == FTF_PIXMAPFONT) {
- return font->Advance(wstr);
- } else if(mode == FTF_TEXTUREFONT) {
- return font->Advance(wstr);// * fsize;
- }
- }
- else {
- if(mode == FTF_PIXMAPFONT) {
- return font->Advance(str);
- } else if(mode == FTF_TEXTUREFONT) {
- return font->Advance(str);// * fsize;
- }
- }
-
- return 0.0;
-}
-
-
-void FTF_TTFont::GetBoundingBox(char* str, float *llx, float *lly, float *llz, float *urx, float *ury, float *urz, unsigned int flag)
-{
- wchar_t wstr[FTF_MAX_STR_SIZE-1]={'\0'};
- int len=0;
-
- if (FTF_USE_GETTEXT & flag)
- len=utf8towchar(wstr,gettext(str));
- else
- len=utf8towchar(wstr,str);
-
- font->BBox(wstr, *llx, *lly, *llz, *urx, *ury, *urz);
-}
-
-
-void FTF_TTFont::SetPosition(float x, float y)
-{
- pen_x = x;
- pen_y = y;
-}
-
-
-void FTF_TTFont::SetMode(int m)
-{
- mode = m;
-}
-
-
-void FTF_TTFont::SetScale(float size)
-{
- fsize = size;
-}
-
-
diff --git a/source/blender/ftfont/intern/FTF_TTFont.h b/source/blender/ftfont/intern/FTF_TTFont.h
deleted file mode 100644
index 51247a2d2a1..00000000000
--- a/source/blender/ftfont/intern/FTF_TTFont.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * 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 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.
- *
- * Copyright (C) 2002 Blender Foundation. All Rights Reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/**
-
- * $Id$
- * Copyright (C) 2001 NaN Technologies B.V.
- */
-
-#ifndef __FTF_TRUETYPE_FONT_H
-#define __FTF_TRUETYPE_FONT_H
-
-#include "FTGLPixmapFont.h"
-#include "FTGLTextureFont.h"
-
-#include <stdio.h>
-//#include <iconv.h>
-
-
-/**
- * Base class for Using FTGL, iconv and gettext Library.
- */
-class FTF_TTFont
-{
-public:
- /**
- * Default constructor.
- */
- FTF_TTFont(void);
-
- /**
- * Destructor.
- */
- virtual ~FTF_TTFont(void);
-
-
- void SetSize(int size);
- int GetSize(void);
-
-// int Ascender(void);
-// int Descender(void);
-
- int TransConvString(char* str, char* ustr, unsigned int flag);
-
- /**
- * Draws a string at the current raster position in current opengl color.
- * @param str The string to draw.
- * @param flag Whether use gettext and UTF8 or system encoding.
- */
- float DrawString(char* str, unsigned int flag);
-
- float GetStringWidth(char* str, unsigned int flag);
-
- /**
- * Get the bounding box for a string.
- *
- * @param str The string
- * @param llx Lower left near x coord
- * @param lly Lower left near y coord
- * @param llz Lower left near z coord
- * @param urx Upper right far x coord
- * @param ury Upper right far y coord
- * @param urz Upper right far z coord
- */
- void GetBoundingBox(char* str, float *llx, float *lly, float *llz, float *urx, float *ury, float *urz, unsigned int flag);
-
- /**
- * added by phase, ton
- * functions to communicate with the preference menu
- */
- void SetFontSize(char size);
-
- int SetFont(const unsigned char* str, int datasize, int fontsize);
-
- void SetLanguage(char* str);
-
- void SetEncoding(char* str);
-
- /**
- * functions to communicate with blender ui rasterpos
- */
- void SetPosition(float x, float y);
- void SetMode(int mode);
- void SetScale(float fsize);
-
-protected:
- char messagepath[1024];
-
- char language[32];
- char encoding_name[32];
- char font_name[128];
- int font_size;
-
- int mode; // 0 = pixmap, 1 = texture
- float pen_x, pen_y; //rasterpos
- float fsize;
-
- /** FTGL's */
- FTFont* font; /* active */
-
- FTFont* fonts; /* opened, small medium and large */
- FTFont* fontm;
- FTFont* fontl;
-
- /** from system encoding in .locale to UNICODE */
-// iconv_t cd;
-
- /** from UTF-8 to UNICODE */
-// iconv_t ucd;
-};
-
-#endif // __FTF_TRUETYPE_FONT_H
diff --git a/source/blender/ftfont/intern/Makefile b/source/blender/ftfont/intern/Makefile
deleted file mode 100644
index 6e145ee442e..00000000000
--- a/source/blender/ftfont/intern/Makefile
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# $Id$
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# 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 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.
-#
-# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): none yet.
-#
-# ***** END GPL LICENSE BLOCK *****
-#
-#
-
-LIBNAME = ftfont
-DIR = $(OCGDIR)/blender/ftfont
-
-include nan_compile.mk
-
-CFLAGS += $(LEVEL_1_C_WARNINGS)
-
-#CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
-CPPFLAGS += -I../../makesdna
-CPPFLAGS += -I../../blenkernel
-CPPFLAGS += -I../../blenlib
-CPPFLAGS += -I../../editors/include
-CPPFLAGS += -I$(NAN_FTGL)/include
-CPPFLAGS += -I$(NAN_FTGL)/include/FTGL
-CPPFLAGS += -I$(NAN_GETTEXT)/include
-CPPFLAGS += -I$(NAN_FREETYPE)/include
-ifeq ($(OS), windows)
- CPPFLAGS += -I$(NAN_ICONV)/include
- ifeq ($(FREE_WINDOWS), true)
- CPPFLAGS += -I$(NAN_FREETYPE)/include/freetype2
- CPPFLAGS += -DUSE_GETTEXT_DLL
- endif
-else
- CPPFLAGS += -I$(NAN_FREETYPE)/include/freetype2
-endif
-CPPFLAGS += -I..