Page Menu
Home
Search
Configure Global Search
Log In
Files
F3545
blender_bitmap_font.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Drip Stone (dripstone)
Nov 13 2013, 1:10 PM
Size
7 KB
Subscribers
None
blender_bitmap_font.patch
View Options
Index: source/blender/ftfont/FTF_Settings.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/ftfont/FTF_Settings.h,v
retrieving revision 1.2
diff -u -r1.2 FTF_Settings.h
--- source/blender/ftfont/FTF_Settings.h 19 Jan 2005 13:53:42 -0000 1.2
+++ source/blender/ftfont/FTF_Settings.h 19 Nov 2006 08:53:51 -0000
@@ -45,5 +45,6 @@
#define FTF_INPUT_UTF8 FTF_BIT(3)
#define FTF_PIXMAPFONT 0
#define FTF_TEXTUREFONT 1
+#define FTF_BITMAPFONT 2
#endif /* __FTF_SETTINGS_H */
Index: source/blender/ftfont/intern/FTF_TTFont.cpp
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/ftfont/intern/FTF_TTFont.cpp,v
retrieving revision 1.27
diff -u -r1.27 FTF_TTFont.cpp
--- source/blender/ftfont/intern/FTF_TTFont.cpp 31 Jul 2006 10:49:35 -0000 1.27
+++ source/blender/ftfont/intern/FTF_TTFont.cpp 20 Nov 2006 23:57:12 -0000
@@ -239,6 +239,38 @@
return 1;
}
+ } else if(mode == FTF_BITMAPFONT) {
+
+ if(datasize) font = new FTGLBitmapFont(str, datasize);
+ else font = new FTGLBitmapFont( (char *)str);
+
+ err = font->Error();
+
+ if(err) {
+ printf("Failed to open font %s\n", str);
+ return 0;
+ } else {
+
+ fontm= font;
+
+ if(datasize) fonts = new FTGLBitmapFont(str, datasize);
+ else fonts = new FTGLBitmapFont((char *)str);
+ if(datasize) fontl = new FTGLBitmapFont(str, datasize);
+ else fontl = new FTGLBitmapFont((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;
+ }
+
}
return 0;
}
@@ -338,7 +370,7 @@
glGetFloatv(GL_CURRENT_COLOR, color);
- if(mode == FTF_PIXMAPFONT) {
+ if(mode == FTF_PIXMAPFONT || mode == FTF_BITMAPFONT) {
glPixelTransferf(GL_RED_SCALE, color[0]);
glPixelTransferf(GL_GREEN_SCALE, color[1]);
@@ -393,14 +425,14 @@
if (FTF_USE_GETTEXT & flag) {
len=utf8towchar(wstr, gettext(str));
- if(mode == FTF_PIXMAPFONT) {
+ if(mode == FTF_PIXMAPFONT || mode == FTF_BITMAPFONT) {
return font->Advance(wstr);
} else if(mode == FTF_TEXTUREFONT) {
return font->Advance(wstr);// * fsize;
}
}
else {
- if(mode == FTF_PIXMAPFONT) {
+ if(mode == FTF_PIXMAPFONT || mode == FTF_BITMAPFONT) {
return font->Advance(str);
} else if(mode == FTF_TEXTUREFONT) {
return font->Advance(str);// * fsize;
Index: source/blender/ftfont/intern/FTF_TTFont.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/ftfont/intern/FTF_TTFont.h,v
retrieving revision 1.10
diff -u -r1.10 FTF_TTFont.h
--- source/blender/ftfont/intern/FTF_TTFont.h 21 Jan 2005 14:48:02 -0000 1.10
+++ source/blender/ftfont/intern/FTF_TTFont.h 19 Nov 2006 08:52:08 -0000
@@ -38,6 +38,7 @@
#define __FTF_TRUETYPE_FONT_H
#include "FTGLPixmapFont.h"
+#include "FTGLBitmapFont.h"
#include "FTGLTextureFont.h"
#include <stdio.h>
@@ -107,7 +108,7 @@
char font_name[128];
int font_size;
- int mode; // 0 = pixmap, 1 = texture
+ int mode; // 0 = pixmap, 1 = texture, 2 = bitmap
float pen_x, pen_y; //rasterpos
float fsize;
Index: source/blender/include/blendef.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/include/blendef.h,v
retrieving revision 1.58
diff -u -r1.58 blendef.h
--- source/blender/include/blendef.h 29 Aug 2006 10:27:47 -0000 1.58
+++ source/blender/include/blendef.h 21 Nov 2006 00:02:31 -0000
@@ -272,7 +272,7 @@
#define B_SETTRANSBUTS 315
#define B_DOLANGUIFONT 316
#define B_RESTOREFONT 317
-#define B_USETEXTUREFONT 318
+#define B_FONTTYPE 318
#define B_UITHEMECHANGED 320
#define B_UITHEMECOLORMOD 321
Index: source/blender/makesdna/DNA_userdef_types.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/makesdna/DNA_userdef_types.h,v
retrieving revision 1.61
diff -u -r1.61 DNA_userdef_types.h
--- source/blender/makesdna/DNA_userdef_types.h 8 Nov 2006 12:46:41 -0000 1.61
+++ source/blender/makesdna/DNA_userdef_types.h 20 Nov 2006 23:44:44 -0000
@@ -177,6 +177,8 @@
char versemaster[160];
char verseuser[160];
short pad;
+ int fonttype;
+ int pad1;
} UserDef;
extern UserDef U; /* from usiblender.c !!!! */
@@ -237,6 +239,7 @@
#define USER_TR_TEXTEDIT 16
#define USER_DOTRANSLATE 32
#define USER_USETEXTUREFONT 64
+#define USER_USEBITMAPFONT 128
/* dupflag */
Index: source/blender/src/headerbuttons.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/headerbuttons.c,v
retrieving revision 1.134
diff -u -r1.134 headerbuttons.c
--- source/blender/src/headerbuttons.c 17 Nov 2006 04:47:38 -0000 1.134
+++ source/blender/src/headerbuttons.c 21 Nov 2006 00:01:09 -0000
@@ -1477,7 +1477,8 @@
allqueue(REDRAWALL, 0);
break;
- case B_USETEXTUREFONT: /* is button from space.c *info* */
+ case B_FONTTYPE: /* is button from space.c *info* */
+ U.transopts = U.transopts & 0x3f | U.fonttype;
refresh_interface_font();
allqueue(REDRAWALL, 0);
break;
Index: source/blender/src/language.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/language.c,v
retrieving revision 1.36
diff -u -r1.36 language.c
--- source/blender/src/language.c 2 Jul 2006 13:08:27 -0000 1.36
+++ source/blender/src/language.c 20 Nov 2006 21:53:41 -0000
@@ -190,6 +190,21 @@
return string;
}
+char *font_pup(void)
+{
+ static char string[1024];
+ char formatstring[1024];
+
+ strcpy(formatstring, "Choose Font Type: %%t|%s %%x%d|%s %%x%d|%s %%x%d");
+
+ sprintf(string, formatstring,
+ "Use Textured Font", 1<<6,
+ "Use Bitmap Font", 1<<7,
+ "Use Pixmap Font", 1<<8
+ );
+
+ return (string);
+}
static LANGMenuEntry *find_language(short langid)
{
@@ -243,6 +258,8 @@
if(U.transopts & USER_USETEXTUREFONT)
FTF_SetMode(FTF_TEXTUREFONT);
+ else if(U.transopts & USER_USEBITMAPFONT)
+ FTF_SetMode(FTF_BITMAPFONT);
else
FTF_SetMode(FTF_PIXMAPFONT);
Index: source/blender/src/space.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/space.c,v
retrieving revision 1.400
diff -u -r1.400 space.c
--- source/blender/src/space.c 18 Nov 2006 21:01:25 -0000 1.400
+++ source/blender/src/space.c 21 Nov 2006 00:03:45 -0000
@@ -3078,11 +3078,10 @@
uiDefButI(block, MENU, B_SETLANGUAGE, language_pup(),
(xpos+edgsp+(2.2*mpref)+(3*midsp)),y2,mpref+(0.5*mpref)+3,buth,
&U.language, 0, 0, 0, 0, "Select interface language");
-
- uiDefButBitS(block, TOG, USER_USETEXTUREFONT, B_USETEXTUREFONT, "Use Textured Fonts",
+
+ uiDefButI(block, MENU, B_FONTTYPE, font_pup(),
(xpos+edgsp+(4*mpref)+(4*midsp)),y2,mpref,buth,
- &(U.transopts), 0, 0, 0, 0,
- "Use Textured Fonts");
+ &(U.fonttype), 0, 0, 0, 0, "Select font type");
}
/* end of INTERNATIONAL */
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ac/c6/19cd6bf165fdf36e3139f4fb2dac
Event Timeline
Log In to Comment