[Bf-committers] Fwd: Russian letters in Text Exitor window and in Browser Window

Jury Azovtzev gumanoed at gmail.com
Thu Aug 16 16:34:43 CEST 2007


Thenk you Sheep!
We'll try it soon and i'll make a report here.

On 8/16/07, sheep <sheepzilla at gmail.com> wrote:
>
> Hi, I talked with you a little on IRC yesterday.
>
> The attached patch will let you use any font you like in the text
> editor, by selecting it as the ui font, but it will be very buggy unless
> the font is a fixed width one. I don't have any linux graphics drivers
> that work at the moment, so I won't compile a binary,  I don't think
> you'd find compiling on Linux very difficult though.
>
>
> James
>
>
> Jury Azovtzev wrote:
> >
> > I'm a russian blender community member and we are looking for medium
> > to solve some problems with russian letter in blender.
> >
> > We have problems with russian letter in Python cripting Window
> > (strange chars not russian, nor any other language i know).
> > There is a problem with russian letter in Browse Windows. All russian
> > folders and files unreadable.
> > But when you make 3D Text with right font - all is greate - you get
> > Cyrilic text in rendered image.
> >
> > We tryed to load font with russian letter as UI Font  - it dosn't
> > help. People says there is an offset of letter  Blender Use ans Right
> > Letters it should be.  Tests  was made in Ubuntu Linux, Windows XP,
> > Gentoo.
> >
> > Is it any way to solve the problem?
> > Does someone support this part of the project?
> > Is it any documentation about this part of the Blender?
> >
> >
> >
> > --
> > With best regards.
> > Azovtzev Jury
> >
> > ForceTeam NNLUG
> > www.forceteam.nnov.ru <http://www.forceteam.nnov.ru>
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-committers
> >
>
>
> Index: source/blender/src/drawtext.c
> ===================================================================
> --- source/blender/src/drawtext.c       (revision 11622)
> +++ source/blender/src/drawtext.c       (working copy)
> @@ -76,6 +76,7 @@
> #include "BIF_space.h"
> #include "BIF_mywindow.h"
> #include "BIF_resources.h"
> +#include "BIF_language.h"
>
> #include "BSE_filesel.h"
>
> @@ -121,7 +122,7 @@
> }
>
> static int spacetext_get_fontwidth(SpaceText *st) {
> -       return BMF_GetCharacterWidth(spacetext_get_font(st), ' ');
> +       return BIF_GetStringWidth(spacetext_get_font(st), " ", 0);
> }
>
> static char *temp_char_buf= NULL;
> @@ -580,12 +581,14 @@
>                                                 break;
>                                 }
>                                 glRasterPos2i(x, y);
> -                               BMF_DrawString(spacetext_get_font(st),
> out);
> -                               x =
> x+BMF_GetStringWidth(spacetext_get_font(st), out);
> +                               BIF_RasterPos(x, y);
> +                               BIF_DrawString(spacetext_get_font(st),
> out, 0);
> +                               x =
> x+BIF_GetStringWidth(spacetext_get_font(st), out, 0);
>                         }
>                 } else {
>                         glRasterPos2i(x, y);
> -                       BMF_DrawString(spacetext_get_font(st), in);
> +                       BIF_RasterPos(x, y);
> +                       BIF_DrawString(spacetext_get_font(st), in, 0);
>                 }
>         } else {
>                 while (w-- && *acc++ < maxwidth) {
> @@ -985,11 +988,13 @@
>                         if(((float)(i + linecount + 1)/10000.0) < 1.0) {
>                                 sprintf(linenr, "%4d", i + linecount + 1);
>                                 glRasterPos2i(TXT_OFFSET - 7,
> curarea->winy-st->lheight*(i+1));
> +                               BIF_RasterPos(TXT_OFFSET - 7,
> curarea->winy-st->lheight*(i+1));
>                         } else {
>                                 sprintf(linenr, "%5d", i + linecount + 1);
>                                 glRasterPos2i(TXT_OFFSET - 11,
> curarea->winy-st->lheight*(i+1));
> +                               BIF_RasterPos(TXT_OFFSET - 11,
> curarea->winy-st->lheight*(i+1));
>                         }
> -                       BMF_DrawString(spacetext_get_font(st), linenr);
> +                       BIF_DrawString(spacetext_get_font(st), linenr, 0);
>                         text_draw(st, tmp->line, st->left, 0, 1,
> TXT_OFFSET + TEXTXLOC, curarea->winy-st->lheight*(i+1), tmp->format);
>                 } else
>                         text_draw(st, tmp->line, st->left, 0, 1,
> TXT_OFFSET, curarea->winy-st->lheight*(i+1), tmp->format);
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>
>


-- 
With best regards.
Azovtzev Jury

ForceTeam NNLUG
www.forceteam.nnov.ru
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-committers/attachments/20070816/46aecbff/attachment.htm 


More information about the Bf-committers mailing list