Hebrew Font

Dec 23, 2010 at 10:53 AM

Hi,

First - these controls are really great! Thx.

I have an issue with placing hebrew in the Labels - i cannot see the font at all

Please advice!

Thanks,

Udi

Dec 25, 2010 at 7:10 AM

if you open OpenGL.Fonts.FontSprite.cs and see static constructor of class when you can see that there is no any language except english

if you want to add custom language when you need:

1)add you character to character map (in static constructor of FontSprite), like this:

#region modifier
for (int i = 'А'; i <= 'Я'; i++)
     sb.Append((char)i);

for (int i = 'а'; i <= 'я'; i++)
     sb.Append((char)i);
#endif

2) modify function CalculateIdealBitmapHeight of class FontSprite.cs

private int CalculateIdealBitmapHeight(int width)
{
     int charHeight = CharHeight;

     int x = 0;
     int y = 0;

     int trail = LeadingSpace + TrailingSpace;
     width -= trail;
    
     #region modifier
     foreach(char i in DefaultCharacters)
     {
          int charWidth = CharacterWidth(i);
          if ((x + charWidth) >= width)
          {
              x = 0;
              y += charHeight;
          }

          x += charWidth + trail;
      }
      #endregion

      if (x > 0)
          y += charHeight;

      return y + charHeight;
}

P.S. i use beta 3, because i have trouble with beta 4

Dec 25, 2010 at 8:52 AM

Thanks,

I tried to add the Hebrew characters with no sucess...

Udi

Dec 25, 2010 at 9:07 AM

1) can you post you code?

2) if you use beta 4 - remove folder FontCache - font created once, and when use this cache...