Bitmap mode is back.
authorDiego Borghetti <bdiego@gmail.com>
Tue, 28 Jul 2009 20:02:09 +0000 (20:02 +0000)
committerDiego Borghetti <bdiego@gmail.com>
Tue, 28 Jul 2009 20:02:09 +0000 (20:02 +0000)
The option of Texture or Bitmap font is working again, yes it's really
uuuuugly right now, but it work.

On the next commit I go to put this at the same level that texture font.

Change this from User Preferences -> Language -> Textued Fonts, save
the preferences and run blender again.

source/blender/blenfont/intern/blf.c
source/blender/blenfont/intern/blf_glyph.c
source/blender/editors/interface/interface_style.c

index cd7f969d5e5d4761141ac81e18aca05c8cd9f5f1..af57f822c40bf8ed599ea80d9ff10bc38b2a4d7f 100644 (file)
@@ -349,7 +349,7 @@ void BLF_draw(char *str)
                        glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
                        glPushAttrib(GL_ENABLE_BIT);
                        glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
-                       glPixelStorei( GL_UNPACK_ALIGNMENT, 1);
+                       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
                        glDisable(GL_BLEND);
                        glRasterPos3f(font->pos[0], font->pos[1], font->pos[2]);
 
index d2767d6ffb18def4cf82345a005d99270a6ee5c7..9a3d91ac4e518362d1985d1e08969380a0defac0 100644 (file)
@@ -573,10 +573,10 @@ int blf_glyph_bitmap_render(FontBLF *font, GlyphBLF *g, float x, float y)
                        return(0);
        }
 
-       glBitmap(0, 0, 0.0, 0.0, x + font->pos[0], y - font->pos[1], (const GLubyte *)&null_bitmap);
+       glBitmap(0, 0, 0.0, 0.0, x, y, (const GLubyte *)&null_bitmap);
        glPixelStorei(GL_UNPACK_ROW_LENGTH, gt->pitch * 8);
        glBitmap(gt->width, gt->height, 0.0, gt->pos_y, 0.0, 0.0, (const GLubyte *)gt->image);
-       glBitmap(0, 0, 0.0, 0.0, -x - font->pos[0], -y + font->pos[1], (const GLubyte *)&null_bitmap);
+       glBitmap(0, 0, 0.0, 0.0, -x, -y, (const GLubyte *)&null_bitmap);
        return(1);
 }
 
index 762b32056aceeaaf59297e9a5d0008e639a17dbd..9ac839e1283acfd4cdaebb6ecd76eb5a62e3a898 100644 (file)
@@ -248,6 +248,9 @@ void uiStyleInit(void)
                        BLF_size(11, U.dpi);
                        BLF_size(12, U.dpi);
                        BLF_size(14, U.dpi);
+
+                       if (!(U.transopts & USER_USETEXTUREFONT))
+                               BLF_mode(BLF_MODE_BITMAP);
                }
        }