Example #1
0
 public void AddFallback(FreeTypeFace face)
 {
     faces.AddLast(face);
     face.SetCharSize(Fixed26Dot6.FromSingle(FontSize));
     if (whitespace < face.FontMetrics.Width)
     {
         whitespace = face.FontMetrics.Width;
     }
 }
Example #2
0
 public void SetFontSize(float fontSize)
 {
     FontSize = fontSize;
     foreach (var freeTypeFace in faces)
     {
         freeTypeFace.SetCharSize(Fixed26Dot6.FromSingle(fontSize));
         if (whitespace < freeTypeFace.FontMetrics.Width)
         {
             whitespace = freeTypeFace.FontMetrics.Width;
         }
     }
     foreach (var spriteMap in spriteMaps)
     {
         spriteMap.Dispose();
     }
     spriteMaps.Clear();
     spriteReferences.Clear();
 }
Example #3
0
        public static bool LoadFace(ref Texture_Font_T font, ref Library library, ref Face face, float size)
        {
            library = new Library();
            if (library == null)
            {
                return(false);
            }
            face = new Face(library, font.Filename);
            if (face == null)
            {
                return(false);
            }
            face.SelectCharmap(Encoding.Unicode);
            face.SetCharSize(Fixed26Dot6.FromSingle(size), 0, DPI * HRES, HRES);
            FTMatrix matrix = new FTMatrix((int)(1.0 / HRES * 0x10000L), (int)(0.0 * 0x10000L), (int)(0.0 * 0x10000L), (int)(1.0 * 0x10000L));

            face.SetTransform(matrix);
            return(true);
        }