Exemplo n.º 1
0
        public RwGlTypeFaceData GetFontCache(Face face)
        {
            if (!RenderedFontReference.ContainsKey(face))
            {
                throw new KeyNotFoundException("The given face has not been rendered yet.");
            }

            return(RenderedFontReference[face]);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Calculates and retrieves VBO data for the given string as the specified font face.
        /// </summary>
        /// <param name="text">The string to provide VBO data for.</param>
        /// <param name="face">The FreeType font face to use.</param>
        public RwGlTypeFaceBufferData GetStringVboData(string text, Face face)
        {
            RwGlTypeFaceData typeFace = null;

            if (RenderedFontReference.ContainsKey(face))
            {
                typeFace = RenderedFontReference[face];
            }
            else
            {
                typeFace = new RwGlTypeFaceData(face);
                RenderedFontReference.Add(face, typeFace);
            }

            return(typeFace.GetVboForString(text));
        }